python-egnyte
python-egnyte copied to clipboard
HTTP Documentation of groups.create doesn't reflect the required "members" attribute
Running
group = client.groups.create('groupname')
raises an error. After debugging, the content of the request is:
'{"formErrors":[],"inputErrors":{"members":[{"code":"MEMBERS_FIELD_IS_REQUIRED","msg":"Members field is required."}]}}'
Even though the HTTP documentation shows that members is optional. This makes using the groups.create impossible without modifying the source code.
The code below is a workaround.
client._session.post(
'{prfx}pubapi/v2/groups'.format(prfx=client._url_prefix),
json = {'displayName' : 'test3','members' : [{"value": 1}]}
)