Through REST API, How to get RITM and Task values for each Request?

soibam_ana_sing
Giga Contributor

we are integration SNOW with third party platform " Hybrid cloud management" through REST APIs. we use only REST APIs for integration. 

We order Catalog Items through Service catalog APIs(https://docs.servicenow.com/bundle/istanbul-servicenow-platform/page/integrate/inbound-rest/reference/r_SCatAPIAddItemToCartPOST.html#ariaid-title12)  and a request is generated (REQ0010180). Through REST APIs, How would I get RITM and Task values for each Request? 

we don't want to use  client script gliderecord

 

regards

Soibam

6 REPLIES 6

Brad Tilton
ServiceNow Employee
ServiceNow Employee

When you order the catalog item through the rest api you should get a response with the create Request number and sys_id. Based on that you can use the REST Table API to query the RITMs related to that request, and then a second GET to get all of the tasks associated with those items.

find_real_file.png

here is REST API and it return empty json

 

GET https://devXXXX.service-now.com/api/now/table/sc_req_item?sysparm_query=request%3DREQ0010180&sysparm_limit=1 

{
  "result": []
}

 

 

 

Its work with passing sys_id in sysparam_query

https://devXXX.service-now.com/api/now/table/sc_req_item?sysparm_query=request%3D0c4c9457dbd4a30071ec771c8c961916&sysparm_limit=1

Yes, you should pass the sys_id there instead of the number, but you could do something like:

GET https://devXXXX.service-now.com/api/now/table/sc_req_item?sysparm_query=request.number%3DREQ0010180&sysparm_limit=1