REST API - getting error - Method failed: (/updateIncident) with code: 400

Shivani29
Mega Guru

Hi All,

I am new to Integrations. I have created an Outbound rest message with HTTP Method PUT but getting error code:

Method failed: (/updateIncident) with code: 400
and response: [ISS.0086.9249] Missing Parameter: document

I have checked the connectivity through Postman as well and it is working fine. 
Checked Postman connectivity at 3rd party end and that is also fine. I am able to receive the data from third party but not able to send the data. Below are the snapshots for Rest Message and Business rule:

Rest Message:

find_real_file.png

find_real_file.png

Business Rule:

find_real_file.png

Kindly let me know where and what I am doing wrong. In Dev environment it is working fine.

Rgds,
Shivani

1 ACCEPTED SOLUTION

can you show me the snapshot of http request form section? n compare it with your dev. are you missing some headers

View solution in original post

19 REPLIES 19

Hi Shivambi,

Thanks for your response. I got the logs as you said and checked with 3rd party, there are only 4 fields at their end which I am passing and all are mandatory. There is no other field.

Rgds,
Shivani

can you try something for me. what you got in the log of JSON.stringify(body). use it in this link

https://codebeautify.org/jsonviewer

 

and check if its a valid JSON. or paste the log here, we can have a look together

 

Regards,

Shivambi

Hi Shivambi,

I checked the json on the url you provided but seems fine to me. Below is the json, if you can also check.

{"number":"INC0783337","state":"In Progress","sys_id":"cad2fd84872201503d1e65b40cbb3547","sys_updated_on":"2022-03-30 13:35:03"}

Rgds,
Shivani

Hi,

Your error was like below:

Method failed: (/updateIncident) with code: 400
and response: [ISS.0086.9249] Missing Parameter: document

 

Can you please check API definition? what is this parameter  document, which is missing?

If you have swagger definition for the 3rd part API then please share it and also share complete configuration done in ServiceNow. 

Make sure you have added all required headers.

Enable logging for your method and check logs after executing test.

find_real_file.png

find_real_file.png

and check logs in Outbound HTTP Requests module:

find_real_file.png

 

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Sure Anil, lemme try it.

Rgds,
Shivani