python-egnyte icon indicating copy to clipboard operation
python-egnyte copied to clipboard

HTTP Documentation of groups.create doesn't reflect the required "members" attribute

Open skamensky opened this issue 5 years ago • 0 comments

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

skamensky avatar Jul 23 '19 21:07 skamensky