2013-07-21 146 views
1

測試網址:https://developers.google.com/apis-explorer/#p/storage/v1beta2/storage.objectAccessControls.insert使用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": "[email protected]", 
"kind": "storage#objectAccessControl" 
} 

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

Response 


400 Bad Request 

- Show headers - 

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

========== =========================== 誰可以告訴我我在哪裏犯錯誤?謝謝〜

回答

4

「實體」字段應該是「用戶 - 」,然後是用戶的電子郵件地址。

在你的情況,正確的領域是:

{ 
    "entity": "[email protected]", 
    "role": "READER" 
} 

這些都是你需要的所有領域。

+0

有些電子郵件似乎不能用作實體。這是否有一些要求像電子郵件必須由谷歌認證? –

+0

電子郵件必須與Google帳戶相關聯。 –

+0

真的很感謝您的幫助〜 –