Skip to content
This repository was archived by the owner on Dec 9, 2022. It is now read-only.

API Subscribe

燒餅 edited this page Aug 31, 2017 · 1 revision

订阅类

订阅类 API 使用前必须先对设备进行注册

注册设备: /subscribe/register

请求方式: POST

请求体字段:

Content-Type: application/x-www-form-urlencoded

名称说明
token设备唯一实例 ID

返回值:

基本 JSON 对象(message: stringcode: int

Code对应解释
0成功
-1内部错误
-3缺少参数

添加新的包裹: /subscribe/add

请求方式: POST

请求体字段:

Content-Type: application/x-www-form-urlencoded

名称说明
token设备唯一实例 ID
id包裹号码
com包裹运送公司代码 (可选)

返回值:

基本 JSON 对象(message: stringcode: int

Code对应解释
0成功
1包裹已被添加
-1无法新增包裹
-2设备未注册
-3缺少参数

移除包裹: /subscribe/remove

请求方式: POST

请求体字段:

Content-Type: application/x-www-form-urlencoded

名称说明
token设备唯一实例 ID
id包裹号码

返回值:

基本 JSON 对象(message: stringcode: int

Code对应解释
0成功
-1无法移除包裹
-2设备未注册
-3缺少参数

同步包裹列表(覆盖原有数据): /subscribe/sync

请求方式: POST

查询字段:

  • token: 设备唯一实例 ID

请求体字段:

Content-Type: application/json

单号+运送公司代码 (若不知公司代码则省略 +)字符串组成的 JSON 数组

返回值:

基本 JSON 对象(message: stringcode: int

Code对应解释
0成功
-1内部错误
-2设备未注册/无效数据
-3缺少参数/需要提交正确的 JSON

Clone this wiki locally