wardmundy
Nerd Uno
- Joined
- Oct 12, 2007
- Messages
- 19,206
- Reaction score
- 5,228
Hello, i did a very simple example with our python API. https://gist.github.com/sboily/fdcd1f1922a62b443677fb2cb097f200
It's not really a good code, but it's a script to show you how you can do it easily with XiVO.
I assume we need a Web Services Account with ACLs for this to work. I get as far as user being created but not extension or line. See below for permission errors. Could you document which ACLs are required in the web services account?? Do we just need the name and password of the Web Services Account imbedded in the add-user.py script?
Code:
# ./add-user.py Nerd Tres 703
Traceback (most recent call last):
File "./add-user.py", line 106, in <module>
associate_user(data)
File "./add-user.py", line 61, in associate_user
confd.users.relations(data['uuid']).add_line(data['id_line'])
File "/usr/lib/python2.7/dist-packages/xivo_confd_client/util.py", line 35, in wrapper
return func(self, resource_id)
File "/usr/lib/python2.7/dist-packages/xivo_confd_client/commands/users.py", line 45, in add_line
return self.user_line.associate(self.user_id, line_id)
File "/usr/lib/python2.7/dist-packages/xivo_confd_client/relations.py", line 28, in associate
response = self.session.post(url, body)
File "/usr/lib/python2.7/dist-packages/xivo_confd_client/session.py", line 70, in post
self.check_response(response, check_response)
File "/usr/lib/python2.7/dist-packages/xivo_confd_client/session.py", line 47, in check_response
response.raise_for_status()
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 825, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: UNAUTHORIZED
Last edited: