Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can i set up a google sheet to receive data from an external webhook/PUSH API

i'm keen to understand if i can use a google sheet / script to receive incoming data from an external (3rd party / non google) webhook.

the webhook requirements:

  • a defined / expected method from POST (my preferred), PUT, PATCH
  • an endpoint to post to which, if this is possible, i assume would be something like https://docs.google.com/spreadsheets/d/[sheet_id]/[service_name] or even https://script.google.com/d/[project_id]/[service_name] where ScriptApp can perform handling of the data
  • method of authentication; the current options available from the sending system are "none" or "oauth"
  • incoming content; the body is a simple { "id": integer }

oauth inputs include authentication_url, azure_subscription_key, app_key, app_secret, resource_id.

hopefully this is enough information to determine if this is possible. if not then please comment with questions and i'll do my best to answer them. thanks in advance :)

like image 471
mitch-NZ Avatar asked Oct 14 '25 18:10

mitch-NZ


1 Answers

Short answer: Yes, for the most part.

Explanation -

  1. ...receive incoming data from an external (3rd party / non google) webhook.

Google Apps Script (GAS) provides a format called as Web Apps where, you write a script to handle incoming requests and "deploy" the Apps Script itself as a web app. In doing so, GAS provides you with it's own endpoint.

Adding this as a point of clarification where the endpoint/URL would not be that of a 3rd party, but that of GAS itself, which will need to be used in a 3rd party's application where they require you to provide an endpoint :)

  1. You only have GET & POST requests (as of now) that can be handled by Apps Script's Web App and not the others that you've stated.

  2. The non-dev, prod-ready link would look something like this - https://script.google.com/macros/s/Unique-Script-ID-Goes-Here/exec

  3. The available auth/permission settings are described here.

  4. The request parameters also describes the format of data that can be processed by the Web App.

Hope this helps but please feel free to ask for any clarifications too, as required.

like image 91
Sourabh Choraria Avatar answered Oct 17 '25 20:10

Sourabh Choraria