0

我在授权请求中设置了电子邮件的权限。

https://api.23andme.com/authorize/?redirect_uri=http://localhost:5000/receive_code/&response_type=code&client_id= ""&scope=电子邮件rs123&select_profile=true

使用此 url 我已授权该应用程序。在此之后,它将我重定向到 redirect_uri 并显示请求中的代码。这里 localhost url 显示内部 505 错误。

使用此代码,我发布了获取令牌的请求>以下是响应。

{

"access_token": "28515f8734566dc0377ee0496e7b2d7d",

"token_type": "bearer",

"expires_in": 86400,

"refresh_token": "77cbfa595ee11b8a8e9d03acb09ad9f2",

"scope": "email rs123"

}

现在我正在尝试请求> curl " https://api.23andme.com/3/account/ " -H "Authorization: Bearer 28515f8734566dc0377ee0496e7b2d7d"

响应错误不是这个如果我尝试与 demo_oauth_token 相同,它会给出带有详细信息的响应。

{“error_description”:“访问令牌范围不足:基本,名称,电子邮件”,“错误”:“不足范围”}

4

1 回答 1

1

您需要发送编码的 url。例如,您的请求 url 应如下所示:

https://api.23andme.com/authorize/?redirect_uri=http://localhost:8000/receive_code/&response_type=code&client_id=CLIENT_ID&scope=email%20rs123&select_profile=true
于 2018-06-05T10:48:40.870 回答