voximplant / apiclient-python Goto Github PK
View Code? Open in Web Editor NEWVoximplant Management API Python client library
License: Apache License 2.0
Voximplant Management API Python client library
License: Apache License 2.0
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
Installing library via pip from pypi simplifies usage.
It seems like a good idea to add flake8 + plugins from this list to make code more consistent: https://github.com/Melevir/flake_master_presets/blob/master/presets/rose.cfg
I would also refactor code to meet new requirements.
I would like to use pytest for this and maybe refactor some code to simplify testing and code structure.
https://www.python-httpx.org/ - also async supported and http2.
In the documentation, the link to CreateKey http api is broken (points to temp sever). Also, in the documentation, I can't find any reference to it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.