查询授权码客户
请求地址: GET /sns/{sn}/customers
接口说明
- 遍历授权码的所有客户
请求参数
-
Path
参数名 类型 必需 示例值 说明 sn string 是 ABCDEFG123456 授权码 -
Query
参数名 类型 必需 示例值 说明 offset integer 否 0 起始下标 limit integer 否 50 范围(小于1000,默认50)
请求示例
GET https://back-office-api.bitanswer.cn/bitanswer/api /sns/ABCDEFG123456/customers?offset=0&limit=2
bitkey: xxxx
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "cus",
"description": "",
"regDate": "2022-09-27 02:54:20",
"officeNumber": "",
"mobileNumber": "",
"email": "",
"address": "",
"city": "",
"country": "",
"postcode": "",
"contact": "110",
"referenceId": "3"
}
]
}
}
更新授权码客户
请求地址: POST /sns/{sn}/customers
接口说明
- 更新授权码关联的客户,客户不存在时自动添加并与授权码关联,由于授权码只能关联一个客户,会将数组的最后一个客户关联到授权码。
请求参数
-
Path
参数名 类型 必需 示例值 说明 sn string 是 ABCDEFG123456 授权码 -
Body
参数名 类型 必需 中文名 name string 是 客户名称 description string 否 说明 regDate string 否 产生时间 officeNumber string 否 电话 mobileNumber string 否 手机 email string 否 邮件地址 address string 否 地址 city string 否 城市 country string 否 国家/地区 postcode string 否 邮政编码 contact string 否 联系人 referenceId string 否 编号
注:请求体需以数组形式输入
请求示例
POST https://back-office-api.bitanswer.cn/bitanswer/api /sns/ABCDEFG123456/customers
bitkey: xxx
Content-Type: application/json
[
{
"name": "cus",
"email": "abcd@edf.cn"
}
]
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "cus",
"email": "abcd@edf.cn"
}
]
}
}
绑定客户
请求地址: POST /sns/{sn}/customers/name/{name}
接口说明
- 给授权码绑定指定名称的客户。
请求参数
- Path
参数名 类型 必需 示例值 说明 sn string 是 ABCDEFG123456 授权码 name string 是 cusName 客户名称
请求示例
POST https://back-office-api.bitanswer.cn/bitanswer/api /sns/ABCDEFG123456/customers/name/cus
bitkey: xxx
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "cus"
}
]
}
}
解除绑定客户
请求地址: DELETE /sns/{sn}/customers/name/{name}
接口说明
- 解除授权码绑定的指定名称的客户。
请求参数
- Path
参数名 类型 必需 示例值 说明 sn string 是 ABCDEFG123456 授权码 name string 是 cusName 客户名称
请求示例
DELETE https://back-office-api.bitanswer.cn/bitanswer/api /sns/ABCDEFG123456/customers/name/cus
bitkey: xxx
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "cus"
}
]
}
}