遍历所有客户

请求地址: 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
            }
        ]
    }
}

响应体参数说明