We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

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

Hi @ayushchandra202 

 

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

 

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

 

it seems something wrong in syntax.

*************************************************************************************************************
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

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

View solution in original post

J Siva
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

Hi @ayushchandra202 

 

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

 

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

 

it seems something wrong in syntax.

*************************************************************************************************************
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

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

J Siva
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

No problem