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); } ); }
Asked
Active
Viewed 303 times
1

Simone Rossaini
- 8,115
- 1
- 13
- 34

Wilem
- 13
- 2
1 Answers
0
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. The client.request(settings)
method should have a .then
that would display the data. I would kindly recommend reviewing the article shown from Zendesk:

SherylHohman
- 16,580
- 17
- 88
- 94

Jonny Pabon
- 1
- 2