How does Scripted REST API PATCH Work

arwinblones
Tera Contributor

Hi,

Im currently implementing an integration between my instances but im currently lost in the scripted rest api within PUT and PATCH resource.

the error response always is this in PATCH

REST Msg Outbound - RESTMessageClient : Error executing REST request: Invalid uri 'https://dev204xxx.service-now.com/api/18xxx7x/ebonding_inbound_api/update_incident/{sys_id}': escaped absolute path not valid: Invalid uri 'https://dev204xxx.service-now.com/api/18xxx7x/ebonding_inbound_api/update_incident/{sys_id}': escaped absolute path not valid: no thrown error

but my POST resource it succeeded on my end without an error

arwinblones_0-1765779391967.png

 

6 REPLIES 6

Corey19
Tera Expert

It's highly dependant on how you've configured the endpoint, for instance this is the endpoint for using PATCH with the table API. The error you have indicates the URL is definitely the issue, if you provided some screen captures of how it's configured or have a look at it in REST API Explorer you might see the correct format.

Corey19_0-1765780095569.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@arwinblones 

seems you are giving invalid endpoint with your PATCH method.

share your scripted REST API configuration screenshots

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

arwinblones
Tera Contributor

@Ankur Bawiskar @Corey19 

so my PATCH endpoint i already tried this

arwinblones_0-1765780888612.png


and this

arwinblones_1-1765780944743.png


but both display 400

i also tried in in the rest api explorer it still 401

arwinblones_2-1765781167186.png

arwinblones_3-1765781280811.png



and here is my scripted resource

arwinblones_4-1765781330527.png

arwinblones_5-1765781359810.png

 

 

@arwinblones 

instead of sending query parameters, did you try sending the incident details using JSON request body?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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