Script REST API - Accepting HEAD Requests

Aidan
Tera Guru

In my attempts to integrate with a third party application, I need to set up a scripted REST API to handle a webhook.  I've got no problems implementing the scripted REST API's, my issue is when registering the webhook URL with the third party service they send a HEAD method request before allowing the webhook to be created.  Scripted REST API's in ServiceNow only allow GET, POST, PUSH, PATCH and DELETE. 

I've tried adding a new choice to the HTTP method but this still returns a 405 error (Method not allowed).

Interestingly, the response body is also empty.  If I test the Scripted REST API with a GET method (which is not implemented) I get a body with the not implemented error in it.  So ServiceNow appears to be completely ignoring HEAD requests.

1 ACCEPTED SOLUTION
5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

ServiceNow only accepts those 5 methods for http method and not others.

Regards
Ankur

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

Thanks Ankur, but that would seem a bit limiting in its functionality.

Are there any workarounds for this.  One I can think of is to have another API in the middle (hosted outside of ServiceNow) which handles the HEAD request and passes other requests onto ServiceNow.  Again, seems like a lot of work for something that really could be done within ServiceNow.

@Aidan 

I don't think any workaround exist for this.

If ServiceNow itself is not supporting it then nothing can be done.

You can try raising HI ticket with ServiceNow to confirm this once.

Let me know if I have answered your question.

If so, please mark my response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

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

Aidan
Tera Guru