- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2018 08:39 AM
Hello,
I am trying to find some information on how to create an item from my catalog via rest API. I have many items that have Variables in them that need to be filled out to capture data before submission. I have need to create items via REST. I understand that the Service Catalog API can be used to do this, but I need to set my custom created variables as well.
Example:
I have an Item called "Request Something Else". This item has three variables on the form. Those are Description and User. I need to populate these two variables with plain text. How would one go about setting up this request in the REST API Explorer for example using the Service Catalog API?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2018 10:57 AM
If you take a look at the Service Catalog API scripted rest api in your instance, then click into the Add Item To Cart scripted rest resource and click the documentation tab it gives you a request body example that you should be able to use to add an item to the cart with the variables populated:
{
'sysparm_quantity': 2,
'variables': {
'carrier': 'at_and_t_mobility',
'data_plan': '500MB',
'duration': 'eighteen_months',
'color': 'black',
'storage': 'sixtyfour'
}
}
The documentation for that endpoint can be found here.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2018 10:57 AM
If you take a look at the Service Catalog API scripted rest api in your instance, then click into the Add Item To Cart scripted rest resource and click the documentation tab it gives you a request body example that you should be able to use to add an item to the cart with the variables populated:
{
'sysparm_quantity': 2,
'variables': {
'carrier': 'at_and_t_mobility',
'data_plan': '500MB',
'duration': 'eighteen_months',
'color': 'black',
'storage': 'sixtyfour'
}
}
The documentation for that endpoint can be found here.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2018 10:11 AM
Hello Brad,
This came handy. I got another issue. we are using a bot to call the catalog. Be default the Requested For/Caller is being set as the user logged in for the bot service (Eg. admin). How do i change this? I am capturing the user details using the bot. Setting the variables is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2018 10:21 AM
Hi Brad,
How can I set the fields (requested_for, opened_by) value of sc_request/sc_req_item using the service catalog rest API?
Thank you.
Ravi Gupta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2018 02:01 PM
I think requested for would be on the cart (you might need to look at the scripted rest api for that) and then opened by will default to the user account making the rest call.