405
(http-status-code-405) is "method not allowed", where a incorrect method is used. In this case, ContentService
uses a specific pattern of redirection (post-redirect-getwiki), where the POST
request to script.google.com
is redirected(302
) to a one time url at script.googleusercontent.com
, to which a GET
request should be made.
302
specification did not intend the method to change from POST
to GET
, but this pattern is very common in the web. But, hellosign-api seems to make another POST
request to the one time redirected url at script.googleusercontent.com
. There isn't much you could do from apps script to change this behavior. It is possible to change to HtmlService
to avoid the redirection, but Hellosign specifically requires you to provide a specific text content as response: Hello API Event Received
. This isn't possible with HtmlService
.
You could make a feature request/bug fix request to Google to change redirect status to 303, where method change to GET
is explicitly specified. Or Make a request to Hellosign to follow 302
redirects with GET
request, as that is the most common way, things are done in the web.
References: