How to pass muliple query parameter as request body to fetch data from Incident Table

Aditi6
Tera Contributor

Hi All,

 

I am doing integration with 3rd party system wherein I need to fetch data from ServiceNow incident table and I have long list of query parameters which needs to be passed as JSON in request body. 

 

If someone has done, please provide an example of request body.

 

Regards,

AG

5 REPLIES 5

Ahmmed Ali
Mega Sage

Hello @Aditi6 

 

OOTB table API to read table data (GET) will not have request body. You will need to pass query in URL, but it will have length limit.

 

POST type API will have the request body. You can custom script API of type POST and in script, you can query table data and send response as needed.

 

But TBH it does not make sense to have POST type API to read data, but if it is must have business need then you can do it.

 

Thank you,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Hi Ali,

 

Thanks for response.

We are using GET API, but it gives 414 Request-URI Too Large, as per solution posted on community, they asked to convert to POST.


https://www.servicenow.com/community/itsm-forum/saying-quot-414-request-uri-too-large-quot-serviceno...

Please help if in example how to send multiple incident numbers as a filter criteria. We are using POSTMAN to fetch data

You can try the scripted rest API for get, define the request payload and custom response body.

Ankur Bawiskar
Tera Patron
Tera Patron

@Aditi6 

you need to use GET to send query parameters.

if it has limitations then you can pass encoded query

what's your exact use case?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader