Create GET Scripted API with JSON Request body

Sameer18
Tera Contributor

I wanted to create scripted GET API which will have a JSON in request body.

I tried creating GET API however I found that I can pass data only through query parameters.

Example API:

GET "API Path"

Request Body:

{

incidentNumner: "12345"

createdBy: "admin"

State: "New"

}

 

 

   

1 ACCEPTED SOLUTION

Kamal17
Kilo Sage

Hi Sameer,

I don't think you can send JSON object as request body for GET method. In case if you have a lengthy request body for your GET method then you may use POST method in the scripted REST API to send request and retrieve the information.

Mark Correct if this solves your issue. Hit Like/Helpful based on the impact.

Regards,

Udhay

View solution in original post

2 REPLIES 2

Kamal17
Kilo Sage

Hi Sameer,

I don't think you can send JSON object as request body for GET method. In case if you have a lengthy request body for your GET method then you may use POST method in the scripted REST API to send request and retrieve the information.

Mark Correct if this solves your issue. Hit Like/Helpful based on the impact.

Regards,

Udhay

Aditi6
Tera Contributor

Can someone provide example to how send multiple incident numbers in POST request body as JSON.