Package which lets to work with LiveChat API.
Project description
LiveChat Platform API SDK for Python3
This Software Development Kit written in Python3 helps developers build external backend apps that extend LiveChat features. The SDK makes it easy to use Agent Chat API, Customer Chat API and Configuration API.
API protocol docs
For protocol documentation of LiveChat APIs, please go to Livechat Platform Docs.
Technical docs
Agent Chat API:
Customer Chat API:
Management:
Reports:
Installation
pip
pip install lc-sdk-python
Usage
Agent RTM API usage example
Basic example on how to login as an agent and change routing status to not_accepting_chats
.
First, create your AgentRTM client and log in:
>>> from livechat.agent import AgentRTM
>>> my_agent = AgentRTM.get_client()
>>> my_agent.login(token='Bearer <your bearer token>')
INFO:root:
REQUEST:
{
"action": "login",
"payload": {
"token": "Bearer <your bearer token>
},
"request_id": "5571081909"
}
INFO:root:
RESPONSES:
{
"response": {
"request_id": "5571081909",
"action": "login",
"type": "response",
"payload": {
...
},
"success": true
},
"pushes": []
}
Now you can change the routing status of the agent:
>>> my_agent.set_routing_status(status='not_accepting_chats')
INFO:root:
REQUEST:
{
"action": "set_routing_status",
"payload": {
"status": "not_accepting_chats"
},
"request_id": "8214452850"
}
INFO:root:
RESPONSES:
{
"response": {
"request_id": "8214452850",
"action": "set_routing_status",
"type": "response",
"payload": {},
"success": true
...
}
}
Finally, log out:
>>> my_agent.logout()
INFO:root:
REQUEST:
{
"action": "logout",
"payload": {},
"request_id": "629300202"
}
INFO:root:
RESPONSES:
{
"response": {
"request_id": "629300202",
"action": "logout",
"type": "response",
"success": true
},
"pushes": []
}
Feedback
If you find any bugs or have trouble implementing the code on your own, please create an issue or contact us via e-mail: apiteam.qa@livechat.com.
About LiveChat
LiveChat is an online customer service software with live support, help desk software, and web analytics capabilities. It's used by more than 32,000 companies all over the world. For more info, check out LiveChat.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lc_sdk_python-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35ea3aa9010c713676c679124b588095e46585b2963488e3e09837eeabc9a6bb |
|
MD5 | 952202ea6930781f7c5a076ce7acae1b |
|
BLAKE2b-256 | 2e69b47620f5f87db3fa57b114129ff300ccf7d748ee8a4a81683264fc522ad1 |