Skip to content Skip to sidebar Skip to footer

Getting 'missing Required Field: Member' When Trying To Add A Member To A Google Group Via Api

Trying to use Google admin directory API in order to read members of a google group (organization) - it works fine. When I try to add a member I get: { errors: [ { domain: 'glo

Solution 1:

Since google APIs use (only?) JSON encoding, your post data is not being parsed into the needed member object. You are already loading json for the response, so you should just need to change the encoding, and optionally indicate it explicitly:

if payload:
        (resp, content) = http.request(uri=url, method=method, body=urlencode(payload))
 # becomes:   if payload:
        (resp, content) = http.request(uri=url, method=method, body=json.dumps(payload), headers={'Content-type':'application/json'})

Solution 2:

If you are trying to add a user to a group the first time, the role must be MEMBER. If it is anything other than that it gives you this error - Missing required field: member.

So first add the user as MEMBER and then specify any other role.

Post a Comment for "Getting 'missing Required Field: Member' When Trying To Add A Member To A Google Group Via Api"