Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

REST API status code 400

ayushchandra202
Tera Contributor

Content: {
"short_description" : "",
"description": "",
"contact_type": "",
}

Error Message: Method failed: (/api/now/table/incident) with code: 400

Response:  {"error":{"message":"Exception while reading request","detail":"The payload is not valid JSON."},"status":"failure"}

2 ACCEPTED SOLUTIONS

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @ayushchandra202 

 

Could you please just try to pass the one parameter liek this

 

 {"short_description":"${short_desc}"}

 

it seems something wrong in syntax.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

J Siva
Kilo Patron
Kilo Patron

Hi @ayushchandra202 

Below is the valid JSON payload to create incident.

{
  "short_description": "xxx",
  "description": "xxx",
  "contact_type": "xx"
}

Make sure to remove the comma ',' after the last key:value pair. PFB

JSiva_0-1744617975525.png

Hope this helps.
Regards,
Siva

 

View solution in original post

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @ayushchandra202 

 

Could you please just try to pass the one parameter liek this

 

 {"short_description":"${short_desc}"}

 

it seems something wrong in syntax.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

J Siva
Kilo Patron
Kilo Patron

Hi @ayushchandra202 

Below is the valid JSON payload to create incident.

{
  "short_description": "xxx",
  "description": "xxx",
  "contact_type": "xx"
}

Make sure to remove the comma ',' after the last key:value pair. PFB

JSiva_0-1744617975525.png

Hope this helps.
Regards,
Siva

 

Thanks for the help. the comma after the last key:value pair was the error

J Siva
Kilo Patron
Kilo Patron

No problem