Getting the formKey from a call to the Google Docs API

1,726 views
Skip to first unread message

Justin Ball

unread,
Feb 2, 2011, 8:50:52 PM2/2/11
to google-docum...@googlegroups.com
I've been searching for a way to obtain the formKey for a spreadsheet with an associated form. It looks like there was a method called getFormUrl in an older scripts api:

I can't seem to find out how to use that method nor can I find an equivalent in Version 3 of the API. Does anyone know how to obtain the formKey programmatically?

On a side note I noticed that the formKey is related to the document id. Here's the embed url from one of my forms:

The related spreadsheet url looks like this:

If I take it apart this segment is common to both. For some reason the formKey on all my forms adds on 6MQ
dFpqY0pkN193NmVCWDBkYWk4RW04SGc

Perhaps there is a hack to figure out the formKey?

Thanks,
Justin

Vic Fryzel

unread,
Feb 2, 2011, 9:10:16 PM2/2/11
to google-docum...@googlegroups.com
Hey Justin,

This is something we're considering adding, and I suspect we should be able to do it pretty soon.  Please follow along here:


Thanks,
-Vic

Justin Ball

unread,
Feb 2, 2011, 11:23:59 PM2/2/11
to google-docum...@googlegroups.com
Thanks for the update. This would be really useful information. Right now I query the list of all docs then I make a second query to get just forms. I then correlate the two lists so I know which spreadsheets have forms. Having the formKey at the time I get the document list would be really helpful. I was hoping to show this tomorrow, but it sounds like that's not likely. Is there anything I can do to help?

Thanks,
Justin

Vic Fryzel

unread,
Mar 10, 2011, 3:42:46 PM3/10/11
to google-docum...@googlegroups.com, Justin Ball
Thanks for the offer, but nothing you can do to help at the moment.  Will try to get this into an upcoming release.

-Vic
Reply all
Reply to author
Forward
0 new messages