- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 01:46 PM
Hi,
How do I submit a request for a catalog item via REST? Here's why I tried:
$> curl -v -u 'snowid:snowpass' --header "Content-Type: application/json" --request POST --data-binary @Internal-SSL-Certificate-Request.json https://company.service-now.com/api/sn_sc/servicecatalog/items/cdf6d374c3d0fd90cc253bee05013113/submit_producer
That yields:
{"error":{"message":"Record Producer does not exists","detail":""},"status":"failure"}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 10:48 AM
That endpoint works fine with a GET, both with the GUI and curl. That's how I know my credentials are okay.
The issue turns out to be that I should be using a different endpoint than the docs and GUI suggest. For the record, this is how to order a catalog item with curl:
curl -v -u 'id:pass' --header "Content-Type: application/json" --request POST --data-binary @Internal-SSL-Certificate-Request.json
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 03:20 PM
Those are the steps I followed. I provided the catalog item sys_id, not the record producer sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 12:52 AM
Hi @snowblind
Can you try calling this API from the ServiceNow REST API explorer itself instead of Curl ? Also, in the REST API explorer, please try to get your catalog item first using the Specific Catalog Item API which is available on endpoint
https://yourinstance.service-now.com/api/sn_sc/servicecatalog/items/{sys_id}
This is just to ensure that your are targeting the right catalog item.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 10:48 AM
That endpoint works fine with a GET, both with the GUI and curl. That's how I know my credentials are okay.
The issue turns out to be that I should be using a different endpoint than the docs and GUI suggest. For the record, this is how to order a catalog item with curl:
curl -v -u 'id:pass' --header "Content-Type: application/json" --request POST --data-binary @Internal-SSL-Certificate-Request.json
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 01:33 AM
Hi @snowblind
There's a couple of things you can double-check.
1. Verify this sys_id "cdf6d374c3d0fd90cc253bee05013113" exist in the Record Producer [sc_cat_item_producer] table.
2. Validate the Authenticated user has access to the Record Producer.
URL: https://<instance_name>/sc_cat_item_producer.do?sys_id=cdf6d374c3d0fd90cc253bee05013113
Cheers,
Tai Vu