google-api-python-client
google-api-python-client copied to clipboard
[Admin API] Insert email with + sign into a google group fails
https://developers.google.com/resources/api-libraries/documentation/admin/directory_v1/python/latest/admin_directory_v1.members.html#insert
Environment details
- OS type and version:
Ubuntu 20.04.5 LTS - Python version:
3.8.13 - pip version:
22.0.4 google-api-python-clientversion:2.27.0
Steps to reproduce
- Try to insert any email with a
+sign into a group -> 404 Error - Exactly same code with an email without the
+sign works -> 200.
Code example
...
service = build('admin', 'directory_v1', credentials=creds)
new_member = {'email': '<any email with + e.g. [email protected]'>, 'role': 'MEMBER'}
service.members().insert(groupKey=<group_id>, body=new_member).execute()
Stack trace
<HttpError 404 when requesting https://admin.googleapis.com/admin/directory/v1/groups/<group_id>/members?alt=json returned "Resource Not Found: [email protected]". Details: "[{'message': 'Resource Not Found: [email protected]', 'domain': 'global', 'reason': 'notFound'}]">
The same email when inserted via UI works.
@kushagra-arta Could you please check whether you run into syntax error or not while executing it on your local machine, cause somehow I have this feeling that it might be related to the syntax error. It would be great if you could replace the two last lines with these and check the result:
new_member = {'email': '[[email protected]](mailto:[email protected])', 'role': 'MEMBER'} service.members().insert(groupKey='group123456', body=new_member).execute()