2016-02-05 46 views
0

我想通過Web API請求更新組設置。提供所有必要的授權範圍,並啓用組設置。我送一個PUT請求:Google Groups設置API 500錯誤

body = { 
    "whoCanPostMessage": "ALL_MEMBERS_CAN_POST", 
    "whoCanViewMembership": "ALL_MEMBERS_CAN_VIEW" 
} 
response = requests.put(
    "https://www.googleapis.com/groups/v1/groups/%s" % group_id, 
    data=json.dumps(body), 
    headers={ 
     'Content-type': 'application/json; charset=UTF-8', 
     'Authorization': 'Bearer %s' % access_token 
    } 
) 

但是,服務器的響應:

<Response [500]> Internal Server Error 

headers: 
Cache-Control: private, max-age=0 
Content-Encoding: gzip 
Content-Length: 122 
Content-Type: application/json; charset=UTF-8 
Date: Fri, 05 Feb 2016 18:36:53 GMT 
Expires: Fri, 05 Feb 2016 18:36:53 GMT 
Server: GSE 
Vary: Origin, X-Origin 

content: 
{ 
"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "backendError", 
    "message": "Backend Error" 
    } 
    ], 
    "code": 500, 
    "message": "Backend Error" 
} 
} 

,當我使用的羣組設置API參考Try It!發生同樣的錯誤。

回答

0

我發現UniqueGroupID字段應該設置爲一個組郵箱地址而不是一個組ID。它現在有效。