Issue
Submitting a catalog item using the REST API 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. In the use case shown, we will be using the OOB "Create Incident" Record Producer, and the Service Portal as a starting point.
Resolution
- Copy the sys_id of the Item for later use
- Open the Item on the Service Portal
- Fill in all mandatory variables
- In Chrome:
- Open the developer tools (F12)
- 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 (see screenshot), 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 form as indicated:
- 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.
- If there are no problems, you will see a 200 OK Response.