• DOCUMENTATION
  • WORKATO BLOG
  • PRODUCT BLOG
  • Return to Workato
  • Log in
  • ☰
  • Community/Discussions
Solution home App Resources HTTP

HTTP: Make REST Request Action - Response Type

Modified on: Mon, Jan 28, 2019 at 5:39 PM

HTTP REST Request Action : JSON, XML, or Raw HTTP?

Determining the rules that will structure the data you will be receiving


Data received from an API call can come in different structures. The most common, and widely adopted standard is the JSON format. When making a HTTP call using Workato, by providing a sample JSON response, Workato is able to work out the structure of the API call, and creates Data Pills to be used in your recipe in later sections.


XML or JSON?


XML is a general language that is commonly used in the internet. One good way to spot a sample XML response is by identify XML tags. XML tags often look like this : 


<job>
     <Name>Adam</name>
     <Company>Workato</company>
</job>      


In plain English, you can read this as : A Job object has a Name and a Company. The Name of the Job is called Adam, and the Company of the Job is called Workato. In XML Format, each field has an opening tag ( <job> ) and a closing tag </job> . Anything in between would be the value that that the tag holds.



Meanwhile, here is an example of how JSON data looks like

 

{
"Job":   
   {
     "Name" : "Adam",   
     "Company" : "Workato" 
   }
}


 

A JSON representation is similar to XML, but with its own set of rules. A JSON object is represented by its opening and closing curly brackets. The first value before the colon would be the Object or fields' Name, and the right hand side of the colon would represent its value. 


The main diference of these two data formats are only how they are actually formatted. Data usually stays the same.


http_responsetype.jpg


An example of a comparison between XML and JSON




Here's a sample of an API with its endpoint's sample response type : 

http_response_type.PNG


Based on our previous understanding, we can know that the response data is in JSON format.


RAW HTTP

Instead of letting Workato parse the given response data, you can also opt for getting the raw input response. This is useful when data pills are not needed from the sample response, and only a simple line of response data will be received. When chosen this option, A data pill call Body will be available instead of the provided structure with each field as a data pill.




http_raw_response.PNG



Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

Related Articles

    Still can't find your solution?

    Visit our forums to search for answers, or post your own questions.

    Documentation
    Developer's Library
    Tutorials
    eBooks
    Product Hour
    Product Blog
    Workato Blog
    Product updates
    Customer Stories
    © Workato 2020   Privacy   Terms   +1 (844) 469-6752
    • Documentation
    • Workato Blog
    • Product Blog
    • Solutions
    • Forums
    • Tickets
    • Log in
    • Return to Workato