Http Requests

Comments

7 comments

  • Avatar
    Adam

    @chad that link doesn't seem to work for me. Is the service still running?

    One other thing to try is using console.log() for your calls. For example: 

     

    console.log(data);

     

    will give you the data object and let you see what's being returned. 

  • Avatar
    Chad Pickerell

    @Adam, sorry I was hosting the service on my local machine.  You should now be able to reach it at:

    http://dev.policyworks.com/MaxDataService/APIs/MaxDataRetriever.svc/userdata/helloworld 

    This will return some test data in json.

  • Avatar
    Adam

    @Chad I'm not getting anything back when I hit that URL. 

  • Avatar
    Chad Pickerell

    @Adam, this one should work now:

    http://testing.policyworks.com/MaxDataService/APIs/MaxDataRetriever.svc/UserData/blah

    I've tested it from outside our local network and was able to get some data back.

  • Avatar
    Chad Pickerell

    @Adam, I should also mention that the default return type is json but I've seen some browsers (ie. Chrome) return it as xml.  It depends on the value of the 'Content-Type:' header in the request.  Do http requests in the zendesk apps support the addition/modification of the http request headers?

  • Avatar
    James A. Rosen

    App AJAX requests take all of the options that jQuery.ajax does, so if you want to set the Accept header to "application/json", set dataType to "json":

    fetchUserData: function() { return { url: 'http://...', type: 'GET', dataType: 'json' }; }

  • Avatar
    Edd Es Au N Caro

    request (35905)  I dont have any answer about my request and also 35725

    any body can help me or give me a telephone number to call

Please sign in to leave a comment.

Powered by Zendesk