Create a Service Catalog Request via REST API

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2017 10:01 AM
Hello, is it possible to create a Service Catalog Request programmatically using the REST API?
We have an existing Requested Item and we want to request it via REST API script externally.
Thanks!
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2017 10:20 AM
Yes it is possible by using Service Catalog API, please refer Service Catalog API for more information. you can also refer
How to create service catalog request using REST API
Thanks,
Sai
Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2017 10:44 AM
Thank you. How can we set the value of the variables in the script? This example shows how to add to cart, but does not show how to set any of the variables on the requested item.
Service Catalog API - POST /sn_sc/servicecatalog/items/{sys_id}/add_to_cart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2017 10:55 AM
According to the documentation sysparm_quantity is required along with variables in the request body. Variables are in an object with variable names and their values. So something like the following should work:
{"sysparm_quantity":"1","variables":{"user":"user_name"}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2017 10:59 AM