How to submit a record producer via rest api explorer

Harshit Jamwal1
Mega Guru

I have a standard change template created via record producer. I want to create the standard change via REST API explorer. Can anybody help me with this. It is real urgent.

1 ACCEPTED SOLUTION

Hi Harshit,

Adding to Pradeep's point with example and how to send the data.

Note: ensure you give your instance name and sys_id of record producer

HTTP Method: POST

Endpoint: https://instanceName.service-now.com/api/sn_sc/servicecatalog/items/fae4d9be4fd98c10fc11fa218110c7bd/submit_producer

Request Body: key-value json pair

key -> name of variable

value -> value you want to set for that variable

{"select_option":"Option 1","description":"my description from API"}

Screenshots:

find_real_file.png

find_real_file.png

find_real_file.png

Regards
Ankur

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

View solution in original post

14 REPLIES 14

Hi Ankur,

We are getting a field value as a string, but the field is a reference field in record producer. 

How to modify string value to reference before submission of record producer through API?

Regards,

Hemanth

I see many people run into issue where they get the error about mandatory check.
To overcome that issue use the Raw section as you'll have to pass json object to variable as key. 

{'variables': {"internal_contact":"11","assignment_group":"22","short_description":"test","description":"test"}}



Follow the ServiceNow docs:
https://developer.servicenow.com/dev.do#!/reference/api/tokyo/rest/c_ServiceCatalogAPI#servicecat-PO...

Hi Harshit,

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate answer as correct & helpful to close the thread.

If not, please let us know if you need some more assistance.

Regards
Ankur

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

sachin_namjoshi
Kilo Patron
Kilo Patron

You  check out this code, that emulates the submission of a record producer:

https://community.servicenow.com/message/734832#734832

 

Regards,

Sachin

Anna Markose
Kilo Guru

Hi All,

From a custom API, I am calling the out of the box record producer API in turn. I am passing the authorization from the custom API request header to the record producer API. I could see the record is getting created successfully, but the created by is showing as 'Guest' instead of the logged In user in the custom API. 

Please help to fix this