开发者文档 开发者文档
帮助中心 (opens new window)
帮助中心 (opens new window)
  • API调用说明
  • CRM 产品 API
    • 客服管理 API
    • iFrame 对接
    • 单点登录
    • 商城中心
    • 公共模块 API
    智齿科技
    2022-05-19
    目录

    CRM 产品 API

    # CRM 产品 API

    # 接口声明

    在调用接口时必须在 https 请求的 header 中携带 "token" 参数。

    Token 是智齿客服接口开放平台全局唯一的接口调用凭据。 开发者在调用各业务接口时都需使用 Token,开发者需要进行妥善保存。 Token 的存储至少要保留 32 个字符空间。Token 的有效期目前为 24 个小时,需定时刷新,或根据接口返回的 Token 失效提示,进行重新获取。请求 Token 接口,无论 Token 是否存在,都会返回新的 Token,并重置 Token 的过期时间(目前 24 小时)。

    Token 使用方式说明:
    1、开发者需要统一获取和管理 Token,在调用智齿客服各个业务开放接口时都应该使用同一个的 Token,不应该每个业务都刷新获取新的 Token,否则容易导致 Token 失效,影响接口的正常调用;
    2、目前 Token 的有效期通过返回的 expire_in 来传达,目前是 86,400 秒之内的值。开发者需要根据这个有效时间提前去刷新新 Token。
    3、开发者需要根据接口返回的 Token 失效提示,进行重新获取 Token。

    # 接口调用

    # ● 获取访问 Token 编码

    接口说明:

    获取 API 开放接口 Token,此 Token 仅适用于智齿开放平台 5.0 版本全部 API 接口 。API 接口中的参数 appid 、 app_key 请联系智齿售后人员获取。

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/get_token
    
    1

    请求参数:

    参数 类型 必填 描述
    appid String 是 接口凭证Id,第三方用户接口调用唯一凭证id
    create_time String 是 时间戳(秒),例如:2019-09-25 15:49:33 的时间戳1569397773
    sign String 是 签名,md5(appid+create_time+app_key) sign签名,app_key为密钥

    请求示例:

    curl https://www.sobot.com/api/get_token?appid=1&create_time=1569397773&sign=258eec3118705112b2c53dc8043d4d34
    
    1

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    item Object 否 返回对象

    item对象:

    参数 类型 必填 描述
    token String 是 token编码
    expires_in String 是 凭证有效时间(单位:秒)

    时间戳转换参考工具:

    http://tool.chinaz.com/Tools/unixtime.aspx

    sign签名生成示例:

    例如,appid = "1"; create_time="1569397773"; app_key="2"

    sign = Md5("115693977732") 为 258eec3118705112b2c53dc8043d4d34。

    返回示例:

    {
        "item": {
            "token": "4ac37cb2e9c740dba4b75a34d5358802",
            "expires_in": "86400"
        },
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    # ● 查询时区

    接口说明:

    查询所有时区

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user/get_timezone
    
    1

    请求参数:

    参数 类型 必填 描述
    language String 是 语言标识 zh-中文 en-英文

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/user/get_timezone
    ?language=zh
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    items String 是 时区列表

    items集合:

    参数 类型 必填 描述
    id String 是 主键
    language String 是 语言
    timezone_value Integer 是 时区值
    timezoneid String 是 时区id

    返回示例:

    {
        "items": [
          {
            "id": "aa08a602e63d4d188f52b0809e6794b0",
            "language": "zh",
            "timezone_value": "GMT-11:00 美属萨摩亚",
            "timezoneid": "US/Samoa"
          }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    # ● 查询语言

    接口说明:

    查询所有语言

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user/get_language
    
    1

    请求参数:

    参数 类型 必填 描述
    language String 是 语言标识 zh-中文 en-英文

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/user/get_language
    ?language=zh
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    items String 是 语言列表

    items集合:

    参数 类型 必填 描述
    id String 是 主键
    language String 是 语言
    language_value Integer 是 语言值
    language_code String 是 语言标识

    返回示例:

    {
        "items": [
          {
            "id": "aa08a602e63d4d188f52b0809e6794b0",
            "language": "zh",
            "language_value": "简体中文",
            "language_code": "zh"
          }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    # ● 查询国家

    接口说明:

    查询所有国家

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user/get_country
    
    1

    请求参数:

    参数 类型 必填 描述
    language String 是 语言标识 zh-中文 en-英文

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/user/get_country
    ?language=zh
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    items String 是 国家列表

    items集合:

    参数 类型 必填 描述
    countryid String 是 国家id
    country_name String 是 国家名称

    返回示例:

    {
        "items": [
          {
            "countryid": "101",
            "country_name": "中国"
          }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    # ● 创建标签组信息

    接口说明:

    根据入参信息创建标签组。(仅支持业务标签)

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/label_group/save
    
    1

    请求参数:

    参数 类型 必填 描述
    name String 是 标签组名称
    color_value String 是 标签组颜色值
    is_multiple_choice Integer 是 是否允许多选(0不允许 1允许)
    label_list List 是 标签

    请求示例:

    curl https://www.sobot.com/api/scrm/5/label_group/save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"name":"test","color_value":"#345454","is_multiple_choice":1,"label_list":[{"name":"标签1"}]}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    item String 是 标签组id

    返回示例:

    {
        "item": "221542acc9cb4e259530719eb1de21c2",
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    # ● 编辑标签组信息

    接口说明:

    根据标签组 id 编辑标签组信息(仅支持业务标签)

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/label_group/update
    
    1

    请求参数:

    参数 类型 必填 描述
    id String 是 标签组ID
    name String 是 标签名称
    color_value String 否 标签组颜色值
    is_multiple_choice Integer 否 是否允许多选(0不允许 1允许)

    请求示例:

    curl https://www.sobot.com/api/scrm/5/label_group/update -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -d '{"id":"221542acc9cb4e259530719eb1de21c2","name":"test123","color_value":"#23432"}'
    
    1

    返回参数:

    参数 类型` 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 查询标签组列表

    接口说明:

    查询全部标签信息(仅支持业务标签)

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/label_group/list
    
    1

    请求参数:

    参数 类型 必填 描述
    page_no Integer 是 当前页数(默认从第一页)
    page_size Integer 是 每页条数(默认每页100条)

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/label_group/list
    ?page_no=1&page_size=100
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    items List 否 对象列表
    page_count Integer 是 总页数
    page_no Integer 是 当前页数
    page_size Integer 是 每页条数
    total_count Integer 是 总条数

    items集合:

    参数 类型 必填 描述
    id String 是 标签组id
    bizid String 是 业务id
    type Integer 是 标签组业务类型(0访客 1客户 2工单)
    name String 是 标签组名称
    color_value String 否 标签组颜色值
    is_multiple_choice Integer 否 是否允许多选(0不允许 1允许)
    status Integer 否 状态(-1删除 0无效 1有效)
    create_time String 否 创建时间
    update_time String 否 更新时间

    返回示例:

    {
        "items": [
            {
                "id": "aa08a602e63d4d188f52b0809e6794b0",
                "name": "test32",
                "status": 1,
                "type": 1,
                "bizid": null,
                "color_value": "#gt5433",
                "create_time": "2021-07-14 05:00:00",
                "is_multiple_choice": 0,
                "update_time": "2021-07-14 05:00:00"
            },
            {
                "id": "764ff9fd2e094c0cb1c7d2a69beb1593",
                "name": "test111",
                "status": 1,
                "type": 1,
                "bizid": null,
                "color_value": "#gt54323",
                "create_time": "2021-07-14 05:38:13",
                "is_multiple_choice": 0,
                "update_time": "2021-07-14 05:38:13"
            }
        ],
        "page_no": 1,
        "page_count": 2,
        "total_count": 4,
        "page_size": 3,
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    # ● 删除标签组信息

    接口说明:

    根据标签 id 删除标签组信息,同时删除标签组下的标签信息(仅支持业务标签)

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/label_group/remove
    
    1

    请求参数:

    参数 类型 必填 描述
    id String 是 标签组ID

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/label_group/remove/221542acc9cb4e259530719eb1de21c2
    
    1

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 创建标签信息

    接口说明:

    创建标签信息(仅支持业务标签)

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/label/save
    
    1

    请求参数:

    参数 类型 必填 描述
    name String 是 标签名称
    groupid String 是 标签组id
    param_name String 否 标签参数名

    请求示例:

    curl https://www.sobot.com/api/scrm/5/label/save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"name":"test","groupId":"46a2cd4c9321452eaadc1d0892ca58cd"}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 编辑标签信息

    接口说明:

    根据标签 id 编辑标签信息(仅支持业务标签)

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/label/update
    
    1

    请求参数:

    参数 类型 必填 描述
    id String 是 标签ID
    name String 是 标签名称
    param_name String 否 标签参数名

    请求示例:

    curl https://www.sobot.com/api/scrm/5/lable/update -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"id":"f72aa19d0ecd414eaa4863cc9964b3f0","name":"test"}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 查询标签列表

    接口说明:

    查询标签信息列表(仅支持业务标签)

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/label/list
    
    1

    请求参数:

    参数 类型 必填 描述
    groupid String 是 标签组ID
    page_no Integer 是 当前页数(默认从第一页)
    page_size Integer 是 每页条数(默认每页100条)

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/lable/list
    ?groupid=8b7b3cede2c34c81a61001431fcd4529&page_no=1&page_size=100
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    items List 否 对象列表
    page_count Integer 是 总页数
    page_no Integer 是 当前页数
    page_size Integer 是 每页条数
    total_count Integer 是 总条数

    items集合:

    参数 类型 必填 描述
    id String 是 标签组id
    groupid String 是 标签组id
    bizid String 是 业务id
    name String 是 标签名称
    create_time String 是 创建时间
    param_name String 否 标签参数名
    update_time String 是 更新时间
    status Integer 是 状态(-1删除 0无效 1有效)

    返回示例:

    {
        "items": [
            {
                "id": "8e842b52a028445cbeb593dc48f69fa9",
                "name": "汉语名给字",
                "status": 1,
                "bizid": null,
                "create_time": "2021-07-14 12:17:10",
                "param_name": null,
                "groupid": "164783fc76bc4b25b204dd22fa5a9927",
                "update_time": "2021-07-14 12:17:10"
            }
        ],
        "page_no": 1,
        "page_count": 1,
        "total_count": 1,
        "page_size": 3,
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    # ● 删除标签信息

    接口说明:

    根据标签 id 删除标签信息(仅支持业务标签)

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/label/remove
    
    1

    请求参数:

    参数 类型 必填 描述
    id String 是 标签ID

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/lable/remove/221542acc9cb4e259530719eb1de21c2
    
    1

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 批量查询客户标签

    接口说明:

    批量查询客户现有标签(仅支持业务标签)

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/label/userlabels
    
    1

    请求参数:

    参数 类型 必填 描述
    ids List 是 客户id集合

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/label/userlabels '["aead252a1e754e4f9eb1b6b7bf3ae7f7","aead252a1e754e4f9eb1b6b7bf3ae7f7"]'
    
    1

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    items List 是 对象列表

    items集合:

    参数 类型 必填 描述
    userid String 是 客户id
    label_set List 是 标签集合

    label_set集合:

    参数 类型 必填 描述
    id String 是 标签id
    name String 是 标签名称
    color_value String 是 颜色

    返回示例:

    {
        "items": [
            {
                "userid": "aead252a1e754e4f9eb1b6b7bf3ae7f7",
                "label_set": [
                    {
                        "id": "830a1b02574643c78b0177a066f32ab6",
                        "name": "少先队员",
                        "color_value": "#76A6F1"
                    },
                    {
                        "id": "62e10d5fa3534cfb97807d956db1a558",
                        "name": "自购房产",
                        "color_value": "#15C7C9"
                    }
                ]
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    # ● 修改客户标签

    接口说明:

    修改客户标签(仅支持业务标签)

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/label/update_userlabel/{id}
    
    1

    请求参数:

    参数 类型 必填 描述
    id String 是 客户id
    list List 是 标签集合

    list集合:

    参数 类型 必填 描述
    id String 是 标签id
    name String 是 标签名称

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/lable/update_userlabel/aead252a1e754e4f9eb1b6b7bf3ae7f7 '[{{"name": "刚回来","id":"ffb02e1d3bee47d291e72ad7d5a46ab5"},{"name":"朝阳区","id":"62847ed717114db6838cc94b60ac3d8e"}]'
    
    1

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 打业务标签

    接口说明:

    通过传入的客户id,打业务标签。

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/label/update_biz_label
    
    1

    请求参数:

    参数 类型 必填 描述
    userid String 否 客户id(userid、unionid、external_userid三个不可同时为空)
    unionid String 否 unionid
    external_userid String 否 外部联系人userid
    add_tag List 否 需要标记的标签ID集合(add_tag和remove_tag不可同时为空)
    remove_tag List 否 需要移除的标签ID集合

    请求示例:

    curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/scrm/5/lable/update_biz_label '{"userid": "9616577c98f045e2a02b314708a8251d","add_tag":["9616577c98f045e2a02b314708a8251d","9616577c98f045e2a02b314708a8251d"]}'
    
    1

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 新建客户

    接口说明:

    新建客户

    系统会根据传入的电话、邮箱等配置的客户唯一身份识别标识(CRM/设置/客户唯一性识别规则)进行识别,识别到客户后,则更新(crm_status、liable_serviceid和liable_service_name不会更新),未识别到则创建

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user/save
    
    1

    请求参数:

    参数 类型 必填 描述
    nick String 是 客户昵称(不能超过50字)
    uname String 否 真实姓名(不能超过50字)
    email String 否 邮箱
    tel String 否 电话
    qq String 否 QQ号
    wx String 否 微信号
    partnerid String 否 对接id
    sex Ingeter 否 性别(1男,2女)
    crm_status Ingeter 是 客户状态(1、首咨, 2、待分配 3、跟进中 4、公海)
    liable_serviceid String 否 负责人id(客户状态是跟进中时,该字段必填)
    liable_service_name String 否 负责人名称
    countryid String 否 国家id
    proviceid String 否 省id
    provice_name String 否 省名称
    cityid String 否 市id
    city_name String 否 市名称
    areaid String 否 区id
    area_name String 否 区名称
    remark String 否 备注
    enterpriseid String 否 企业ID(跟公司ID不同)
    enterprise_name String 否 企业名称
    is_vip String 否 客户等级(0:普通 1:vip)
    ex_field_str String 否 客户自定义-扩展字段
    wx_build_unionid String 否 客户的微信unionId--自建应用
    visitorids String 否 访客id
    wx_external_userids list 否 ExternaUserid
    wx_unionids list 否 微信UnionID
    wx_openids list 否 微信OpenID
    whatsappids list 否 WhatsAppID
    faceBookids list 否 FaceBookID
    instagramids list 否 InstagramID
    lineids list 否 LineId
    telegramids list 否 TelegramID
    discordids list 否 discordID
    timezoneid String 否 时区id
    language String 否 语言标识

    ex_field_str:

    参数 类型 必填 描述
    fieldid String 否 自定义字段id(字段类型为下拉选项时,fieldid和field_params可二选一传入)
    field_value String 是 自定义字段值(字段类型为下拉、复选或级联时,为字段选项value集合)
    field_params String 否 参数名称

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{
        "nick": "test20210906005",
        "uname": "stedfss",
        "email": "234468554@qq.com",
        "tel": "13214599999",
        "crm_status":2,
    "ex_field_str":"[{\"fieldid\":\"5445245507ab48b68769093bd413a5c8\",\"field_value\":\"130434199909099898\"},{\"fieldid\":\"e9b7010584114145a99d3566ace22e4b\",\"field_value\":\"2021\"},{\"fieldid\":\"de4b8e9271c64b4f95035442e2003681\",\"field_value\":\"628767337948969,628767337951618,628767337953718\"}]"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    data Object 是 客户id
    action String 是 操作标识 add-新增客户 update-编辑客户;

    返回示例:

    {
        "data": {
               "userid": "786e7ff2c3904c90bf1f19ea547d645c"
             },
        "ret_code": "000000",
        "ret_msg": "操作成功",
        "action": "add"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    # ● 编辑客户基本信息

    接口说明:

    编辑客户信息

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user/update/{id}
    
    1

    请求参数:

    参数 类型 必填 描述
    nick String 是 客户昵称(不能超过50字)
    uname String 否 真实姓名(不能超过50字)
    visitorids String 否 访客id
    partnerid String 否 对接id
    email String 否 邮箱
    tel String 否 电话
    qq String 否 QQ号
    wx String 否 微信号
    sex Ingeter 否 性别(1男,2女)
    liable_serviceid String 否 负责人id(客户状态是跟进中时,该字段必填)
    liable_service_name String 否 负责人名称
    countryid String 否 国家id
    proviceid String 否 省id
    provice_name String 否 省名称
    cityid String 否 市id
    city_name String 否 市名称
    areaid String 否 区id
    area_name String 否 区名称
    remark String 否 备注
    enterpriseid String 否 企业ID(跟公司ID不同)
    enterprise_name String 否 企业名称
    is_vip String 否 客户等级(0:普通 1:vip)
    vip_level String 否 VIP级别(固定字段,下拉列表用户可以自定义)
    upset_ex_field_str Int 否 是否采用upsert的方式更新用户的自定义字段? 0:否(全量覆盖更新,默认方式) 1:是(只更新的字段)
    ex_field_str String 否 客户自定义-扩展字段
    wx_build_unionid String 否 客户的微信unionId--自建应用
    wx_external_userids list 否 ExternaUserid
    wx_unionids list 否 微信UnionID
    wx_openids list 否 微信OpenID
    whatsappids list 否 WhatsAppID
    faceBookids list 否 FaceBookID
    instagramids list 否 InstagramID
    lineids list 否 LineId
    telegramids list 否 TelegramID
    discordids list 否 discordID
    timezoneid String 否 时区id
    language String 否 语言标识

    ex_field_str:

    参数 类型 必填 描述
    fieldid String 否 自定义字段id(字段类型为下拉选项时,fieldid和field_params可二选一传入)
    field_value String 是 自定义字段值(字段类型为下拉、复选或级联时,为字段选项value集合)
    field_params String 否 参数名称

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/update/6bbe358da6534bb190c22fe3e2278c48 -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{
    "id": "786e7ff2c3904c90bf1f19ea547d645c",
    "nick": "test20210906005",
        "uname": "stedfss",
        "email": "234468554@qq.com",
        "tel": "13214599999",
        "crm_status":2,
    "ex_field_str":"[{\"fieldid\":\"5445245507ab48b68769093bd413a5c8\",\"field_value\":\"130434199909099898\"},{\"fieldid\":\"e9b7010584114145a99d3566ace22e4b\",\"field_value\":\"2021\"},{\"fieldid\":\"de4b8e9271c64b4f95035442e2003681\",\"field_value\":\"628767337948969,628767337951618,628767337953718\"}]"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    返回参数:

    参数 类型 必填 名称
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 新建公司

    接口说明:

    新建公司

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/enterprise/save
    
    1

    请求参数:

    参数 类型 必填 描述
    enterprise_name String 是 公司名称
    proviceid String 否 省id
    provice_name String 否 省名称
    cityid String 否 市id
    city_name String 否 市名称
    areaid String 否 区id
    area_name String 否 区名称
    enterprise_domains List 否 公司域名,例:["zhichi.com"]
    extend_fields List 否 公司扩展字段

    extend_fields:

    参数 类型 必填 描述
    fieldid String 否 自定义字段id(字段类型为下拉选项时,fieldid和field_params可二选一传入)
    field_value String 是 自定义字段值(字段类型为下拉、复选或级联时,为字段选项value集合)
    field_params String 否 参数名称

    请求示例:

    curl https://www.sobot.com/api/scrm/5/enterprise/save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{
        "enterprise_name": "test20210906005",
        "enterprise_domains":["zhichi.com"],
        "extend_fields":[{"fieldid":"5445245507ab48b68769093bd413a5a8","field_value":"130434199909099998"},{"fieldid":"e9b7010584114145a99d3566ace22a4b","field_value":"2023"},{"fieldid":"de4b8e9271c64b4f95035442e2103681","field_value":"628767337948966,628767337951628"}]
    }'
    
    1
    2
    3
    4
    5
    6

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    item String 是 公司id

    返回示例:

    {
        "item": "101df35399344a71a32cef0cb0afe268",
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    # ● 分配客户

    接口说明:

    分配客户

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/public_user/assign
    
    1

    请求参数:

    参数 类型 必填 描述
    confirmids String 是 客户id(以","分隔;示例:"12345,54321")
    liable_list List 是 负责人列表
    assign_biz_type String 是 分配业务类型(1待分配状态客户-分配客户 2公海状态客户-分配客户 3公海状态客户-领取客户 4我的客户-分配客户 5跟进中-修改负责人信息)

    liable_list集合:

    参数 类型 必填 描述
    liable_serviceid String 是 负责人
    liable_service_name String 是 负责人名称
    Liable_departmentid String 否 负责人所属部门(数据权限)

    请求示例:

    curl https://www.sobot.com/api/scrm/5/label_group/draw  -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"assign_biz_type":"1","confirmids":"b9f009ea6440439c987a31b79fb8abe1","liable_list":[{"liable_departmentid":"60b7e31daf15417aa0f521aa7d822ddd|bab2c1b0a95248e4bf30ef1c2bf36946","liable_serviceid":"b9f009ea6440439c987a31b79fb8abe1","liable_service_name": "名字"}]}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 回收到公海

    接口说明:

    回收到公海

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/public_user/confirm
    
    1

    请求参数:

    参数 类型 必填 描述
    confirmids String 是 客户id(以","分隔;示例:"12345,54321")
    confirm_type Integer 是 确认客户类型(1 有效 2 无效)

    请求示例:

    curl https://www.sobot.com/api/scrm/5/label_group/draw  -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"confirmids":"b9f009ea6440439c987a31b79fb8abe1","confirm_type":1}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 查询客户列表

    接口说明:

    查询客户列表

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user/list_by_page
    
    1

    请求参数:

    参数 类型 必填 描述
    search_type String 否 查询类型(1:客户昵称 2:真实姓名 3:公司 4:电话 5:邮箱 6:对接id)
    search_value String 否 查询内容
    wx_build_unionId String 否 客户的微信unionId--自建应用
    stageid String 否 跟进阶段id
    create_start_time String 否 创建开始时间(秒)
    create_end_time String 否 创建结束时间(秒)
    user_label List 否 标签(可填写业务标签id或企微标签id)
    isblack String 否 是否黑名单(1是 0否)
    module_type String 否 模块分类(1.全部客户(默认) 2.首咨客户列表 3.待分配客户列表 4.跟进中的客户列表 5.公海客户列表 6.我负责的客户列表)
    external_userid String 否 企微的外部联系人id
    development_mode Integer 否 开发模式(1:纯三方,2:自建代开发(默认纯三方,如果没有安装自建代开发,即便传2也是返回三方数据))
    update_start_time String 否 更新开始时间(秒)
    update_end_time String 否 更新截止时间(秒)
    back_delete_or_not Integer 否 是否返回删除数据(0:否(默认) 1:是)
    liable_serviceid String 否 负责人id
    page_no Integer 是 当前页数(默认从第一页)
    page_size Integer 是 每页条数(默认每页15条)

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/list_by_page?page_size=5&page_no=1&isblack=0&search_type=tel&search_value=13234333434&stageid=fb642ab91666472bb81c3beb1889b2dc&create_start_time=1625138677&create_end_time=1625397877&user_label=9693c1896bbc45779ac7a28485b0a854,201ff94ccfe242629b557042867a13ad&module_type=3 -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
    
    1

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    page_no String 是 当前页数
    page_count String 是 总页数
    total_count String 是 总条数
    page_size String 是 每页条数
    items List 是 查询信息

    items集合:

    参数 类型 必填 描述
    id String 是 客户id
    nick String 是 客户昵称
    uname String 否 真实姓名
    visitorids String 否 访客id
    partnerid String 否 对接id
    email String 否 邮箱
    tel String 否 电话
    qq String 否 QQ号
    wx String 否 微信号
    sex Ingeter 否 性别(1:男 2:女)
    remark String 否 备注
    enterpriseid String 否 企业ID(跟公司ID不同)
    enterprise_name String 否 企业名称
    is_vip String 否 客户等级(0:普通 1:vip)
    vip_level String 否 VIP级别(固定字段,下拉列表用户可以自定义)
    user_status String 否 客户状态(0:正常 1:黑名单)
    proviceid String 否 省id
    provice_name String 否 省名称
    cityid String 否 市id
    city_name String 否 市名称
    areaid String 否 区id
    area_name String 否 区名称
    user_label String 否 企微标签id(以英文逗号隔开)
    biz_label String 否 业务标签id(以英文逗号隔开)
    extend_fields Object 否 扩展字段
    fixed_fields Object 否 客户自定义-固定字段,客户自定义选项值
    ex_field_str String 否 客户自定义-扩展字段
    source Integer 否 客户来源
    status Integer 否 数据状态 (8:正常 9:删除)
    wx_build_unionid String 否 客户的微信unionId--自建应用(只有企业微信绑定公众号或者小程序的才会有)
    create_type String 否 创建者类型(1客服、2套电机器人、3接待机器人、4语音机器人、5电销机器人、6触发器、7定时任务)
    external_userid String 否 企微的外部联系人id
    development_mode Integer 否 开发模式(1:纯三方,2:自建代开发(默认纯三方,如果没有安装自建代开发,即便传2也是返回三方数据))
    follow_user Object 否 添加的企微员工
    follow_user.userid String 否 企微员工的userid
    follow_user.remark String 否 该成员对此外部联系人的备注
    follow_user.createtime Long 否 该成员添加此外部联系人的时间(秒)
    follow_user.add_way Long 否 该成员添加此客户的来源,具体含义详见_来源定义 (opens new window)
    follow_user.status Integer 否 1:正常,有好友关系,-1:员工删除客户,-2:客户删除员工
    create_time Long 否 创建时间(秒)
    create_date Long 否 创建日期(秒)
    update_time Long 否 更新时间(秒)
    timezoneid String 否 时区id
    timezone_value String 否 时区值
    language String 否 语言标识
    language_value String 否 语言值

    返回示例:

    {
        "items": [
            {
                "id": "6738912701e74e02ae20f5a6c40c1d14", 
                "pid": "60b7e31daf15417aa0f521aa7d822ddd", 
                "nick": "阿卡林康", 
                "sex": 1, 
                "source": 9, 
                "status": 8, 
                "partnerid": "wmzcrEDAAAAn_GEUrwuprZYeJkv99PeA", 
                "is_vip": "0", 
                "user_status": 0, 
                "extend_fields": { }, 
                "fixed_fields": {
                    "userLabel": "团员,泰山,www"
                }, 
                "create_type": 1, 
                "create_time": 1629860308, 
                "create_date": 1629820800, 
                "create_serviceid": "52e5ed05ee984a4f8bb0b3f921ba2b05", 
                "update_time": 1632369757, 
                "update_user_id": "5f96c8393cea49078a2c676ec6aad697", 
                "update_user_name": "赵-众服", 
                "liable_serviceid": "52e5ed05ee984a4f8bb0b3f921ba2b05", 
                "liable_service_name": "安康", 
                "crm_status": 3, 
                "wx_build_unionid": "or-MA51K3ISeMe_4W6_6LPNaL3MU"
            }, 
            {
                "id": "dcf361d7889a43bca87fb9ca3a636e75", 
                "pid": "60b7e31daf15417aa0f521aa7d822ddd", 
                "nick": "tet221", 
                "uname": "stedfg", 
                "email": "2344sds5234@qq.com", 
                "tel": "13014502333", 
                "source": 18, 
                "status": 8, 
                "is_vip": "0", 
                "user_status": 0, 
                "extend_fields": { }, 
                "fixed_fields": { }, 
                "create_type": 1, 
                "create_time": 1632369647, 
                "create_date": 1632326400, 
                "create_serviceid": "f1b8dfc486bd42508edbc80e5c9fd8e9", 
                "create_service_name": "SCRM测试", 
                "update_time": 1632369647, 
                "update_user_id": "f1b8dfc486bd42508edbc80e5c9fd8e9", 
                "update_user_name": "SCRM测试", 
                "crm_status": 1, 
                "wx_build_unionid": "11112222333334", 
                "follow_user": [
                    {
                        "userid": "wor8AYBgAA4hQKumvkoF3vPcD-G9_GyA", 
                        "remark": "小智", 
                        "createtime": 1640315257, 
                        "add_way": 1
                    }
                ]
            }
        ], 
        "page_count": 76, 
        "total_count": 152, 
        "page_size": 2, 
        "ret_code": "000000", 
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    # ● 查询客户详情

    接口说明:

    查询客户详情信息

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user/detail
    
    1

    请求参数:

    参数 类型 必填 描述
    id String 是 客户id

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/detail -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '
    {"id":"f1b8dfc486bd42508edbc80e5c9fd8e9"}
    '
    
    1
    2
    3
    4

    返回参数:

    参数 类型 必填 描述
    id String 是 客户id
    nick String 是 客户昵称
    uname String 否 真实姓名
    visitorIds String 否 访客id
    partnerId String 否 对接id
    email String 否 邮箱
    tel String 否 电话
    qq String 否 QQ号
    wx String 否 微信号
    sex Ingeter 否 性别(1:男 2:女)
    countryId String 否 国家id
    countryName String 否 国家名称
    proviceId String 否 省id
    proviceName String 否 省名称
    cityId String 否 市id
    cityName String 否 市名称
    areaId String 否 区id
    areaName String 否 区名称
    remark String 否 备注
    enterpriseId String 否 企业ID(跟公司ID不同)
    enterpriseName String 否 企业名称
    isVip String 否 客户等级(0:普通 1:vip)
    vipLevel String 否 VIP级别(固定字段,下拉列表用户可以自定义),详情请见查询客户等级接口
    userStatus String 否 客户状态(0:正常 1:黑名单)
    user_label String 否 企微标签id(以英文逗号隔开)
    biz_label String 否 业务标签id(以英文逗号隔开)
    ex_field_str String 否 客户自定义-扩展字段
    source String 否 客户来源
    wx_build_unionid String 否 客户的微信unionId--自建应用(只有企业微信绑定公众号或者小程序的才会有)
    createType String 否 创建者类型(1客服、2套电机器人、3接待机器人、4语音机器人、5电销机器人、6触发器、7定时任务)
    createTime String 否 创建时间(秒)
    createDate String 否 创建日期(秒)
    updateTime String 否 更新时间(秒)
    wxExternalUserIds list 否 ExternaUserid
    wxUnionIds list 否 微信UnionID
    wxOpenIds list 否 微信OpenID
    whatsappIds list 否 WhatsAppID
    faceBookIds list 否 FaceBookID
    instagramIds list 否 InstagramID
    lineIds list 否 LineId
    telegramIds list 否 TelegramID
    discordIds list 否 discordID
    timezoneid String 否 时区id
    timezone_value String 否 时区值
    language String 否 语言标识
    language_value String 否 语言值
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "item": {
            "user_label": "bb25cd094d44426ca3113b90d66a124c",
            "create_type": "1",
            "source": "9",
            "nick": "尔耳",
            "wx_build_unionid": "or-MA53WmBhZexunZ0I2ZueGdk7g",
            "tel": "13168765122",
            "ex_field_str": "[{\"fieldid\":\"81632fdcc05d41ef92b024979e489c17\",\"field_value\":\"\",\"field_type\":\"3\"},{\"fieldid\":\"2445ede23ccc4e55940fc61236985b57\",\"field_value\":\"628242069686628\",\"field_text\":\"2\",\"field_type\":\"9\"},{\"fieldid\":\"984483b8c8d34eae9706e512ef641083\",\"field_value\":\"628241984465772\",\"field_text\":\"222\",\"field_type\":\"9\"},{\"fieldid\":\"6dbd01468c134cae95d2c30f963aeb24\",\"field_value\":\"\",\"field_type\":\"2\"},{\"fieldid\":\"14bcf8a12c81458f86998996a51d47fa\",\"field_value\":\"607592588177650\",\"field_text\":\"a-2\",\"field_type\":\"9\"},{\"fieldid\":\"e8426f86c0644078aac6549787eda1a8\",\"field_value\":\"\",\"field_type\":\"4\"},{\"fieldid\":\"bafe053fb51a40d6a2d2b3ab4ce9a80f\",\"field_value\":\"34534\",\"field_type\":\"5\"},{\"fieldid\":\"9c605f42908540529e653d3c0d6c5331\",\"field_value\":\"607592546349742\",\"field_text\":\"小米\",\"field_type\":\"8\"},{\"fieldid\":\"fbf6a75380b74098a097090c7a8f7284\",\"field_value\":\"607592524201284\",\"field_text\":\"电脑\",\"field_type\":\"7\"},{\"fieldid\":\"e4043f59025b454a95004e71ec7dd4b5\",\"field_value\":\"607592500181862\",\"field_text\":\"香蕉\",\"field_type\":\"6\",\"field_params\":\"xialaliebiao\",\"data_params\":\"balana\"}]",
            "id": "1023046dc7f94c3aa9568e5cc86cfbc7",
            "sex": "1",
            "update_time": "1636516394",
            "create_time": "1632806109"
        },
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    # ● 查询客户全部行为

    接口说明:

    查询客户全部行为

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user_dynamic/list_by_page
    
    1

    请求参数:

    参数 类型 必填 描述
    userid String 是 客户id
    biz_type String 否 业务类型(不传表示全部,groupService:员工跟进记录;groupUser:客户动态;groupOther:其他)
    page_no Integer 是 当前页数(默认从第一页)
    page_size Integer 是 每页条数(默认每页100条)

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user_dynamic/list_by_page?userid=13b79f884bc94011af91df4a46373d33&biz_type=1&page_no=1&page_size=10
     -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    page_no String 是 当前页数
    page_count String 是 总页数
    total_count String 是 总条数
    page_size String 是 每页条数
    items List 是 查询信息集合
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    id String 是 主键
    userid String 是 客户id
    biz_type String 否 业务类型
    biz_time Long 否 业务时间(业务发生的时间,毫秒)
    biz_content String 否 业务内容(json对象)
    create_ime Long 否 业务入库时间

    返回示例:

    {
        "items": [
            {
                "id": "a4b1fad08cc74951a4b76ec571d4384d",
                "userid": "13b79f884bc94011af91df4a46373d33",
                "biz_type": "user_create",
                "biz_time": 1621509568807,
                "biz_content": {
                    "userStage": null,
                    "liableServiceName": null,
                    "helperServiceName": null,
                    "bizIdType": null,
                    "bizId": null,
                    "bizOperatorType": 1,
                    "bizOperatorTypeName": "手动创建",
                    "bizOperatorId": null,
                    "bizOperatorName": null,
                    "datas": [
                        {
                            "type": 1,
                            "field": "nick",
                            "name": "昵称",
                            "value": "阿卡林康",
                            "oldValue": null
                        },
                        {
                            "type": 1,
                            "field": "sex",
                            "name": "性别",
                            "value": "男",
                            "oldValue": null
                        },
                        {
                            "type": 1,
                            "field": "source",
                            "name": "来源",
                            "value": "企业微信",
                            "oldValue": null
                        }
                    ]
                },
                "create_time": 0
            },
            {
                "id": "ccff8be345624c6d9ece9859a2ecb763",
                "userid": "13b79f884bc94011af91df4a46373d33",
                "biz_type": "user_stage_update",
                "biz_time": 1622018626,
                "biz_content": {
                    "stageType": "1",
                    "stageTypeName": "跟进过程",
                    "stageId": "7b1c71f10c9e40c994c733c48974ce35",
                    "stageName": "付款流程",
                    "oldStageName": "意向确定",
                    "remark": "",
                    "bizOperatorType": 1,
                    "bizOperatorId": "078aeb47c71e4c85ae29b4f68ce3320a",
                    "bizOperatorName": "王斌"
                },
                "create_time": 1622018626
            },
            {
                "id": "0e6a14ce3d10493fb8027920e0f5a27f",
                "userid": "13b79f884bc94011af91df4a46373d33",
                "biz_type": "user_stage_update",
                "biz_time": 1622018595,
                "biz_content": {
                    "stageType": "21",
                    "stageTypeName": "已成单",
                    "stageId": "cb31d0aff036411fb9bf598baf4dc2ea",
                    "stageName": null,
                    "oldStageName": "意向确定",
                    "remark": null,
                    "bizOperatorType": 1,
                    "bizOperatorId": "078aeb47c71e4c85ae29b4f68ce3320a",
                    "bizOperatorName": "王斌"
                },
                "create_time": 1622018595
            },
            {
                "id": "81a0796d17104c3e825d1e53bba640d0",
                "userid": "13b79f884bc94011af91df4a46373d33",
                "biz_type": "user_stage_update",
                "biz_time": 1622018591,
                "biz_content": {
                    "stageType": "1",
                    "stageTypeName": "跟进过程",
                    "stageId": "cb31d0aff036411fb9bf598baf4dc2ea",
                    "stageName": "意向确定",
                    "oldStageName": null,
                    "remark": "",
                    "bizOperatorType": 1,
                    "bizOperatorId": "078aeb47c71e4c85ae29b4f68ce3320a",
                    "bizOperatorName": "王斌"
                },
                "create_time": 1622018591
            }
        ],
        "page_no": 1,
        "page_count": 1,
        "total_count": 4,
        "page_size": 10,
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    # ● 添加跟进记录

    接口说明:

    添加跟进记录

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user_stage/record_save
    
    1

    请求参数:

    参数 类型 必填 描述
    userid String 是 客户id
    content String 是 内容

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user_stage/record_save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"userid": "678599e8f8a6407987c1aa4391d41f4d", "content": "交易达成"}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 查询跟进阶段

    接口说明:

    查询跟进阶段

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user_stage/query_list_by_type
    
    1

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user_stage/query_list_by_type  -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
    
    1

    返回参数:

    参数 类型 必填 描述
    items List 是 查询信息集合
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    id String 是 主键
    name String 否 阶段名称
    sortnum Integer 否 顺序编号

    返回示例:

    {
        "items": [
            {
                "id": "15d6506f836c4340b7b36fb94bdedf31",
                "name": "初步沟通",
                "sortnum": 0
            },
            {
                "id": "fb642ab91666472bb81c3beb1889b2dc",
                "name": "正常跟进",
                "sortnum": 1
            },
            {
                "id": "cb31d0aff036411fb9bf598baf4dc2ea",
                "name": "意向确定",
                "sortnum": 2
            },
            {
                "id": "7b1c71f10c9e40c994c733c48974ce35",
                "name": "付款流程",
                "sortnum": 3
            },
            {
                "id": "678599e8f8a6407987c1aa4391d41f4d",
                "name": "交易达成",
                "sortnum": 4
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    # ● 设置客户阶段

    接口说明:

    为客户设置阶段

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user_stage/stage_save
    
    1

    请求参数:

    参数 类型 必填 描述
    userid String 是 客户id
    stageid String 是 阶段id
    stage_name String 是 阶段名称
    stage_type Integer 是 跟进阶段类型(1:跟进过程 2:跟进结果(21成单、 22输单、23无效))

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user_stage/stage_save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"remark": "","stageid": "678599e8f8a6407987c1aa4391d
    41f4d", "stage_name": "交易达成","stage_type":1,"userid":"c68bd7ee97fc4845a65b281df27a0ef7"}'
    
    1
    2
    3

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 客户分配记录

    接口说明:

    通过传入的客服id,查询起始时间,获取指定客服id在指定时间区间内分配到的客户的记录。

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user/cus_distribute_records
    
    1

    请求参数:

    参数 类型 必填 描述
    liable_serviceid String 是 客服id(需要查询的客服的id,一次请求传入一个)
    start_time Long 是 查询开始时间(秒)
    end_time Long 是 查询结束时间(秒)

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/cus_distribute_records -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"liable_serviceid": "9616577c98f045e2a02b314708a8251d","start_time": 1653580800, "end_time": 1654185599}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    page_no String 是 当前页数
    page_count String 是 总页数
    total_count String 是 总条数
    page_size String 是 每页条数
    items List 否 客户分配记录列表
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    assign_time Long 是 分配时间(秒)
    userid String 是 客户id
    companyid String 是 公司id
    nick String 是 客户昵称

    返回示例:

    {
        "items": [
            {
                "companyid": "60b7e31daf15417aa0f521aa7d822ddd",
                "userid": "eb00cf3b5aa54d8781cd42e396b7172c",
                "nick": "让台湾",
                "assign_time": 1654141377
            }
        ],
        "page_no": 1,
        "page_count": 1,
        "total_count": 1,
        "page_size": 15,
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    # ● 客户分配统计

    接口说明:

    通过传入的客服id,查询起始时间,获取指定客服id在指定时间区间内,每天分配到的客户的数量。

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user/cus_distribute_statistics
    
    1

    请求参数:

    参数 类型 必填 描述
    liable_serviceid String 是 客服id(需要查询的客服的id,一次请求传入一个)
    start_date String 是 查询开始时间(yyyy-MM-dd的格式,例:2022-06-01 与查询结束时间的差值最大可为一个月)
    end_date String 是 查询结束时间(yyyy-MM-dd的格式,例:2022-06-01 与查询开始时间的差值最大可为一个月)

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/cus_distribute_statistics -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"liable_serviceid": "4d932aa0ae704968be6e37d20de31d4c","start_date": "2022-05-02", "end_date": "2022-06-02"}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    items List 否 客户分配统计列表
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    liable_serviceid String 是 客服id
    companyid String 是 公司id
    assign_num Integer 是 分配数量
    assign_date String 是 分配日期(yyyy-MM-dd的格式,例:2022-06-01)

    返回示例:

    {
        "items": [
            {
                "liable_serviceid": "4d932aa0ae704968be6e37d20de31d4c",
                "companyid": "60b7e31daf15417aa0f521aa7d822ddd",
                "assign_num": 1,
                "assign_date": "2022-05-09"
            },
            {
                "liable_serviceid": "4d932aa0ae704968be6e37d20de31d4c",
                "companyid": "60b7e31daf15417aa0f521aa7d822ddd",
                "assign_num": 1,
                "assign_date": "2022-06-01"
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    # ● 查询客户来源

    接口说明:

    查询客户来源

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user_dynamic/getsource
    
    1

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user_dynamic/getsource -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
    
    1

    返回参数:

    参数 类型 必填 描述
    items List 是 查询信息集合
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    value String 是 字典值
    label String 是 字典标签

    返回示例:

    {
        "items": [
            {
                "label": "邮件",
                "value": "11"
            },
            {
                "label": "百度营销",
                "value": "12"
            },
            {
                "label": "今日头条",
                "value": "13"
            },
            {
                "label": "奇虎360",
                "value": "14"
            },
            {
                "label": "桌面网站",
                "value": "0"
            },
            {
                "label": "微信公众号",
                "value": "1"
            },
            {
                "label": "APP",
                "value": "2"
            },
            {
                "label": "微博",
                "value": "3"
            },
            {
                "label": "移动网站",
                "value": "4"
            },
            {
                "label": "融云",
                "value": "5"
            },
            {
                "label": "呼叫中心",
                "value": "6"
            },
            {
                "label": "工单中心",
                "value": "7"
            },
            {
                "label": "客户中心",
                "value": "8"
            },
            {
                "label": "企业微信",
                "value": "9"
            },
            {
                "label": "微信小程序",
                "value": "10"
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    # ● 查询客服列表

    接口说明:

    查询客服列表

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user/user_list
    
    1

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/user_list -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"name":"test","color_value":"#345454","type":1}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    items List 是 查询信息集合
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    id String 是 部门id或坐席id
    name String 是 部门名称或坐席名称
    image String 是 坐席头像
    path String 是 部门id列表
    type Integer 是 数据类型(1:部门 2:客服)
    manager Integer 是 管理员标记(1:管理员 2:客服)
    sub_list List 是 子部门信息集合(数据内容和items集合一致)

    返回示例:

    {
        "items": [
                    {
                        "id": "fa9e42241b154353ab629ed4b897ee63",
                        "name": "运营部",
                        "image": null,
                        "path": "60b7e31daf15417aa0f521aa7d822ddd|bab2c1b0a95248e4bf30ef1c2bf36946|fa9e42241b154353ab629ed4b897ee63",
                        "type": 1,
                        "manager_flag": null,
                        "sub_list": [
                            {
                                "id": "edf5f6bbf1ee488093edc3eea29cdc63",
                                "name": "测试2",
                                "image": null,
                                "path": null,
                                "type": 2,
                                "manager_flag": null,
                                "sub_list": null
                            }
                        ]
                    }
                ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    # ● 查询省份

    接口说明:

    查询省份

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user_dynamic/provice
    
    1

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user_dynamic/provice -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"name":"test","color_value":"#345454","type":1}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    items List 是 查询信息集合
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    provinceid String 是 省id
    province_name String 是 省份名称

    返回示例:

    {
        "items": [
            {
                "provinceid": "110000",
                "province_name": "北京市"
            },
            {
                "provinceid": "120000",
                "province_name": "天津市"
            },
            {
                "provinceid": "130000",
                "province_name": "河北省"
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    # ● 查询城市

    接口说明:

    查询城市

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user_dynamic/city/{provinceid}
    
    1

    请求参数:

    参数 类型 必填 描述
    provinceid String 是 省份id

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user_dynamic/city/130000 -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"name":"test","color_value":"#345454","type":1}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    items List 是 查询信息集合
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    provinceid String 是 省份id
    cityid String 是 城市id
    city_name String 是 城市名称

    返回示例:

    {
        "items": [
            {
                "cityid": "130100",
                "city_name": "石家庄市",
                "provinceid": "130000"
            },
            {
                "cityid": "130200",
                "city_name": "唐山市",
                "provinceid": "130000"
            },
            {
                "cityid": "130300",
                "city_name": "秦皇岛市",
                "provinceid": "130000"
            },
            {
                "cityid": "130400",
                "city_name": "邯郸市",
                "provinceid": "130000"
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    # ● 查询区县

    接口说明:

    查询区县

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user_dynamic/area/{cityid}
    
    1

    请求参数:

    参数 类型 必填 描述
    cityid String 是 城市id

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user_dynamic/area/130300 -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"name":"test","color_value":"#345454","type":1}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    items List 是 查询信息集合
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    items集合:

    参数 类型 必填 描述
    cityid String 是 城市id
    areaid String 是 区县id
    area_name String 是 区县名称

    返回示例:

    {
        "items": [
            {
                "areaid": "130302",
                "area_name": "海港区",
                "cityid": "130300"
            },
            {
                "areaid": "130303",
                "area_name": "山海关区",
                "cityid": "130300"
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    # ● 查询客户自定义字段

    接口说明:

    查询客户自定义字段

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/custom_field/custom_fieid_info_list
    
    1

    请求示例:

    curl https://www.sobot.com/api/scrm/5/custom_field/custom_fieid_info_list -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
    
    1

    返回参数:

    参数 类型 必填 描述
    field_id String 是 自定义字段id
    field_name String 是 自定义字段名称
    field_variable String 是 自定义字段变量名
    field_type Integer 是 自定义字段类型(1:单行文本 2:多行文本 3:日期 4:时间 5:数值 6:下拉列表 7:复选框 8:单选框 9:级联字段)
    fill_flag Integer 是 自定义字段是否必填(0:否 1:是)
    field_status Integer 是 自定义字段状态
    field_remark String 是 自定义字段备注
    operate_type Integer 是 操作类型
    cus_field_data_info_list List 否 选择型字段选项信息集合

    cus_field_data_info_list集合:

    参数 类型 必填 描述
    data_id String 是 选项id
    data_value String 是 选项值
    data_name String 是 选项名称
    data_params String 是 选项参数名

    返回示例:

    {
        "items": [
            {
                "field_id": "6dbd01468c134cae95d2c30f963aeb24",
                "field_name": "多行文本",
                "field_variable": "customField2",
                "field_type": 2,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 1,
                "cus_field_data_info_list": null
            },
            {
                "field_id": "81632fdcc05d41ef92b024979e489c17",
                "field_name": "日期",
                "field_variable": "customField3",
                "field_type": 3,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 1,
                "cus_field_data_info_list": null
            },
            {
                "field_id": "e4043f59025b454a95004e71ec7dd4b5",
                "field_name": "下拉列表",
                "field_variable": "customField6",
                "field_type": 6,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "测试使用",
                "operate_type": 1,
                "cus_field_data_info_list": [
                    {
                        "data_id": "27e4321062124922a35eb93986fe7d7d",
                        "data_value": "607592500180588",
                        "data_name": "苹果",
                        "data_params": "apple"
                    },
                    {
                        "data_id": "bb2f8d1b8dbc475598c71185b7f3a5f2",
                        "data_value": "607592500181862",
                        "data_name": "香蕉",
                        "data_params": "balana"
                    },
                    {
                        "data_id": "0c2fa8cbece54af7b24ca450c69a5d4f",
                        "data_value": "607592500182148",
                        "data_name": "西瓜",
                        "data_params": "xigua"
                    }
                ]
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    # ● 查询客户等级

    接口说明:

    查询客户等级

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/custom_field/get_vip_level_data_list
    
    1

    请求示例:

    curl https://www.sobot.com/api/scrm/5/custom_field/get_vip_level_data_list -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
    
    1

    返回参数:

    参数 类型 必填 描述
    data_value String 是 选项值
    data_name String 是 选项名称

    返回示例:

    {
      "items": [
        {
          "data_name": "VIP3",
          "data_value": "bb00cb033daa4eee912b0d51a8c12abf"
        },
        {
          "data_name": "VIP1",
          "data_value": "655779656425532"
        },
        {
          "data_name": "VIP4",
          "data_value": "655783829635797"
        },
        {
          "data_name": "VIP2",
          "data_value": "655779656428072"
        },
        {
          "data_name": "vip11",
          "data_value": "656301514215001"
        }
      ],
      "ret_code": "000000",
      "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    # ● 查询公司自定义字段

    接口说明:

    查询公司自定义字段

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/enterprise/query_custom_field_list
    
    1

    请求示例:

    curl https://www.sobot.com/api/scrm/5/enterprise/query_custom_field_list -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
    
    1

    返回参数:

    参数 类型 必填 描述
    field_id String 是 自定义字段id
    field_name String 是 自定义字段名称
    field_variable String 是 自定义字段变量名
    field_type Integer 是 自定义字段类型(1:单行文本 2:多行文本 3:日期 4:时间 5:数值 6:下拉列表 7:复选框 8:单选框 9:级联字段)
    fill_flag Integer 是 自定义字段是否必填(0:否 1:是)
    field_status Integer 是 自定义字段状态
    field_remark String 是 自定义字段备注
    operate_type Integer 是 操作类型
    cus_field_data_info_list List 否 选择型字段选项信息集合

    cus_field_data_info_list集合:

    参数 类型 必填 描述
    data_id String 是 选项id
    data_value String 是 选项值
    data_name String 是 选项名称
    data_params String 是 选项参数名

    返回示例:

    {
        "items": [
            {
                "field_id": "c7fb916b757846b68feda361ea38c6bc",
                "field_name": "下拉列表",
                "field_variable": "customField1",
                "field_type": 6,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 2,
                "field_params": null,
                "cus_field_data_info_list": [
                    {
                        "data_id": "62b96d279d92498ba772711f9e9560eb",
                        "data_value": "698745548415355",
                        "data_name": "下拉列表1",
                        "field_id": "c7fb916b757846b68feda361ea38c6bc",
                        "field_variable": null,
                        "data_params": "canscanshcanshu1"
                    },
                    {
                        "data_id": "3168ad1dcd9f46c7960e7c3b1157b8b1",
                        "data_value": "698745548417903",
                        "data_name": "下拉列表2",
                        "field_id": "c7fb916b757846b68feda361ea38c6bc",
                        "field_variable": null,
                        "data_params": "canshu2"
                    }
                ]
            },
            {
                "field_id": "3c368b05bfff4ff0af45654d5ef1a4e7",
                "field_name": "公司多行",
                "field_variable": "customField3",
                "field_type": 2,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 2,
                "field_params": null,
                "cus_field_data_info_list": null
            },
            {
                "field_id": "975c040de38f46dd872201fa42aa7a32",
                "field_name": "日期",
                "field_variable": "customField4",
                "field_type": 3,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 2,
                "field_params": null,
                "cus_field_data_info_list": null
            },
            {
                "field_id": "9d3d0e6be314401cbc64a1d902b439cc",
                "field_name": "公司-数值",
                "field_variable": "customField6",
                "field_type": 5,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 2,
                "field_params": null,
                "cus_field_data_info_list": null
            },
            {
                "field_id": "d9aecfb5d9694422b68938f9e9287c10",
                "field_name": "公司复选",
                "field_variable": "customField8",
                "field_type": 7,
                "fill_flag": 1,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 2,
                "field_params": null,
                "cus_field_data_info_list": [
                    {
                        "data_id": "4fbfe166d8794049b3cf53b3b0ffc17d",
                        "data_value": "699341039230996",
                        "data_name": "复选1",
                        "field_id": "d9aecfb5d9694422b68938f9e9287c10",
                        "field_variable": null,
                        "data_params": null
                    }
                ]
            },
            {
                "field_id": "c06ad8a5e6ca48d3b317c3d5890657ed",
                "field_name": "公司单选1",
                "field_variable": "customField9",
                "field_type": 8,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 2,
                "field_params": null,
                "cus_field_data_info_list": [
                    {
                        "data_id": "72aef04f506945c8a67673890354cf00",
                        "data_value": "699341057671409",
                        "data_name": "单选1",
                        "field_id": "c06ad8a5e6ca48d3b317c3d5890657ed",
                        "field_variable": null,
                        "data_params": null
                    }
                ]
            },
            {
                "field_id": "6e8a565facc84b0ab48b23449dd48e45",
                "field_name": "公司级联",
                "field_variable": "customField10",
                "field_type": 9,
                "fill_flag": 0,
                "field_status": 1,
                "field_remark": "",
                "operate_type": 2,
                "field_params": null,
                "cus_field_data_info_list": [
                    {
                        "data_id": "snrvczpf",
                        "data_value": "699341087659707",
                        "data_name": "公司1级联",
                        "field_id": "6e8a565facc84b0ab48b23449dd48e45",
                        "field_variable": null,
                        "data_params": null
                    },
                    {
                        "data_id": "36um1baq",
                        "data_value": "699341121759661",
                        "data_name": "公司2",
                        "field_id": "6e8a565facc84b0ab48b23449dd48e45",
                        "field_variable": null,
                        "data_params": null
                    },
                    {
                        "data_id": "s0b0cods",
                        "data_value": "699341133796057",
                        "data_name": "公司31",
                        "field_id": "6e8a565facc84b0ab48b23449dd48e45",
                        "field_variable": null,
                        "data_params": null
                    },
                    {
                        "data_id": "3c86b5hk",
                        "data_value": "699341087660379",
                        "data_name": "12",
                        "field_id": "6e8a565facc84b0ab48b23449dd48e45",
                        "field_variable": null,
                        "data_params": null
                    }
                ]
            }
        ],
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    # ● 查询黑名单中的客户列表

    接口说明:

    查询在黑名单中的客户列表

    请求方式:

    GET

    请求地址:

    https://www.sobot.com/api/scrm/5/user/query_black_list
    
    1

    请求参数:

    参数 类型 必填 描述
    user_id String 否 客户ID
    black_type Intager 否 拉黑类型 -1 永久拉黑,24 24小时拉黑,48 48小时拉黑,72 72小时拉黑
    start_time Long 否 起始时间
    end_time Long 否 截止时间(起始时间和截止时间要么同时传要么都不传)
    page_no Integer 否 当前页数
    page_size Intager 否 每页条数

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/query_black_list?user_id=17c6f373555141efaf3059a2ee4b9e0c&black_type=24&start_time=1710345600&end_time=1714374009&page_no=1&page_size=15 
    -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    page_no String 是 当前页数
    page_count String 是 总页数
    total_count String 是 总条数
    page_size String 是 每页条数
    items List 是 查询信息

    items集合:

    参数 类型 必填 描述
    user_id String 是 客户ID
    nick String 是 客户昵称
    black_type Integer 是 拉黑类型 -1 永久拉黑,24 24小时拉黑,48 48小时拉黑,72 72小时拉黑
    black_reason String 是 拉黑原因
    black_time Long 是 拉黑时间
    black_end_time Long 是 拉黑结束时间
    is_black Integer 是 拉黑状态 1 拉黑 0 正常
    user_status Integer 是 老版拉黑状态 1 拉黑 0 正常

    返回示例:

    {
      "items": [
        {
          "user_id": "4d1ecf10289a4a6887eddc5db7621f0b",
          "black_type": 48,
          "nick": "local客户",
          "black_time": 1714298404,
          "black_end_time": 1714471204,
          "is_black": 1,
          "user_status": 1
        },
        {
          "user_id": "1a814972610e4806a60385a3e8ddaa6f",
          "black_type": -1,
          "black_reason": "测试",
          "nick": "内网IP客户",
          "black_time": 1714298389,
          "black_end_time": 1800698389,
          "is_black": 1,
          "user_status": 1
        },
        {
          "user_id": "17c6f373555141efaf3059a2ee4b9e0c",
          "black_type": 0,
          "black_reason": "",
          "nick": "liling",
          "black_time": 0,
          "black_end_time": 0,
          "is_black": 0,
          "user_status": 1
        }
      ],
      "page_no": 1,
      "page_count": 1,
      "total_count": 3,
      "page_size": 3,
      "ret_code": "000000",
      "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    # ● 加入客户黑名单

    接口说明:

    将客户加入客户黑名单

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user/add_black_list
    
    1

    请求参数:

    参数 类型 必填 描述
    user_id String 是 客户ID
    black_type Integer 是 拉黑类型 -1 永久拉黑,24 24小时拉黑,48 48小时拉黑,72 72小时拉黑
    black_reason String 是 拉黑原因

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/add_black_list -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"user_id":"65cd9f14bdc74a5b888ae26103ac5164","black_type":24,"black_reason":"保存测试"}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
      "ret_code": "000000",
      "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 移出客户黑名单

    接口说明:

    将客户从客户黑名单中移除

    请求方式:

    POST

    请求地址:

    https://www.sobot.com/api/scrm/5/user/remove_black_list
    
    1

    请求参数:

    参数 类型 必填 描述
    user_id String 是 客户ID

    请求示例:

    curl https://www.sobot.com/api/scrm/5/user/remove_black_list -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
    -d '{"user_id":"65cd9f14bdc74a5b888ae26103ac5164"}'
    
    1
    2

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    返回示例:

    {
      "ret_code": "000000",
      "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4

    # 客户 CRM 消息推送

    详见回调消息参数说明, 点击此处跳转 (opens new window)

    # ● 新增客户

    接口说明:

    新增客户(首咨客户、待分配客户、跟进中客户、我的客户、全部客户、公海客户、公司详情)时消息实时推送。

    返回内容:

    参数 类型 必填 描述
    sys_code String 是 产品编码
    type String 是 消息类型
    content List 是 推送消息内容集合

    content集合:

    参数 类型 必填 描述
    area_name String 否 区县名称
    liable_agentid String 否 负责人id
    update_id String 是 更新者id
    biz_operatorid String 否 操作者id
    update_datetime String 是 更新时间(秒)
    create_type String 是 创建者类型(1客服、2套电机器人、3接待机器人、4语音机器人、5电销机器人、6触发器、7定时任务)
    user_emails String 否 邮箱(多个邮箱以英文分号分隔,示例:"xxxxxx@qq.com;xxxxxxx@qq.com")
    crm_status String 否 客户状态(1、首咨 2、待分配 3、跟进中 4、公海)
    userid String 是 客户id
    update_name String 是 更新者名称
    user_tels String 否 电话(多个电话以英文分号分隔,示例:"13xxxxxxxxx;15xxxxxxxxx")
    delete_reason String 否 删除原因
    companyid String 是 公司id
    datetime String 是 数据时间(秒)
    create_id String 是 创建者id
    stage_name String 否 阶段名称
    black_reason String 否 拉黑原因
    qq String 否 QQ号
    update_type String 是 更新者者类型(1客服、2套电机器人、3接待机器人、4语音机器人、5电销机器人、6触发器、7定时任务)
    black_type String 否 拉黑类型(24/48/72小时)
    liable_agent_name String 否 负责人名称
    province_name String 否 省份名称
    msg_type String 是 消息类型
    group_chat_name String 否 所属群聊
    biz_operator_type String 否 操作者类型(1客服、2套电机器人、3接待机器人、4语音机器人、5电销机器人、6触发器、7定时任务)
    status String 是 逻辑删除(8:正常 9:已删除)
    unionid String 否 企微unionid
    user_name String 是 真实名称
    remark String 否 备注
    is_black String 否 是否黑名单(1:是 0:否)
    city_name String 否 城市名称
    liable_department_name String 否 负责人部门名称
    create_datetime String 是 创建时间(秒)
    wx_build_unionid String 否 自建unionid(只有企业微信绑定公众号或者小程序的才会有)
    helper_agentid String 否 协助人id
    user_status String 否 客户状态(0:正常 1:黑名单)
    wx String 否 微信号
    helper_agent_name String 否 协助人名称
    stage_type String 否 跟进阶段类型(1跟进过程 2跟进结果(21成单、 22输单、23无效))
    user_label String 否 用户标签
    sex String 否 性别(1:男 2:女)
    bizid_type String 否 业务类型(0无,1会话,2通话,3工单)
    biz_operator_name String 否 操作者名称(1、客服名称 2、套电机器人名称)
    user_nick String 是 客户昵称
    qywx_friends_name String 否 企微好友
    bizid String 否 业务ID
    user_level String 否 VIP级别(固定字段,下拉列表用户可以自定义)
    black_endtime String 否 拉黑结束时间
    stageid String 否 阶段id
    create_name String 是 创建者名称
    extend_field_values List 否 扩展字段集合

    extend_field_values集合:

    参数 类型 必填 描述
    field_value String 否 扩展字段值
    field_type String 否 扩展字段类型(1、单行文本 2、多行文本 3、日期2019-09-01 4、时间10:20 5、数值 6、下拉列表(选项)7、单选框(选项)8、复选框(选项))
    fieldid String 否 扩展字段id
    field_params String 否 字段参数名
    data_params String 否 选项参数名

    返回示例:

    {
        "sys_code":"50",
        "type":"crm",
        "content":[
            {
                "area_name":"",
                "liable_agentid":"aa9e36822c6e447596fb4c231a5f6a32",
                "update_id":"aa9e36822c6e447596fb4c231a5f6a32",
                "biz_operatorid":"",
                "update_datetime":"1631821183",
                "create_type":"1",
                "user_emails":"",
                "crm_status":"3",
                "userid":"c9187ee3eb184ea7b297002e1066641d",
                "update_name":"刘丹",
                "user_tels":"",
                "delete_reason":"",
                "companyid":"e93d39fe311b4cf2a6ccd69cafaf256f",
                "datetime":"1631821183",
                "create_id":"aa9e36822c6e447596fb4c231a5f6a32",
                "stage_name":"",
                "black_reason":"",
                "qq":"",
                "update_type":"",
                "black_type":"",
                "liable_agent_name":"刘丹",
                "province_name":"",
                "msg_type":"0",
                "group_chat_name":"",
                "biz_operator_type":"",
                "status":"8",
                "unionid":"wmexjPBgAACq0AVd5XHNCNyDfT5ZGRVw",
                "user_name":"",
                "remark":"",
                "is_black":"",
                "city_name":"",
                "liable_department_name":"总公司",
                "create_datetime":"1631821183",
                "wx_build_unionId":"",
                "helper_agentid":"",
                "user_status":"",
                "wx":"",
                "helper_agent_name":"",
                "stage_type":"",
                "user_label":"",
                "sex":"0",
                "bizid_type":"",
                "biz_operator_name":"",
                "user_nick":"sobot",
                "extend_field_values":"",
                "qywx_friends_name":"刘丹",
                "bizid":"",
                "user_level":"",
                "black_endtime":"",
                "stageid":"",
                "create_name":"刘丹"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    # ● 更新客户

    接口说明:

    编辑客户信息、修改跟进阶段时消息实时推送。

    返回内容:

    参数 类型 必填 描述
    sys_code String 是 产品编码
    type String 是 消息类型
    content List 是 推送消息内容集合

    content集合:

    参数 类型 必填 描述
    area_name String 否 区县名称
    liable_agentid String 否 负责人id
    update_id String 是 更新者id
    biz_operatorid String 否 操作者id
    update_datetime String 是 更新时间(秒)
    create_type String 是 创建者类型(1客服、2套电机器人、3接待机器人、4语音机器人、5电销机器人、6触发器、7定时任务)
    user_emails String 否 邮箱(多个邮箱以英文分号分隔,示例:"xxxxxx@qq.com;xxxxxxx@qq.com")
    crm_status String 否 客户状态(1、首咨 2、待分配 3、跟进中 4、公海)
    userid String 是 客户id
    update_name String 是 更新者名称
    user_tels String 否 电话(多个电话以英文分号分隔,示例:"13xxxxxxxxx;15xxxxxxxxx")
    delete_reason String 否 删除原因
    companyid String 是 公司id
    datetime String 是 数据时间(秒)
    create_id String 是 创建者id
    stage_name String 否 阶段名称
    black_reason String 否 拉黑原因
    qq String 否 QQ号
    update_type String 是 更新者者类型(1、客服 2套电机器人、3接待机器人、4语音机器人、5电销机器人、6触发器、7定时任务)
    black_type String 否 拉黑类型(24/48/72小时)
    liable_agent_name String 否 负责人名称
    province_name String 否 省份名称
    msg_type String 是 消息类型
    group_chat_name String 否 所属群聊
    biz_operator_type String 否 操作者类型(1、客服 2套电机器人、3接待机器人、4语音机器人、5电销机器人、6触发器、7定时任务)
    status String 是 逻辑删除(8:正常 9:已删除)
    unionid String 否 企微unionid
    wx_build_unionid String 否 自建unionid(只有企业微信绑定公众号或者小程序的才会有)
    user_name String 是 真实名称
    remark String 否 备注
    is_black String 否 是否黑名单(1:是 0:否)
    city_name String 否 城市名称
    liable_department_name String 否 负责人部门名称
    create_datetime String 是 创建时间(秒)
    helper_agentid String 否 协助人id
    user_status String 否 客户状态(0:正常 1:黑名单)
    wx String 否 微信号
    helper_agent_name String 否 协助人名称
    stage_type String 否 跟进阶段类型(1:跟进过程 2:跟进结果(21成单、 22输单、23无效))
    user_label String 否 用户标签
    sex String 否 性别(1:男 2:女)
    bizid_type String 否 业务类型(0无,1会话,2通话,3工单)
    biz_operator_name String 否 操作者名称(1、客服名称 2、套电机器人名称)
    user_nick String 是 客户昵称
    qywx_friends_name String 否 企微好友
    bizid String 否 业务ID(会话id,通话id,有可能直接拉黑)
    user_level String 否 VIP级别(固定字段,下拉列表用户可以自定义)
    black_endtime String 否 拉黑结束时间
    stageid String 否 阶段id
    create_name String 是 创建者名称
    extend_field_values List 否 扩展字段集合

    extend_field_values集合:

    参数 类型 必填 名称 备注
    field_value String 否 扩展字段值
    field_type String 否 扩展字段类型(1、单行文本 2、多行文本 3、日期2019-09-01 4、时间 10:20 5、数值 6、下拉列表(选项)7、单选框(选项)8、复选框(选项))
    fieldid String 否 扩展字段id
    field_params String 否 字段参数名
    data_params String 否 选项参数名

    返回示例:

    {
        "sys_code":"50",
        "type":"crm",
        "content":[
            {
                "area_name":"",
                "liable_agentid":"",
                "update_id":"382e70947e274f7ab0380de27e104c29",
                "biz_operatorid":"",
                "update_datetime":"1614222756",
                "create_type":"1",
                "user_emails":"17789890000@qq.com",
                "crm_status":"2",
                "userid":"e5708e9626514ddb9b4f02f7e5fe659b",
                "update_name":"刘丹测试",
                "user_tels":"17789890000",
                "delete_reason":"",
                "companyid":"36551b8f301c43c3b2ac271ecc8ac9d9",
                "datetime":"1614222756",
                "create_id":"382e70947e274f7ab0380de27e104c29",
                "stage_name":"",
                "black_reason":"",
                "qq":"13344445555",
                "update_type":"1",
                "black_type":"",
                "liable_agent_name":"",
                "province_name":"",
                "msg_type":"0",
                "group_chat_name":"",
                "biz_operator_type":"",
                "status":"8",
                "unionid":"",
                "wx_build_unionId":"",
                "user_name":"李四",
                "remark":"客户咨询",
                "is_black":"",
                "city_name":"秦皇岛市",
                "liable_department_name":"",
                "create_datetime":"1614222756",
                "helper_agentid":"",
                "user_status":"",
                "wx":"test_sobot",
                "helper_agent_name":"",
                "stage_type":"",
                "user_label":"",
                "sex":"2",
                "bizid_type":"",
                "biz_operator_name":"",
                "user_nick":"李小姐",
                "extend_field_values":[
                    {
                        "field_value":"钓鱼",
                        "field_type":"1",
                        "fieldid":"62deb0e13ddc4d67ad3ecfd505e42964"
                    },
                    {
                        "field_value":"1980-11-27",
                        "field_type":"3",
                        "fieldid":"ecc35bf9e94e482b9ffe839be6d221a5"
                    }
                ],
                "qywx_friends_name":"",
                "bizid":"",
                "user_level":"8f3ccf868e3e425abe364686a7dd6803",
                "black_endtime":"",
                "stageid":"",
                "create_name":"刘丹测试"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    # ● 合并客户

    接口说明:

    合并客户时消息实时推送。

    返回内容:

    参数 类型 必填 描述
    sys_code String 是 产品编码
    type String 是 消息类型
    content List 是 推送消息内容集合

    content集合:

    参数 类型 必填 描述
    companyid String 是 公司id
    datetime Long 是 数据时间(秒)
    biz_operatorid String 否 操作者id
    msg_type Integer 是 消息类型
    biz_operator_name String 否 操作者名称
    userid String 是 客户id
    merged_userid String 是 被合并客户id

    返回示例:

    {
        "sys_code":"50",
        "type":"crm",
        "content":[
            {
                "companyid":"36551b8f301c43c3b2ac271ecc8ac9d9",
                "datetime":1614222177,
                "biz_operatorid":"382e70947e274f7ab0380de27e104c29",
                "msg_type":1,
                "biz_operator_name":"刘丹测试",
                "userid":"6c8e6562d1e448b397e6b7a046673423",
                "merged_userid":"6c8e6562d1e448b397e6b7a046673423"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    # 接口返回状态编码

    # ● 操作成功
    返回编码 编码说明
    000000 操作成功(除此编码以外的编码为错误编码)
    # ● 系统异常
    返回编码 编码说明
    700046 当前企业所购的版本不支持使用接口(免费版、海外团队版不可使用)
    900001 token为空
    900002 token已失效,请重新获取
    900003 signature错误
    900004 没有找到公司的api配置信息
    999999 系统未知异常
    # ● 系统异常
    返回编码 编码说明
    510001 标签组不存在
    510002 标签组名称已存在
    510003 标签名称已存在
    510004 .标签参数名已存在 .标签已不存在
    510005 标签组名称不能为空
    510006 标签名称不能为空
    510007 名称不能超过30个字
    510008 参数名称不能超过30个字
    500152 拉黑类型为必填字段
    500153 拉黑原因为必填字段
    500154 非法的拉黑类型
    500155 时间为秒级时间戳且结束时间大于开始时间
    500156 客户不在黑名单
    500157 客户在黑名单
    上次更新: 2025/3/5 12:11:57

    ← API调用说明 客服管理 API→

    最近更新
    01
    运营支持 API
    03-03
    02
    CRM 对接方案
    12-05
    03
    大模型机器人API
    09-09
    更多文章>
    Theme by Vdoing
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式