1
  1. 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);
            }
          );
        }
    
Simone Rossaini
  • 8,115
  • 1
  • 13
  • 34
Wilem
  • 13
  • 2

1 Answers1

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:

https://develop.zendesk.com/hc/en-us/articles/360001074828

SherylHohman
  • 16,580
  • 17
  • 88
  • 94