Python package for API of Chat2Desk
Project description
Introduction
Package c2d_api provide tools to interact with API of Chat2Desk. You can simply use this tools to:
- Send messages to clients
- Assign chats to different operators
- Assign tags to clients
- Get statistics
- And more actions
Full description of API you can find on the official site
Installation
To install package open your terminal and use command:
pip install c2d-api
Getting started
After package installation you need to do import:
from c2d_api.api import *
Then create API object using your Chat2Desk access token:
api = Chat2DeskApi(access_token='YOUR_ACCESS_TOKEN')
Now you can use this object to interact with ChatToDesk API.
Using methods
To create client you need to use code:
api.clients_post(phone='7XXXXXXXXXX', transport='YOUR_TRANSPORT', channel_id='YOUR_CHANNEL_ID', nickname='ExampleClient')
After client created you can send message to him:
message = 'This is example message!'
api.messages_post(client_id='CLIENT_ID', text=message)
You can get messages from chats. For example, if you need to get 500 messages from 'YOUR_TRANSPORT', you can use code:
api.messages_get(transport='YOUR_TRANSPORT', limit=500)
All methods copy the structure of API requests, so you can use the official documentation of Chat2Desk API to get them all.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file c2d_api-0.0.3.tar.gz.
File metadata
- Download URL: c2d_api-0.0.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84d34539f70beb9b0bdf1751e227d14d7a1c157689805a873d4f250416cf825f
|
|
| MD5 |
f0e0414b250fa5beaca5f645c2f110a8
|
|
| BLAKE2b-256 |
922048769bcec24da916e53c3b3b27302b7e2af0305af54bdc65be3c3744511c
|
File details
Details for the file c2d_api-0.0.3-py3-none-any.whl.
File metadata
- Download URL: c2d_api-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa2935d6ae0e8268537dba90bd2b3098bc3b20f23420db143f0586aaf5b603fc
|
|
| MD5 |
109d1e5569811db2093b278660cf6cf8
|
|
| BLAKE2b-256 |
53507b6f8005f056d43bd6c285f798240d5d5326fd373f7314fc43d31772252a
|