Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

LitoS's avatar
LitoS
Explorer | Level 3
5 years ago

Using Google App Script Web App as Webhook URI Failed to Verify

My webhook URI failed to verify. Here is the whole error message:

 

Error: Unacceptable status code 302 from server.

Request:
GET https://script.google.com/macros/s/AKfycbxzBVC_VK66FJycw5Xj8WXzLwvblzVfjuLDn2omWTCh9A-ho2DjRw0iiNxhMi7rHmmjmg/exec?challenge=wWcCJQ9ucOJSKkIoTgPrDfSlaV0lj8mfpvmnboSEjkE 

Response:
HTTP/1.1 302 Found
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Content-Security-Policy: frame-ancestors 'self'
X-Content-Type-Options: nosniff
Content-Encoding: gzip
Transfer-Encoding: chunked
X-Http-Reason: Moved Temporarily
Server: GSE
X-Xss-Protection: 1; mode=block
Location: https://script.googleusercontent.com/macros/echo?user_content_key=rcDrZb2AhQkSO3xDADCP_OB3JPf9HTfUVTRqXniN9WIHo0CiW9u3or0pEAIeaLajs9fZ5eJ-G9Y2spa9Jc5N_uY7Z8PaNmTUOJmA1Yb3SEsKFZqtv3DaNYcMrmhZHmUMWojr9NvTBuBLhyHCd5hHazeV1IPNd4LqqkcI5IfhlrtlGssEWQWAK-1qY8QWOwk_VL8mXe9Jq0DM2cqnH2Dsl99pdKBw73fV8_nYwCxpSiGlrS8IuWKI0pXcmC-3_qHGl6xrbMsOj9IQsQx8yAYqxLX_ipCnnTUIyh7C3hycc7t7Zz8YAFfuN5QfuW_WBnEd&lib=MqYeaU5EGpgQmnADxgYeVYA3KyBJTF8GM 
Pragma: no-cache
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Date: Thu, 11 Nov 2021 15:44:45 GMT
Access-Control-Allow-Origin: *
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Content-Type: text/html; charset=UTF-8
X-Frame-Options: SAMEORIGIN

Response Body (First 256 bytes):
'<HTML>\\n<HEAD>\\n<TITLE>Moved Temporarily</TITLE>\\n</HEAD>\\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\\n<H1>Moved Temporarily</H1>\\nThe document has moved <A HREF="https://script.googleusercontent.com/macros/echo?user_content_key=rcDrZb2AhQkSO3xDADCP_OB3JPf9HTfUVTRq '

 

My google app script web app contains the following code:

 

function doGet(e) {
  const challenge = e.parameter.challenge;
  if (challenge) {
    return ContentService.createTextOutput(challenge);
  } 
  console.log(e.parameter);
}

function doPost(e) {
  console.log(e.postData.contents);
  console.log(e.parameters);

  // check which file was changed
}
 
The documentation for google's ContentService says like this:
 
"For security reasons, content returned by the Content service isn't served from script.google.com, but instead redirected to a one-time URL at script.googleusercontent.com. This means that if you use the Content service to return data to another application, you must ensure that the HTTP client is configured to follow redirects. For example, in the cURL command line utility, add the flag -L. Check the documentation for your HTTP client for more information on how to enable this behavior."
 
It seems that dropbox verification process does not "follow redirects", which resulted the error. Is there a workaround for this?

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    That's correct, the Dropbox webhooks functionality does not follow redirects, but I'll pass this along as a feature request. There does not currently appear to be plans to implement support for that though.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!