Create Request/RITM via API

CA5
Tera Contributor

@Ankur Bawiskar  Could you please provide me step by step instructions to create Request/RITM in servicenow Instance via Rest API from third party tool.

Note: First, request form will be submitting on third party tool and it should create a request in servicenow instance with same form data [payload will be provided to insert or create request in servicenow instance].

How can we achieve this requirement?

Link

18 REPLIES 18

Could you please provide your insight on the below points?

 

1> There is an OOB Scripted Rest Service viz. "Service Catalog API". Do I need to use "Buy Item" {Post Method} resource to fulfill this requirement?

 

2> What Client has to do in their side on their third party tool to call this Scripted Rest Service? Do I need to only provide them servcienow instance api url as mentioned below to call this Rest Service

 

https://clientinstancename.service-now.com/api/sn_sc/servicecatalog/items/04b7e94b4f7b4200086eeed18110c7fd/order_now

if yes, then how they will be setting payload for the request which has been created their side on 3rd party tool?

 

Hi,

Points below

1> There is an OOB Scripted Rest Service viz. "Service Catalog API". Do I need to use "Buy Item" {Post Method} resource to fulfill this requirement?

- the same is mentioned in my steps. to use Service Catalog API and use Buy Item method

2> What Client has to do in their side on their third party tool to call this Scripted Rest Service? Do I need to only provide them servcienow instance api url as mentioned below to call this Rest Service

- they need to give the endpoint with valid catalog item sys_id; use valid JSON request which you share with them. I already mentioned the same in my earlier comment

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

For Ex: we have 2 instances A and B

 

If on instance A, catalog form is submitted then same request with details should be created on instance B.

 

On instance A --> Submitted catalog form. Now I have to send submitted request details to instance b.

Do I need to create a after insert BR to call this Rest Service via Rest message?

 

find_real_file.png

 

find_real_file.png

 

find_real_file.png

 

Now My question to you is how to pass Submitted request payload[json] via rest or BR mentioned above

Hi,

correct.

you need to create REST Message; don't set the endpoint directly

set it with script as you can pick the item sys_id in BR

also don't set the Body; set it via script

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Can you help me on this how to do that along with how to pass submitted request entire details via payload [where to define json/payload in script and how?

 

Payload : {"sysparm_quantity":"1","variables":{"acrobat":"true","Additional_software_requirements":"testing","photoshop":"true","optional_label":"false"},"sysparm_item_guid":"015840df07232010944dfc018c1ed0ce","get_portal_messages":"true","sysparm_no_validation":"true","sysparm_requested_for":"6816f79cc0a8016401c5a33be04be441","delivery_address":"","engagement_channel":"sp","referrer":"popular_items"}