使用storage.objectAccessControls.insert进行谷歌云存储

时间:2013-07-21 08:01:20

标签: cloud storage google-cloud-storage

测试网址:https://developers.google.com/apis-explorer/#p/storage/v1beta2/storage.objectAccessControls.insert

我发送了这样的请求:


Content-Type:  application/json
Authorization:  Bearer <AUTH TOKEN HERE>
X-JavaScript-User-Agent:  Google APIs Explorer

{

 "entity": "user-email",
 "role": "READER",
 "email": "WAITER@GMAIL.COM",
 "kind": "storage#objectAccessControl"
}

============================================

Response


400 Bad Request

- Show headers -

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Value"
   }
  ],
  "code": 400,
  "message": "Invalid Value"
 }
}

===================================== 谁能告诉我哪里犯了错误?感谢〜

1 个答案:

答案 0 :(得分:4)

“entity”字段应为“user-”,然后是用户的电子邮件地址。

在您的情况下,正确的字段将是:

{
  "entity": "user-waiter@gmail.com",
  "role": "READER"
}

这些是您需要的所有字段。