Is it possible to limit the scope to only one spreadsheet?

2 views
Skip to first unread message

Michelschr

unread,
Oct 2, 2009, 10:06:40 AM10/2/09
to GData Python Client Library Contributors
Hello,

I am thinking about using the gdata client library to fetch
information stored in a google spreadsheet.

This would be like a more easy way to communicate information to my
gae application. (Instead or fulfiling forms, enter these informations
in a spreadsheet somewhere...)

Thus it would be nice if one of my user could give to my application
the authorisation to access one (and only one) spreadsheet!

I looked in the different docs that I founded but the scope for
authorization is always "http://spreadsheets.google.com/feeds/" which,
if I understand correctly give access to all the spreadsheets.

Frankly, if I am a google spreadsheet user, I will think twice before
giving such an authorization... And on the other hand the GAE Web app
need only access to one!

I can find different workarounds:
- ask the user to make this particular spreadsheet public, at least at
the right time (this could work for non-sensitive information)
- or probably ask the user to share this particular spreadsheet with a
user representing the application (let's say, me) than, I can see that
document and grant myself the authorization...

BUT... Maybe I am in the wrong direction because I missed
something...?

Thanks in advance to put me on the right track,

Michel

Eric Bidelman

unread,
Oct 2, 2009, 9:16:19 PM10/2/09
to gdata-python-client-...@googlegroups.com
Yes.  You can make the scope as broad or as narrow
as you want.  

Michel Schroeder

unread,
Oct 3, 2009, 2:12:24 AM10/3/09
to gdata-python-client-...@googlegroups.com
Thanks for your answer.

Where can I find documentation or an example of scope expession that
limit it to only one spreadsheet (and just reading)?

Eric Bidelman

unread,
Oct 3, 2009, 2:29:29 AM10/3/09
to gdata-python-client-...@googlegroups.com
It would literally be the entire feed you're trying to query.
You can't however restrict btw read/write ops.

Michelschr

unread,
Oct 3, 2009, 2:47:42 AM10/3/09
to GData Python Client Library Contributors
Thanks a lot,

So I should try to pass this kind of scope to GenerateAuthSubURL:

scope= "https://spreadsheets.google.com/ccc?
key=0AsGO5pAQ8TCJdHAzZGxEZEhCQTl2MjRKRjFpRmZMNXc&hl=fr"?

On Oct 3, 8:29 am, Eric Bidelman <api.e...@google.com> wrote:
> It would literally be the entire feed you're trying to query.You can't
> however restrict btw read/write ops.
>
> On Sat, Oct 3, 2009 at 4:12 PM, Michel Schroeder <michels...@gmail.com>wrote:
>
>
>
> > Thanks for your answer.
>
> > Where can I find documentation or an example of scope expession that
> > limit it to only one spreadsheet (and just reading)?
>
> > Le samedi 03 octobre 2009 à 11:16 +1000, Eric Bidelman a écrit :
> > > Yes.  You can make the scope as broad or as narrow
> > > as you want.
>
> > > On Sat, Oct 3, 2009 at 12:06 AM, Michelschr <michels...@gmail.com>

Eric Bidelman

unread,
Oct 3, 2009, 3:36:50 AM10/3/09
to gdata-python-client-...@googlegroups.com
Try something like:

So, the above would create token valid for the records feed of
spreadsheet with key==key and for the particular table with tableID.

create a token valid for all spreadsheets feeds

Michelschr

unread,
Oct 5, 2009, 11:45:24 AM10/5/09
to GData Python Client Library Contributors
Many thanks!

What works for me is:
scope = 'http://spreadsheets.google.com/feeds/list/' + key + '/' +
worksheetId + '/private/full'

with: worksheetId = "od6" # first sheet

I started from your suggestion and founded some more documentation
there:
http://code.google.com/intl/fr/apis/spreadsheets/data/3.0/reference.html#ListFeed


On Oct 3, 9:36 am, Eric Bidelman <api.e...@google.com> wrote:
> Try something like:scope=http://spreadsheets.google.com/feeds/{key}/records/{tableID}
>
> So, the above would create token valid for the records feed of
> spreadsheet with key==key and for the particular table with tableID.
>
> Whereas, a scope=http://spreadsheets.google.com/feeds/would
> create a token valid for all spreadsheets feeds
> (e.g.http://spreadsheets.google.com/feeds/*)

Michelschr

unread,
Oct 15, 2009, 12:21:24 PM10/15/09
to GData Python Client Library Contributors
Well well,

Now I try to have access to the worksheets feed for a spreadsheet,
with

scope = http://spreadsheets.google.com/feeds/worksheets/<spreadSheetKey>/private/full
- for obtaining the authorization.

Then I use:
feed = client.GetWorksheetsFeed(spreadSheetKey).

I do not receive a correct authorization token, obtaining the feed
doesn't work! (Everything is fine when I obtain the authorization by
another way...)

What I would like to have is an authorization for everything on only
one spreadsheet, not all the spreadsheets for an user.

For the moment, the only way I can see is asking the user to share
this spreadsheet with a particular user and to make a programmatic
login as this user...

Can someone give me a way to obtain the right (limited to 1
spreadsheet) authorization?

Thanks in advance,

Michel


On Oct 5, 5:45 pm, Michelschr <michels...@gmail.com> wrote:
> Many thanks!
>
> What works for me is:
> scope = 'http://spreadsheets.google.com/feeds/list/'+ key + '/' +
> worksheetId + '/private/full'
>
> with: worksheetId = "od6" # first sheet
>
> I started from your suggestion and founded some more documentation
> there:http://code.google.com/intl/fr/apis/spreadsheets/data/3.0/reference.h...
Reply all
Reply to author
Forward
0 new messages