遍历所有客户
请求地址: GET /customers
接口说明
- 遍历所有客户。
请求参数
- Query
参数名 类型 必需 示例值 说明 offset integer 否 0 起始下标 limit integer 否 50 范围(≤1000,默认50)
请求示例
GET https://back-office-api.bitanswer.cn/bitanswer/api/customers?offset=0&limit=2
bitkey: xxx
响应示例
{
"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 /customers
接口说明
- 批量更新客户信息,覆盖全部信息,客户名称不存在时表示添加客户,客户的编号不可以重复。
- 返回更新成功的客户列表。
请求参数
- 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/customers
bitkey: xxx
Content-Type: application/json
[
{
"name": "will",
"contact": "110",
"referenceId": "2"
}
]
响应示例
{
"status": 0,
"data": {
"items": [
{
"name": "will",
"contact": "110",
"referenceId": "2"
}
]
}
}
批量更新客户
请求地址: PATCH /customers
接口说明
- 批量更新客户信息。
- 返回更新成功的客户列表。
请求参数
- 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 否 编号
注:请求体需以数组形式输入
请求示例
PATCH https://back-office-api.bitanswer.cn/bitanswer/api/customers
bitkey: xxx
Content-Type: application/json
[
{
"name": "will",
"contact": "110",
"referenceId": "2"
}
]
响应示例
{
"status": 0,
"data": {
"items": [
{
"name": "will",
"contact": "110",
"referenceId": "2"
}
]
}
}
批量删除客户
请求地址: DELETE /customers
接口说明
- 使用客户名称批量删除客户。
- 返回删除成功的客户列表。
请求参数
- Body
参数名 类型 必需 中文名 name string 是 客户名称
注:请求体需以数组形式输入
请求示例
DELETE https://back-office-api.bitanswer.cn/bitanswer/api/customers
bitkey: xxx
Content-Type: application/json
[
{
"name": "will"
}
]
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "will"
}
]
}
}
按条件检索客户
请求地址: POST /customers/data
接口说明
-
按条件检索客户。
-
Query
参数名 类型 必需 示例值 说明 offset integer 否 0 起始下标 limit integer 否 50 范围(≤1000,默认50) -
Body
参数名 类型 必需 中文名 querys array 否 查询条件 sorts array 否 排序条件
支持的参数见下表,检索类型query表示可用于查询,sort表示可用于排序,query|sort表示可用于查询和排序。
参数名 类型 检索类型 必需 中文名 name string query|sort 否 客户名称
请求示例
POST https://back-office-api.bitanswer.cn/bitanswer/api/customers/data?offset=0&limit=3
bitkey: xxx
Content-Type: application/json
{
"querys": [
{
"name": "name",
"op": "like",
"values": [
"%will%"
]
}
]
}
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "will",
"contact": "110",
"referenceId": "2",
"regDate": "2022-09-27"
}
]
}
}
获取一个客户的信息
请求地址: GET /customers/customer/{name}
接口说明
- 指定名称获取一个客户的信息。
请求参数
- Path
参数名 类型 必需 示例值 说明 name string 是 customer_name 客户名称
请求示例
GET https://back-office-api.bitanswer.cn/bitanswer/api/customers/customer/will
bitkey: xxx
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "will",
"contact": "110",
"referenceId": "2",
"regDate": "2022-09-27"
}
]
}
}
覆盖一个客户的信息
请求地址: POST /customers/customer/{name}
接口说明
- 指定名称覆盖一个客户的信息,编号不可重复。
请求参数
-
Path
参数名 类型 必需 示例值 说明 name string 是 customer_name 客户名称 -
Body
参数名 类型 必需 中文名 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/customers/customer/will
bitkey: xxx
Content-Type: application/json
{
"contact": "12345",
"referenceId": "7"
}
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "will",
"contact": "12345",
"referenceId": "7"
}
]
}
}
更新一个客户
请求地址: PATCH /customers/customer/{name}
接口说明
- 指定名称更新一个客户。
请求参数
-
Path
参数名 类型 必需 示例值 说明 name string 是 customer_name 客户名称 -
Body
参数名 类型 必需 中文名 description string 否 说明 regDate string 否 产生时间 officeNumber string 否 电话 mobileNumber string 否 手机 email string 否 邮件地址 address string 否 地址 city string 否 城市 country string 否 国家/地区 postcode string 否 邮政编码 contact string 否 联系人 referenceId string 否 编号
请求示例
PATCH https://back-office-api.bitanswer.cn/bitanswer/api/customers/customer/will
bitkey: xxx
Content-Type: application/json
{
"contact": "12345",
"referenceId": "7"
}
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "will",
"contact": "12345",
"referenceId": "7"
}
]
}
}
删除一个客户
请求地址: DELETE /customers/customer/{name}
接口说明
- 删除指定名称的一个客户。
- 返回删除成功的用户名。
请求参数
- Path
参数名 类型 必需 示例值 说明 name string 是 customer_name 客户名称
请求示例
DELETE https://back-office-api.bitanswer.cn/bitanswer/api/customers/customer/will
bitkey: xxx
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"name": "will"
}
]
}
}
查询客户关联的授权码
请求地址: GET /customers/{name}/sns
接口说明
- 遍历客户的授权码。
请求参数
-
Path
参数名 类型 必需 示例值 说明 name string 是 比特安索信息技术有限公司 客户名称 -
Query
参数名 类型 必需 示例值 说明 offset integer 否 0 起始下标 limit integer 否 50 范围(小于1000,默认50)
请求示例
GET https://back-office-api.bitanswer.cn/bitanswer/api/customers/比特安索信息技术有限公司/sns?offset=0&limit=2
bitkey: xxx
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"sn": "VTYLRMJC6MAACBT7",
"activeDate": "2023-08-29 17:19:55",
"status": 0,
"updateTime": "2023-10-31 15:26:54",
"regDate": "2023-08-29 17:19:41",
"volumeNumber": 0,
"expirationDays": 0,
"usageNumber": 65536,
"concurrentNumber": 1,
"usersNumber": 2,
"maxOfflineMinutes": 1000000000,
"transferVolume": 0,
"transferNumber": 0
}
]
}
}