When i use the request method on my endpoint it return me a code status 200 but my body is empty. Someone can help me ?
$(function() { var client = ZAFClient.init(); client.invoke('resize', { width: '100%', height: '500px' }); client.get('ticket.requester.id').then( function(data) { var userId = data['ticket.requester.id']; requestUserInfo(client, userId); } ); }); function requestUserInfo(client) { var settings = { url: `${url}`, type:'POST', headers : { "Content-Type": "application/json", "authorizationToken": "allow", }, body : JSON.stringify({ user_id: `${user_id}` }), }; client.request(settings).then( function(data) { console.log(data) }, function(response) { showError(response); } ); }
Zendesk app POST method return status code 200 but body return null
396 views Asked by Wilem At
1
I think the reason you aren't seeing the expected results is because within your function
requesterUserInfo
method, you'll want to ensure you are passing in the ID as well and making sure to set the type to GET instead of a POST. Theclient.request(settings)
method should have a.then
that would display the data. I would kindly recommend reviewing the article shown from Zendesk:https://develop.zendesk.com/hc/en-us/articles/360001074828