0

I want to update group settings via web API request. All necessary authorization scopes are provided and groups settings are enabled. I send a put request:

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
    }
)

but the server responds:

<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"
 }
}

The same error occurs when I use Try It! in the Groups Settings API Reference.

warownia1
  • 2,771
  • 1
  • 22
  • 30

2 Answers2

0

Do you have Google Groups for business enabled in your domain?

Jay Lee
  • 13,415
  • 3
  • 28
  • 59
0

I found that UniqueGroupID field should be set to a group email address not a group id. It works now.

warownia1
  • 2,771
  • 1
  • 22
  • 30