Outbound REST API in JSON format

Katie A
Mega Guru

Hello, I have successfully created an outbound REST request that is returning a response in XML format. I have confirmed that our third party supplies both XML and JSON formatted responses in the same resource url.

The outbound REST message is returning the response on XML, how can I set it to return the response in JSON format instead? Is there a setting on the ServiceNow API message?

1 ACCEPTED SOLUTION

Rushit Patel2
Tera Guru

Hi kda,



see below image


find_real_file.png


u can set Http header called accept.



see if it works.



mark helpfu/correct/like if it helps



Regards,


Rushit Patel


View solution in original post

4 REPLIES 4

Rushit Patel2
Tera Guru

Hi kda,



see below image


find_real_file.png


u can set Http header called accept.



see if it works.



mark helpfu/correct/like if it helps



Regards,


Rushit Patel


Ok great! That works, Thank you very much.


br194
Kilo Explorer

Folks,



Can someone guide me how we can fetch the incident results in the Json format using JavaScript.


CORS issue.png



When I browse the URL in IE, I was able to get the results.



ServiceNow restults.png