Through REST API Explorer creating a service catalog request item getting error in Response Body

Kishore Thippal
Tera Expert

Using Rest API Explorer to create a catalog request item im facing an issue with when im passing the all mandatory variables values in request body but i was received a response body as a

POST https://coniferdev.service-now.com/api/sn_sc/servicecatalog/items/{sys_id}/add_to_cart
Response Body
{ "error": { "message": "Mandatory Variables are required", //even though passing the all mandatory variables values "detail": "" }, "status": "failure" }

 Request Body

{"caller":"06b978111bc3c090f1e6b9d51a4bcbeb","short_description":"Test","requested_for":"06b978111bc3c090f1e6b9d51a4bcbeb","additional_comments":"Test","sysparm_quantity":"1","configuration_item":"ACE-SOSDVL:FTP","business_service":"AnyConnect VPN"}

KishoreThippal_0-1670607264621.png

There is 2 variable sets called 1 is for additional comments and 1 for  caller/ requested for this are mandatory for other catalog items . please anyone give me a solution on this issue .

 

1 ACCEPTED SOLUTION

Mike_R
Kilo Patron
Kilo Patron

In your request body, try this format

 

{
"sysparm_quantity": "1",
"variables":
{
"caller":"06b978111bc3c090f1e6b9d51a4bcbeb",
"short_description":"Test",
"requested_for":"06b978111bc3c090f1e6b9d51a4bcbeb",
"additional_comments":"Test",
"configuration_item":"ACE-SOSDVL:FTP",
"business_service":"AnyConnect VPN"
}
}

 

 

 

View solution in original post

2 REPLIES 2

Mike_R
Kilo Patron
Kilo Patron

In your request body, try this format

 

{
"sysparm_quantity": "1",
"variables":
{
"caller":"06b978111bc3c090f1e6b9d51a4bcbeb",
"short_description":"Test",
"requested_for":"06b978111bc3c090f1e6b9d51a4bcbeb",
"additional_comments":"Test",
"configuration_item":"ACE-SOSDVL:FTP",
"business_service":"AnyConnect VPN"
}
}

 

 

 

Kishore Thippal
Tera Expert

The issue has been solved . Thank you