Is it possible to use the Google Apps Script REST API on Pipedream?

This topic was automatically generated from Slack. You can find the original thread here.

Colin : Hello, curious if there’s been any advancements on the google apps script integration?

Dylan Sather (Pipedream) : just to confirm, are you looking to automate Google Apps Script using their REST API? Apps Script API  |  Google Developers

Colin : yes, specifically executing functions

Colin : My understanding is that for proper authorization, the caller API needs the redirect URI, Client ID, and Client secret from within the same GCP project that the script resides

Dylan Sather (Pipedream) : ok great, thanks. Yes, I see that now in the execute documentation.

We don’t yet have a way for users to create their own applications (with your own client id / secret, etc.), which it sounds like you’d need specifically here. But we’re tracking that here.

Just to confirm, in your case would you be able to create your own GCP project / app?

Colin : In my case yes, I would be able to create my own GCP project and assign the Apps Script to that project. Once that’s accomplished and Apps Script API is enabled in the APIs & Services Dashboard, you are then able to complete the authorization from the caller API using those three pieces of credentials I mentioned earlier.

Dylan Sather (Pipedream) : Great thanks. We’re working on some early prototypes of the ability to “bring your own app”. I don’t have an exact ETA but once we ship that I’d expect we’d manage the OAuth authorization process / token refresh just like we do for Pipedream-provided apps. Then like today, you’d be able to link an authorization to a specific action / code step to issue the REST API call using your linked user’s credentials.

I’d recommend following that Github issue for updates, and we’ll comment on that as we’re getting closer.

Dylan Sather (Pipedream) : In the meantime, you might be able to operate a service like GitHub - Bearer/Pizzly: The simplest, fastest way to integrate your app with an OAuth API 😋 to manage that same OAuth process for the app, then make API calls to Pizzly to get fresh access tokens prior to making your REST API calls to Google Apps Script

Dylan Sather (Pipedream) : (I’ve experimented with Pizzly and you can run the service on Heroku’s free tier, if that helps)

Colin : Great to hear! I’ll keep an eye on that Github issue. That’s exactly it – I was assuming you’d just handle the OAuth like the other integrations.

Thanks for that suggestion. That might just do. I was going to create my own nodeJS service to do it but that looks promising

Colin : Definitely helps!

Colin : Thanks

Colin : Just got to thank you again. Created a new integration for Pizzly (what a great tool) dedicated to Apps Scripts and served it up on Heroku. All running smooth now

Colin : Looks like they have a nodejs client that’s available but I just chose to proxy it with axios instead.

Dylan Sather (Pipedream) : Nice! By the way, I added Pizzly as an integrated app on Pipedream, which means you can add your host / secret key to authorize requests to the Pizzly API (that is, you can fetch information on integrations / get fresh access tokens for a specific Pizzly auth ID from Pipedream).

See this workflow for an example action (get details for a specific integration like github): Pizzly Test Workflow - Pipedream

Colin : Wicked. Nice work! The problem I had with Apps Script was that you have to connect the script and the calling API under the same Google Cloud Project and use those credentials when configuring the OAuth on the API’s end.

Colin : And then just created a dedicated Pizzly integration for Apps Scripts so that calling any number of scripts should be a breeze.

Colin :