0

POST Response: How to Retrieve and Parse JSON in .done and .fail?

Ref: http://developer.zendesk.com/documentation/apps/requests.html

After reading "Requests" section, it is not clear to me how to retrieve and parse POST Response.

For example, this POST Endpoint https://int.tangocard.com/Version2/GetAvailableBalance is expected to return upon status 200 a JSON object with mixed format: { responseType String, response Array }.

It is not clear how <ajax request>.done and <ajax request>.fail is expected retrieve and parse their respective JSON responses.

Example would be helpful

Thank you for your assistance

Jeff in Seattle

 

2 comments

  • 0

    Hi Jeff.

    I do it like this:

    'fetchdata.done': function(data){
           services.notify('The request succeeded');
           this.render(data);
    }

    The response data (JSON object) is automagically added as a function parameter.

    Best regards,
    Thomas Balsløv.

  • 0

    Thx for you reply

Please sign in to leave a comment.