REST Integration Error - PUT method not supported for API

nancyhz
Mega Contributor

I am trying to use REST's PUT method to update ServieNow incident table, but I got the response error -{"error":{"message":"Method not Supported","detail":"PUT method not supported for API"},"status":"failure"}.     Can any expert give me the direction?

10 REPLIES 10

srinivasthelu
Tera Guru

Hi Nancyhz,



Are you using any import set table in between? What is your end point?



REST API - ServiceNow Wiki



Thanks


Srini


I used Table API, not any import table.   End point is "http://96.127.54.21:16000/api/now/v1/table/incident


bryanbarnard
ServiceNow Employee
ServiceNow Employee

Hi Nancyhz,




If you are familiar with cURL you can try the following. You will need to update the Authorization header text '<base64_encoded_username_and_password>' to be the base64 encoded combination of the user name and password of the account you want to use to make the request and you should also update the <sys_id_value> to be the sys_id of the Incident record you want to update.




This is a sample cURL request that would make an update to an incident record using the ServiceNow REST Table API:



curl -X "PUT" "http://96.127.54.21:16000/api/now/table/incident/<sys_id_value>" \


  -H "Content-Type: application/json" \


  -H "Authorization: Basic <base64_encoded_username_and_password>" \


  -H "Accept: application/json" \


  -d "{\"short_description\":\"test short description update from REST API\"}"




Here is the same sample as HTTP:


PUT /api/now/table/incident/<sys_id_value> HTTP/1.1


Accept: application/json


Authorization: Basic <base64_encoded_username_and_password>


Content-Type: application/json


Host: 96.127.54.21:16000


Connection: close


Content-Length: 67



{"short_description":"test short description update from REST API"}




Hope that helps.


Bryan


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi,



You may find the below thread helpful.


https://community.servicenow.com/thread/174592