mirror of
https://github.com/chatopera/cosin.git
synced 2025-07-28 12:32:15 +08:00
Destroyed RestAPI 文档 (markdown)
parent
1381dd4573
commit
debfdea47f
@ -1,54 +0,0 @@
|
||||
# 春松客服RestAPI
|
||||
|
||||
春松客服目前具备30余个API接口,包括联系人管理,授权,获得访客会话列表等。使用春松客服API需要安装Postman并导入春松客服API Collection文件。
|
||||
|
||||
|
||||
## 安装Postman
|
||||
Postman支持各种操作系统,下载安装包:
|
||||
https://www.postman.com/
|
||||
|
||||
|
||||
## 导入春松客服API文件
|
||||
|
||||
下载[Chatopera_cc_v1.postman_collection.20200312.zip](https://github.com/chatopera/cosin/files/4323043/Chatopera_cc_v1.postman_collection.20200312.zip)
|
||||
|
||||
将zip文件解压,得到 Chatopera_cc_v1.postman_collection.json
|
||||
|
||||
打开Postman,执行导入
|
||||
|
||||

|
||||
|
||||
## API认证
|
||||
|
||||
导入collection文件后,从左侧找到 **Chatopera_cc_v1**
|
||||
|
||||

|
||||
|
||||
认证接口:
|
||||
|
||||
```
|
||||
# 获得Token
|
||||
POST http://IP:PORT/tokens?username=USERNAME&password=PASSWORD
|
||||
```
|
||||
| key | 描述 |
|
||||
| --- | --- |
|
||||
| IP | 春松客服IP |
|
||||
| PORT | 春松客服端口 |
|
||||
| USERNAME | 用户名 |
|
||||
| PASSWORD | 密码 |
|
||||
|
||||
回复结果为一个字符串,即Auth token。
|
||||
|
||||
## 业务API请求
|
||||
在请求其它API时,在header中设置`authorization`为Auth token就可以,如下:
|
||||
|
||||

|
||||
|
||||
针对每个接口的描述,此处不赘述,直接用Postman测试。
|
||||
|
||||
## 其它注意事项
|
||||
|
||||
* 每个token有效期为24小时,认证失败会有相应提醒
|
||||
* 登录用户的权限有限制,API访问受此约束
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user