Has anyone used the REST "DELETE' method for outbound REST Messaging?

rickymanuel
Tera Contributor

The field 'Content' was not visible on the form but I updated the UI Policy to show the content so i can use the JSON body.  However, when I tried to test my DELETE method and hardcoding the values on my JSON body I get an error:  

 {"errors":{"":["A non-empty request body is required."]},"title":"One or more validation errors occurred.","status":400,"traceId":"|f7ba0e33b142d84a91d2e7f57a7cafb5.40b1f8fb_"}.   

 

If I run my DELETE in Postman it works.

16 REPLIES 16

Prateek kumar
Mega Sage

Check this out:

https://community.servicenow.com/community?id=community_article&sys_id=66c5d6c61b03b748ada243f6fe4bc...


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Thank you for this link.  The example they provided uses the DELETE method to delete a record from a ServiceNow instance.  However, my 3rd party requires I pass a JSON body like below:

 

endpoint:  https://userapi-company_name.net/api/support/user/adjuster/{userId}

{
  "userId": 0,
  "bugTicket": "string",
  "updateByUserName": "string"
}

 

But when you try to create a DELETE method, the content is hidden on the form.  I changed the UI Policy to always display the content.  When I input the content and values and test.  I get that error mentioned above.

Hi Ricky,

So you are trying to consume 3rd party application using DELETE method and it works from Postman but not working from outbound Rest message in ServiceNow?

Can you share the script where you are setting the userId variable and sending the json body as the one you required to send?

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I am using the DELETE method.  See screenshot below

find_real_file.png

 

Here is my content in which I am hard-coding my values

{
  "adjusterId": 318016,
  "bugTicket": "INC0099999",
  "updateByUserName": "rmanuel@company.com"
}