无法从google oauth javascript中的gapi.client.drive.permissions.list获取所有权限详细信息

时间:2017-07-28 04:34:55

标签: google-drive-api google-oauth drive

我无法从google oauth的文件权限列表中获取所有详细信息。请看下面。我非常感谢你们帮助我。

我刚刚使用此链接中的javascript函数 https://developers.google.com/drive/v2/reference/permissions/list

DISCOVERY_DOCS = ["[link removed as i couldnt post more than 2 links] /rest"]

SCOPES = '[link removed as i couldnt post more than 2 links] auth/drive'

项目中启用的API:Google Drive API和Google Plus API

输出即将到来

{  
   "result":{  
      "kind":"drive#permissionList",
      "permissions":[  
         {  
            "kind":"drive#permission",
            "id":"0829568615629092170",
            "type":"user",
            "role":"owner"
         }
      ]
   },
   "body":"{\n \"kind\": \"drive#permissionList\",\n \"permissions\": [\n  {\n   \"kind\": \"drive#permission\",\n   \"id\": \"0829568615629092170\",\n   \"type\": \"user\",\n   \"role\": \"owner\"\n  }\n ]\n}\n",
   "headers":{  
      "date":"Fri, 28 Jul 2017 04:38:32 GMT",
      "content-encoding":"gzip",
      "server":"GSE",
      "content-type":"application/json; charset=UTF-8",
      "vary":"Origin, X-Origin",
      "cache-control":"private, max-age=0, must-revalidate, no-transform",
      "content-length":"129",
      "expires":"Fri, 28 Jul 2017 04:38:32 GMT"
   },
   "status":200,
   "statusText":null
}

输出我从链接https://developers.google.com/drive/v2/reference/permissions/list中的“试用此API”部分获取  是

{
 "kind": "drive#permissionList",
 "etag": "\"iqKjQ5Hr8W8KBrJOqxI/FbAMm4yBXAN8WtCcc\"",
 "selfLink": "[link removed as i couldnt post more than 2 links]",
 "items": [
  {
   "kind": "drive#permission",
   "etag": "\"iqKjQ5HW8KBrJOqxI/ddr7iwAeGUpIhy8mSRc\"",
   "id": "0829568615629092170",
   "selfLink": "[link removed as i couldnt post more than 2 links]",
   "name": "raj",
   "emailAddress": "randomemail@gmail.com",
   "domain": "gmail.com",
   "role": "owner",
   "type": "user",
   "photoLink": "[link removed as i couldnt post more than 2 links]",
   "deleted": false
  }
 ]
}

1 个答案:

答案 0 :(得分:0)

停止使用v2 API。切换到v3。然后将fields=*添加到您的请求中。