Inbound REST API (Service Catalog API) how to assistance

Joseph45
Tera Contributor

I am interested in creating inbound REST API from ISIM into ServiceNow. I have found that I need to use the Service Catalog API in order to have a REQ created which in turn created a RITM and SCTASK. I have looked at the Service Catalog API documentation but it unfortunately wasn't as helpful as I was hoping. Is there any documentation/videos which shows how to setup and utilize the Service Catalog API? 

5 REPLIES 5

Geoff_T
Mega Sage

Hello,

I use the Buy Item resource from the Service Catalog API:

find_real_file.png

 

Sample request (POST) is:

https://instance.service-now.com/api/sn_sc/servicecatalog/items/sys_id_of_catalog_item/order_now

 

With a request body (JSON):

{
               "sysparm_quantity": "1",
               "variables": {
                              "FieldName1":"Value1",
                              "FieldName2": "Value2",
                              "FieldName3": "Value3",
                              "FieldName4": "Value4"
               },
               "sysparm_requested_for": "sys_id_of_requested_for_user"
}

 

sysparm_quantity: the number of requests to create.

variables: an object build up of the catalog variable names and values. NOTE: for reference fields / list collectors you need to pass the sys_id value (comma separated for multiple list collector values). 

sysparm_requested_for: the sys_id of the user record you are requesting for

 

This requires basic authorization to POST with a User Name / Password set up in your SN instance. 

 

I hope this helps. Any other questions let me know.

 

Geoff

Hi Joseph - please let me know if this answered your question.

Hi Geoff,

I have used the above code

 

{
"sysparm_quantity": "1",
"variables": {
"shipment_type": "By Ship",

},
"sysparm_requested_for": "3Daf521d3447911e10339a0c59e16d43cf"
}

tried to run but Iam getting code 500 internal, 

 

[please suggest on this]

You can probably just remove the comma at the end of:
"shipment_type": "By Ship",