nickovs / unificontrol

A high-level Python interface to the Unifi controller software
Apache License 2.0
96 stars 41 forks source link

UnifiTransportError: 400 when calling create_vouchers #22

Open Knowaaaa opened 3 years ago

Knowaaaa commented 3 years ago

Build: atag_5.11.39_12706 Vers: 5.11.39

when calling client.create_voucher() filling in kwargs with desired settings, it returns a 400 error with the traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/barkern/.local/lib/python3.8/site-packages/unificontrol/metaprogram.py", line 125, in wrapper
    return instance(client, *a, **kw)
  File "/home/barkern/.local/lib/python3.8/site-packages/unificontrol/metaprogram.py", line 103, in __call__
    return client._execute(url, self._method, rest_dict, need_login=self._need_login)
  File "/home/barkern/.local/lib/python3.8/site-packages/unificontrol/unifi.py", line 115, in _execute
    raise UnifiTransportError("{}: {}".format(resp.status_code, resp.reason))
  unificontrol.exceptions.UnifiTransportError: 400: 

Any ideas? I am able to run other commands successfully such as client.list_sites() and client.stat_sysinfo(), but I am not sure if I am just not understanding the formatting of the function correctly or if it's been deprecated and doesn't work as intended any more.

Thanks!