Last active
April 24, 2020 14:59
-
-
Save sboily/3f769682146f9c41ae2550579c30ac42 to your computer and use it in GitHub Desktop.
list presences in chatd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt install wazo-chatd-client-python3 | |
------------------------ | |
#!/usr/bin/python3 | |
from wazo_auth_client import Client as Auth | |
from wazo_chatd_client import Client as Chatd | |
import pprint | |
username = "" | |
password = "" | |
host = "localhost" | |
def get_token(): | |
auth = Auth(host, username=username, password=password, verify_certificate=False) | |
token_data = auth.token.new('wazo_user', expiration=3600) | |
return token_data['token'] | |
token = get_token() | |
c = Chatd(host, token=token, verify_certificate=False) | |
presences = c.user_presences.list() | |
pprint.pprint(presences) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment