How to use Patch request in outbound rest message?

vjbalotia
Giga Contributor

Hi All,

I want to update any record, for which i have the patch endpoint received by third party and the third party tool support only patch method to update any record.

but when I am trying to create my own custom method in such case we are receiving an error like method not support.

Please suggest how to create new patch method and is there any alternative for patch so that i can send update request.

I have tried with put method but in put method i am receive an error of record already present with same name.

Thanks

4 REPLIES 4

Natsufab3
Kilo Guru

Hi Vijay,


            can I ask you what went wrong with PUT method?! did you try developing a scripted rest api? so I was trying to learn Put method and tried a scripted rest api between two instances and (had a field on instance 2 populate the incident number from instance1) that basically queries the incident number on instance 2 and there is a business rule that runs on before and when a record is updated, the record in instance 2 also get updated.



Scripted Rest APIs - Part 1


Scripted REST APIs - Part 2


These two blogs have pretty much information to start with.


and go through Scripted REST API example - request and response this would be helpful in defining body for Put method.



Thank you


Please mark correct/helpful if applicable.


Hi Saketh,


when you are working on third party tool, then its depend on the that tool what method they are supported.



In my case from create request the tool is using the PUT method, they have provided restriction for update through PUT method   for updating any request they are using PATCH.


Vijay,


            so when a ticket is raised in 3rd party tool it has to be created in service now and when it is updated, it should get updated in service now. right?! did you try import set API then?! because you can have your transform maps built and you can use only one method to create or update tickets. I wonder if it works in your case as you mentioned PUT method is used to create the incident. You can give it a try and see if it works. If it works you can use PUT for both insert and update.


Hope this is helpfull.


http://wiki.servicenow.com/index.php?title=Import_Set_API#gsc.tab=



Thank you


Links are no more available.