2014-11-02 117 views
0

我試圖訪問contacts.readonly範圍,同時在Google Developers Console的項目API中啓用了Contacts API。Google Contacts API - 只讀訪問

$ export client_id='**********************************************.apps.googleusercontent.com' 
$ export scope='https://www.googleapis.com/auth/contacts.readonly' 
$ curl -d "client_id=${client_id}&scope=${scope}" https://accounts.google.com/o/oauth2/device/code 
{ 
    "error" : "invalid_scope", 
    "error_description" : "Not authorized to request the scopes: [https://www.googleapis.com/auth/contacts.readonly]", 
    "error_uri" : "http://code.google.com/apis/accounts/docs/OAuth2.html" 
} 

當我改變的範圍讀寫,這個工程:

$ export scope='https://www.google.com/m8/feeds' 
$ curl -d "client_id=${client_id}&scope=${scope}" https://accounts.google.com/o/oauth2/device/code 
{ 
    "device_code" : "*********************************************", 
    "user_code" : "********", 
    "verification_url" : "https://www.google.com/device", 
    "expires_in" : 1800, 
    "interval" : 5 
} 

添加在控制檯Google+的API並沒有幫助的。

回答

4

OAuth2 for Devices流程目前僅支持一部分Google範圍。如果您想將contacts.readonly作用域添加到該列表中,請提交issue tracker的增強請求。

+0

謝謝你,會做到這一點。 – 2014-11-04 09:22:32

+0

https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3659 – 2014-11-04 09:27:24