8 views

How to submit a catalog item using the Rest API



Description


This article runs through on how to submit a catalog item using the Rest API. This can be used to narrow issues down to the API, or to rule out the UI Pages and Service Portals involved in the process of submitting an Item. 

Procedure


In this example we will be using the OOB “Create Incident” Record Producer and using the Service Portal as a start point.

  • Copy the sys_id of the Item for later use
  • Open the Item on the Service Portal
  • Fill all mandatory variables
  • In Chrome, open the developer tools, and switch to the network tab
  • Clear the current log and Click on “Preserve Log”
  • Submit the Item
  • In the log you will see a “submit_producer” request, click on that and click on the “Header” tab
  • Scroll down and locate “Request Payload”
  • Next to “Request Payload”, click on “View Source”
  • Copy the whole string of the payload (This is what we will use in the Rest API)

  • Go to the Platform UI
  • Navigate to System Web Services > Rest API Explorer
  • Click “Explore”
  • Set Namespace to sn_sc
  • Set API Name to Service Catalog API
  • Set API Version to Latest
  • From the list of Default Cart Contents displayed, choose “Submit a Record producer”
  • Fill values in the from as below:

Sys_id: paste sys_id of the Catalog Item

sysparm_view: view you want to use (optional)

Request format: Application/json

Response format: Application/json

Authorization: Send as me

Builder: leave blank

Raw: Paste the Request Payload

 

  • Click Send

If there are no problems, you will see a 200 OK Response.

Applicable Versions


All Supported

Additional Information


https://docs.servicenow.com/bundle/jakarta-application-development/page/integrate/inbound-rest/concept/c_RESTAPIExplorer.html

https://docs.servicenow.com/bundle/jakarta-application-development/page/integrate/inbound-rest/concept/c_ServiceCatalogAPI.html

 

Article Information

Last Updated:2018-05-16 07:51:14
Published:2018-05-14