How to pass JSON data when running REST API request
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 09:51 AM
I am using a scripted REST API. From another system, is it possible to send some data in the form of JSON data? How would I go about doing that with a curl command? I can pass the query parameter within the URL, but that's not what I need.
I would like to use the GET method, but I don't believe --data flag can be used with GET. So I would have to use POST.
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 12:22 PM
Below is how you can parse out data you need or leave it as it.
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var requestBody = request.body.dataString;
var j = new JSONParser();
var obj = j.parse(requestBody);
//if there is id then it will be like obj.id
})(request, response);