REST API Issue for service-now catalog

adityamadhira
Kilo Contributor

Hi I am planning to use REST API for service   catalog in C# and facing below issue while testing. Please help me to fix this issue -

To test I navigated to "REST API Explorer"   in service now. While testing Add Item To Cart   (POST) call fails. Please refer attached screen short.

Error -

{
  "error": {
  "detail": "",
  "message": "Invalid Quantity value"
  },
  "status": "failure"
}

Please help me what the issue is?

21 REPLIES 21

tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Eric,


Could you generate the curl code from the REST api explorer and post it - along the lines of my post Sept 12?


There may be some clues there!


I looked at the variables and it looks like that service_offering is the only mandatory variable.



I just don't know how to add the service_offering variable to the variables.



I get a 400 Bad Request "Mandatory Variables are required".



Below is the Request body with my 2 elements:



{"sysparm_quantity":"1","variables":"{\"service_offering\":\"56aedfba0ff1b100f178317ce1050e2e\"}"}



I think the problem is the variables element, it must not be formatted correctly, that's the only thing I can think of.