Problems retrieving access token for multiple scopes

127 views
Skip to first unread message

Rui Bandarra

unread,
Nov 27, 2015, 9:08:31 AM11/27/15
to 23andMe API
Hi,

I am having a problem retrieving access tokens for multiple scopes. Im trying scope=genome basic.

i'm posting thefollowing parameters (client id and secret ommited):
client_id=xxxxxx&client_secret=xxxxxxxx&grant_type
=authorization_code&code=7323449a36ec2fb4584cbeb7238def3d&redirect_uri=http://localhost/genotypes.html&scope=genomes basic

and i'm getting back this response:

{"access_token": "e43dc72819a34800ef9e979191ff67a7", "token_type": "bearer", "expires_in": 86400, "refresh_token": "6e53e97608448b7c067e6cd66dffead5", "scope": "genomes"}

Shouldnt I be getting scope: genomes basic ?

Now when I curl to retrieve user ID:

sudo curl https://api.23andme.com/1/user/ -H "Authorization: Bearer e43dc72819a34800ef9e979191ff67a7"

{"error_description": "Access token has insufficient scope: basic", "error": "insufficient_scope"}



What is going on?!

Andrew Schramm

unread,
Nov 30, 2015, 1:32:24 PM11/30/15
to Rui Bandarra, 23andMe API
In case you haven't already solved this. The problem is likely that you have a " " character in your URL between genomes and basic. That is likely the culprit. Have you tried replacing that with "%20"? 

--
You received this message because you are subscribed to the Google Groups "23andMe API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 23andme-api...@googlegroups.com.
To post to this group, send email to 23and...@googlegroups.com.
Visit this group at http://groups.google.com/group/23andme-api.
For more options, visit https://groups.google.com/d/optout.



--
Andrew Schramm
Senior Mobile Engineer

23 pairs of chromosomes. 1 unique you. Join 23andMe to see how it all adds up.

Rui Bandarra

unread,
Nov 30, 2015, 1:36:56 PM11/30/15
to 23andMe API
Hi Andrew,

Thank you for the suggestion. I had already solved it,it was just that I didn't have the exact same RS on the scope when asking for the code as when I was exchaning the code for the token.

Everything works fine now, I can retrieve the genotypes I want.

hujin...@gmail.com

unread,
Aug 12, 2016, 5:24:42 AM8/12/16
to 23andMe API, ruim...@gmail.com
Dear Rui,
I have read some of your posts in th group. I wanna if you have finished downloading the data from 23andme? Could you teach me how to get the data? I'm a freshman in this area and I need these data for my research,Thanks very much

在 2015年12月1日星期二 UTC+8上午2:32:24,Andrew Schramm写道:
Reply all
Reply to author
Forward
0 new messages