Use "new" Forms REST API from GAS Forms Add-on?

168 views
Skip to first unread message

Cris Fuhrman

unread,
May 13, 2022, 6:29:07 PM5/13/22
to Google Apps Script Community
I'm the dev for a marketplace add-on that uses the GAS Forms API. Several features (like setting the correct answer for text quiz questions) have been requested in GAS, and I recently learned that they've been available in the (updated?) REST API.

It was brought to my attention that it's possible to make REST calls in a GAS add-on using UrlFetch (theoretically it makes sense). However, won't that mean that an already authenticated user (through the permissions mechanism of add-ons in Marketplace) will have to re-authenticate (to achieve the proper REST access via OAuth)? That part seems awkward to me, but maybe I'm not realizing there's already some OAuth token to use for the REST calls to Forms API?

I'm also learning now that an Addon could be done without GAS, so this seems like a better way to use Forms API via REST. But that is a big change to how I was maintaining it before. 

I'd appreciate feedback on any of these points. Cheers!

Martin Hawksey

unread,
May 14, 2022, 8:34:39 AM5/14/22
to Google Apps Script Community
Depends on your add-on but as there isn't a Forms Advanced service (and currently no plans to make one) you may need an additional scopes e.g. 


If you need to add these worth checking is you'll need to resubmit for OAuth verification.

If your existing scopes are broad enough you should be able to call the Forms REST API without putting users through the auth flow

In case you haven't seen there are some Forms REST API calls used in this sample 
Reply all
Reply to author
Forward
0 new messages