not able to update incident using REST API

maheshchaudhary
Kilo Expert

I have a RET API for an Service NOw instance. with that i am able to get/create records in incident table but I am not able to update incident using sysid.

any ideas ????

I have tried both put and patch method but none is working.. getting below errors :- 

{"error":{"message":"Method not Supported","detail":"PATCH method not supported for API"},"status":"failure"}

{"error":{"detail":"PUT method not supported for API","message":"Method not Supported"},"status":"failure"}

find_real_file.png

1 ACCEPTED SOLUTION

maheshchaudhary
Kilo Expert

Finally it worked. Thanks Everyone.

find_real_file.png

find_real_file.png

View solution in original post

7 REPLIES 7

Harsh Vardhan
Giga Patron

why dont you use put method here and pass the sysid in the end point url so that the record will get updated on respective record only 

Hello Harshvardhan, i have tried PUT too. it is not working.

it should work for both , now the question i have, how are you identifying which record should update ?

if i see the end point you simply passed the url , but which record it should update those values ? 

 

example

i have instance a and instance b

on instance a i have create one incident inc10020 now i want to update that incident

so in the endpoint url , you have to mention the incident  number or sys id so that the method will update on the respective inc10020 columns only.

 

https://developer.servicenow.com/app.do#!/document/content/app_store_doc_outbound_rest_helsinki_t_Co...

Hello,

The endpoint for Put method should look like below. You have to pass the sys_id in the URL.

PUT https://xxxxxx.service-now.com/api/now/table/{tableName}/{sys_id}

Regards,

Nithish