livechat / lc-sdk-python

https://pypi.org/project/lc-sdk-python/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read incoming_chat_push

aswanitrustlns opened this issue · comments

I want to know how can I retrieve the payload data after calling this code
incoming_chat_push = agent_rtm.ws.messages[0]

@aswanitrustlns of course you can retrieve the payload data, please do
payload = incoming_chat_push['payload']

edit: this gives me:
{'chat': {'id': 'RQ149A6W3U', 'users': [{'id': 'email@livechatinc.com', 'name': 'KacperF', 'email': 'email@livechatinc.com', 'events_seen_up_to': '2023-02-15T10:38:54.397000Z', 'type': 'agent', 'present': True, 'avatar': 'https://cdn.livechat-static.com/api/file/lc/img/default/avatars/394ad6e3df2320941ab8e0ca147d5221.png', 'visibility': 'all'}], 'thread': {'id': 'RQ149A6W4U', 'active': True, 'user_ids': ['email@livechatinc.com'], 'properties': {'routing': {'continuous': True, 'group_status_at_start': 'online'}, 'source': {'client_id': 'bb9e5b2f1ab480e4a715977b7b1b4279'}}, 'access': {'group_ids': [0]}, 'created_at': '2023-02-15T10:38:54.397000Z', 'events': []}, 'properties': {'routing': {'continuous': True}, 'source': {'client_id': 'bb9e5b2f1ab480e4a715977b7b1b4279'}}, 'access': {'group_ids': [0]}, 'is_followed': True}, 'requester_id': 'email@livechatinc.com'}