1

I am trying to create a subscribing webapp using Google Scripts App to receive and decode POST notifications from Gmail API whenever a new email is received. The new changes in the Google Cloud Platform (GCP) is making it very hard to work. All the documentation/videos I have found about this are obsolete.

I created a script with a doPost() function directly from Google Drive (not linked to Google Docs, Sheets or Forms) and deployed it as a webapp with a provided link. I had to link the script with a standard GCP project as the default GCP projects which are automatically created for any Google Scripts App are not accessible anymore. The next step was to go to PubSub API in GCP, created a topic. When I try to create a subscription to allow the webapp to receive the POST messages from Gmail API, and set its delivery type to PUSH, an Endpoint URL is required. When I use the webapp link, I get the error:

The supplied URL is not registered in the subscription's parent project. Please see documentation on domain ownership validation.

I went throug the domain ownership validation and tried all possible solutions I found online without success. Without the PUSH subscription, I am unable to receive the notification, decode its body, get the email id then retrieve and decode the email body. Any help is highly appreciated.

  • Did you tried this: https://github.com/Spencer-Easton/Apps-Script-Gmail-Push-Notifications-v2 – yuri Dec 12 '19 at 10:22
  • Unfortunately its not possible to validate domain ownership of GAS Web App URLs anymore. In the past you could validate them by selecting the "Register in Chrome Webstore" option from the publish menu, but that option has since been removed. – TheAddonDepot Dec 23 '19 at 13:36
  • Dimu Designs, Thank you for your response. That is unfortunate to hear. I would assume that Google would offer a replacement procedure before removing the Chrome Webstore registration one. Are you aware of any replacement procedure for be able to publish webapps using GAS? How is it currently done? Thanks. – Automation Fan Dec 24 '19 at 14:06
  • Yuri, thanks for your reply. The procedure in the link you shared requires registration at Chrome Webstore which in not possible now. – Automation Fan Dec 24 '19 at 14:08

0 Answers0