Bonjour,
Suite à mon sujet précédent, je souhaite maintenant utiliser l’API de provd via wazo-provd-client
Script :
from wazo_provd_client import Client as Provd
provd = Provd('192.168.1.18', verify_certificate=False)
print(provd.status.get())
Cela génère une erreur HTTP 401 :
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\wazo_provd_client\command.py", line 22, in raise_from_response
RESTCommand.raise_from_response(response)
File "C:\Python38\lib\site-packages\wazo_lib_rest_client\command.py", line 25, in raise_from_response
response.raise_for_status()
File "C:\Python38\lib\site-packages\requests\models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://192.168.1.18:443/api/provd/0.2/status
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\xxx\params_stack.py", line 28, in <module>
print(provd.status.get())
File "C:\Python38\lib\site-packages\wazo_provd_client\commands\status.py", line 16, in get
self.raise_from_response(r)
File "C:\Python38\lib\site-packages\wazo_provd_client\command.py", line 24, in raise_from_response
raise ProvdError(e, response=response)
wazo_provd_client.exceptions.ProvdError: 401 Client Error: Unauthorized for url: https://192.168.1.18:443/api/provd/0.2/status
Et je ne comprends pas pourquoi.