查询授权码客户

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