voximplant/apiclient/client.py in add_user at line 1743
if user_custom_data is not None:
params['user_custom_data']=user_custom_data
res = self._perform_request('AddUser', params)
if "error" in res: <---- TypeError a bytes-like object is required, not 'str'
raise VoximplantException(res["error"]["msg"], res["error"]["code"])
return res
def _perform_request(self, cmd, args):
params = args.copy()
params["cmd"] = cmd
headers={'Authorization': self.build_auth_header()}
result = requests.post("https://{}/platform_api".format(self.endpoint), data=params, headers=headers)
if result.headers.get("content-type","").split(";")[0].lower() == "application/json":
return json.loads(result.text)
else:
return result.content <------ not dict here on server error for example
voximplant/apiclient/client.py in add_user at line 1743