开发者文档 开发者文档
帮助中心 (opens new window)
帮助中心 (opens new window)
  • 渠道接入

    • Web 链接接入说明
    • Web-JS 接入说明
    • Android SDK
    • Android SDK V6
    • iOS SDK
    • iOS SDK V6
    • 微信小程序
    • 微信公众号
    • 企业微信
    • 微博私信
    • Flutter、DCloud、APICloud
    • 微信客服
    • CRM 对接方案
  • 在线客服 API
  • 在线统计 API
  • 在线机器人 API
  • 知识库 API
  • 电商平台 API
    • 客服组件SDK

    • 消息推送
    • 在线消息转发 API
    • 知识库V6 API
    • 在线机器人统计 API
    • 企业主动发送离线消息API
    • 规则引擎API
    • 大模型机器人API
    • 文本类产品 API
    智齿科技
    2022-05-19
    目录

    电商平台 API

    # 电商平台 API

    # 电商平台企业列表查询

    接口说明:

    通过接口调用形式查询电商平台企业列表

    接口信息:

    请求地址:

     https://www.sobot.com/tenantpro/open/getTenantList
    
    1

    请求方式:

    POST

    请求参数:

    参数 类型 必填 描述
    unionCode string 必选 第三方平台唯一编码,智齿提供
    ts long 必选 当前时间戳,用于 token 的验证,单位为毫秒
    token string 必选 token = MD5(unionCode+ts+email+unionKey) unionKey:加密私钥由智齿提供
    email string 必选 平台超管邮箱唯一
    startDate string 非必选 2018-09-04
    endDate string 非必选 2018-09-04
    inputStatus string 非必选 搜索类型:1-商户企业名称,2-商户联系账号,3-商户超管电话,4-外部 id(1、2、3 为模糊匹配,4 为完全匹配)
    inputValue String 非必选 对应 inputStatus 的搜索值
    openStatus string 必选 商户状态:-1:全部,1:开启 0:停用
    pageNo Integer 非必选 开始页
    pageSize Integer 非必选 每页展示几条

    返回示例:

    {
        "pageNo": 1,
        "pageCount": 1,
        "totalCount": 3,
        "pageSize": null,
        "items": [
            {
                "companyId": "3b9577c3ddaa49bda857a0ab8593b7ba",
                "companyName": "青樱格格02",
                "email": "02@1com",
                "contactTel": "13100000000",
                "contactName": "",
                "serviceNum": 0,
                "maxServiceCount": 0,
                "createTime": "2018-08-29",
                "endTime": "2099-12-31",
                "tenantStatus": true,
                "appKey": "8748cd7faeb1401ab3d97cf45013afc4",
                "services": null,
                "customerCode": null,
                "customfieldsCode": null,
                "customfieldsName": null,
                "provinceId": null,
                "provinceName": null,
                "cityId": null,
                "cityName": null,
                "areaId": null,
                "areaName": null
            },
            {
                "companyId": "42fb9905aa7f4eff9639d732c9c3aa85",
                "companyName": "还珠格格03",
                "email": "03@1com",
                "contactTel": "13100000000",
                "contactName": "",
                "serviceNum": 0,
                "maxServiceCount": 0,
                "createTime": "2018-08-29",
                "endTime": "2099-12-31",
                "tenantStatus": false,
                "appKey": "1deb109104334977ae654d3a9096d942",
                "services": null,
                "customerCode": null,
                "customfieldsCode": null,
                "customfieldsName": null,
                "provinceId": null,
                "provinceName": null,
                "cityId": null,
                "cityName": null,
                "areaId": null,
                "areaName": null
            },
            {
                "companyId": "bc0af7e208164b6a8aa83f7722cb22ed",
                "companyName": "青樱格格01",
                "email": "01@1com",
                "contactTel": "13100000000",
                "contactName": "",
                "serviceNum": 0,
                "maxServiceCount": 0,
                "createTime": "2018-08-29",
                "endTime": "2099-12-31",
                "tenantStatus": true,
                "appKey": "1d7fe2633d944e459646f4eb0973d0ba",
                "services": null,
                "customerCode": null,
                "customfieldsCode": null,
                "customfieldsName": null,
                "provinceId": null,
                "provinceName": null,
                "cityId": null,
                "cityName": null,
                "areaId": null,
                "areaName": null
            }
    
        ],
    
        "item": null,
        "retCode": "200000",
        "retMsg": "成功"
    
    }
    
    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

    # 添加企业

    接口说明:

    通过接口调用形式添加电商平台商户。

    接口信息:

    请求地址:

     https://www.sobot.com/tenantpro/open/addTenant.json
    
    1

    请求方式:

    POST

    请求参数:

    参数 类型 必填 描述
    unionCode String 必选 第三方平台唯一编码,智齿提供
    ts long 必选 当前时间戳,用于 token 的验证,单位为毫秒
    companyName String 必选 公司名称
    email String 必选 客服邮箱,需要保证唯一
    maxCount Integer 必选 指定最大客服数量
    password String 必选 客服登录密码
    contactName String 非必选 联系人
    contactTel String 非必选 联系电话
    token String 必选 token = MD5(unionCode+ts+email+unionKey)unionKey:加密私钥由智齿提供
    customerCode String 必选 商户在平台里面的唯一 id
    icon String 非必选 商户图标

    返回示例:

    {
    
        "retCode": "200000",
        "retMsg": "成功!",
        "msg":{
            "appKey": "XXXX",
            "contactName": "联系人",
            "sysNum" : "xxxx"
        }
    }
    {"retCode":"999999","retMsg":"customerCode 已存在!","msg":null}
    {"retCode":"200007","retMsg":"在线客服数量不足","msg":null}
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    # 电商平台修改企业

    接口说明:

    通过接口调用形式修改电商平台商户

    接口信息:

    请求地址:

     https://www.sobot.com/tenantpro/open/updateTenant.json
    
    1

    请求方式:

    POST

    请求参数:

    参数 类型 必填 描述
    unionCode String 必选 第三方平台唯一编码,智齿提供
    ts long 必选 当前时间戳,用于 token 的验证,单位为毫秒
    companyName String 必选 公司名称
    maxCount Integer 必选 指定最大客服数量
    contactName String 非必选 联系人
    contactTel String 非必选 联系电话
    token String 必选 token = MD5(unionCode+ts+email+unionKey) unionKey:加密私钥由智齿提供
    customerCode String 必选 商户在平台里面的唯一 id
    email String 必选 商户的超管邮箱

    返回示例:

    {"retCode":"200000","retMsg":"成功","msg":null}
    {"retCode":"999999","retMsg":"商户不存在!","msg":null}
    {"retCode":"200007","retMsg":"在线客服数量不足","msg":null}
    
    1
    2
    3

    # 添加客服

    接口说明:

    通过接口调用形式添加客服

    接口信息:

    请求地址:

     https://www.sobot.com/tenantpro/open/addServiceInfoConfim.json
    
    1

    请求方式:

    POST

    请求参数:

    参数 类型 必填 描述
    unionCode String 必选 第三方平台唯一编码,智齿提供
    ts long 必选 当前时间戳,用于 token 的验证,单位为毫秒
    token String 必选 token = MD5(unionCode+ts+email+unionKey)unionKey:加密私钥由智齿提供
    customerCode String 必选 商户在平台里面的唯一 id
    nick String 必选 客服昵称
    name String 必选 客服真实姓名
    email String 必选 客服邮箱,唯一
    roleId String 必选 客户角色 id(5555:工单客服、2222:在线管理员、1111:在线客服、8888:工单管理员)
    password String 非必选 客服密码
    phoneNo Integer 必选 客服手机号
    maxAcceptNum Integer 必选 坐席接待上限

    返回示例:

    {"retCode":"200000","retMsg":"成功","msg":null}
    {"retCode":"999999","retMsg":"商户不存在!","msg":null}
    {"retCode":"999998","retMsg":"请求失败!登录已失效,请重新登录!","msg":null}
    
    1
    2
    3

    # 编辑客服

    接口说明:

    通过接口调用形式编辑客服

    接口信息:

    请求地址:

     https://www.sobot.com/tenantpro/open/updateServiceInfoConfim.json
    
    1

    请求方式:

    POST

    请求参数:

    参数 类型 必填 描述
    unionCode String 必选 第三方平台唯一编码,智齿提供
    ts long 必选 当前时间戳,用于 token 的验证,单位为毫秒
    token String 必选 token = MD5(unionCode+ts+email+unionKey)unionKey:加密私钥由智齿提供
    customerCode String 必选 商户在平台里面的唯一id
    serviceNick String 必选 客服昵称
    serviceName String 必选 客服真实姓名
    phoneNo Integer 必选 手机号码
    maxAcceptNum Integer 必选 坐席接待上限
    email String 必选 客服邮箱,唯一

    返回示例:

    {"retCode":"200000","retMsg":"成功","msg":null}
    {"retCode":"999999","retMsg":"商户不存在!","msg":null}
    {"retCode":"999999","retMsg":"客户邮箱未激活,请激活后再次尝试修改客户信息!","msg":null}
    
    1
    2
    3

    # 删除客服

    接口说明:

    通过接口形式删除客服

    接口信息:

    请求地址:

     https://www.sobot.com/tenantpro/open/deleteServiceInfoConfim
    
    1

    请求方式:

    POST

    请求参数:

    参数 类型 必填 描述
    unionCode String 必选 第三方平台唯一编码,智齿提供
    ts long 必选 当前时间戳,用于 token 的验证,单位为毫秒
    token String 必选 token = MD5(unionCode+ts+email+unionKey)unionKey:加密私钥由智齿提供
    customerCode String 必选 商户在平台里面的唯一 id
    email String 必选 客服邮箱,唯一

    请求示例:

    {
        "unionCode":"10004",
        "ts":"158934009028",
        "token":"dldnscb2e9c740dba4b75a34d5358802",
        "customerCode":"7",
        "email":"1024011851@qq.com"1
    }
    
    1
    2
    3
    4
    5
    6
    7

    返回示例:

    {"retCode":"200000","retMsg":"成功","msg":null}
    {"retCode":"999999","retMsg":"商户不存在!","msg":null}
    {"retCode":"999999","retMsg":"客户邮箱未激活,请激活后再次尝试修改客户信息!","msg":null}
    
    1
    2
    3

    # 客服会话统计查询接口

    接口说明:

    接口作用:获取平台下的所有商户的所有客服会话统计

    接口信息:

    请求地址:

    http://www.sobot.com/tenantpro/tenantReport/tenantExportData
    
    1

    请求方式:

    POST

    备注:如需使用接口,需提前联系客户经理进行数据整理安排

    请求参数:

    参数 类型 必填 描述
    unionCode String 是 平台 id
    ts String 是 时间戳
    sign String 是 签名
    type String 是 类型 7 : 会话统计、8 : 响应时间统计
    date String 是 日期(yyyy-MM-dd)

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    unionCode String 平台 id
    createTime String 创建时间
    taskType String 任务类型
    resultDate String 日期
    file_path String 文件路径
    description String 描述

    请求示例:

    {
     	"unionCode":"10004",
        "ts":"1569397773",
        "sign":"dldnscb2e9c740dba4b75a34d5358802",
        "type":"7",
        "date":"2020-01-05"
    }
    
    1
    2
    3
    4
    5
    6
    7

    返回示例:

    {
        "item": {
            "filePath":"https://sobot-test.oss-cn-beijing.aliyuncs.com/expo105-zip",
            "unionCode":"10004",
            "createTime": "1573027669037",
            "resultDate": "2020-01-05",
            "taskType": "7"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    # 客服响应时间统计查询接口

    接口作用:

    获取平台下的所有商户的所有客服响应时间

    请求地址:

    http://www.sobot.com/tenantpro/tenantReport/tenantExportData
    
    1

    请求方式:

    POST

    备注:如需使用接口,需提前联系客户经理进行数据整理安排

    请求参数:

    参数 类型 必填 描述
    unionCode String 是 平台 id
    ts String 是 时间戳
    sign String 是 签名
    type String 是 类型 7:会话统计、8:响应时间统计
    date String 是 日期(yyyy-MM-dd)

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    unionCode String 平台 id
    createTime String 创建时间
    taskType String 任务类型
    resultDate String 日期
    filePath String 文件路径
    description String 描述

    请求示例:

    {
     	"unionCode":"10004",
        "ts":"1569397773",
        "sign":"dldnscb2e9c740dba4b75a34d5358802",
        "type":"7",
        "date":"2020-01-05"
    }
    
    1
    2
    3
    4
    5
    6
    7

    返回示例:

    {
        "item": {
            "filePath":"https://sobot-test.oss-cn-beijing.aliyuncs.com/expo105-zip",
            "unionCode":"10004",
            "reateTime": "1573027669037",
            "resultDate": "2020-01-05",
            "taskType": "8"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    # 批量获取所有子商户 appKey 信息查询

    接口说明:

    接口作用:获取平台下所有子商户的 appKey 和 appId

    接口信息:

    请求地址:

     https://www.sobot.com/tenantpro/getBatchAppKey
    
    1

    请求方式:

    POST

    请求参数:

    参数 类型 必填 描述
    unionCode String 是 平台 id
    ts String 是 时间戳
    sign String 是 签名

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    data Object 否 返回对象
    time String 否 请求时间

    data 对象:

    参数 类型 必填 描述
    appId String appId
    appKey String appKey
    companyId String 公司 id
    companyName String 公司名称

    请求示例:

    {
     	"unionCode":"10004",
        "ts":"1569397773",
        "sign":"dldnscb2e9c740dba4b75a34d5358802"
    }
    
    1
    2
    3
    4
    5

    返回示例:

    {
        "10004": {
            "data": [
                {
                    "appId": "3cb9c7b8dd914621ae3db8bef000d0",
                    "appKey": "d14N6QO9e3p6",
                    "companyId": "be7f05de11a54390c3f3ec35e6010b",
                    "companyName": "测试二号"
                },
                {
                    "appId": "b17989cdf9b2428db63b90672b756015",
                    "appKey": "wJH5gW65e98x",
                    "companyId": "32d5fedaf268441dbde6d3eb23a17cee",
                    "companyName": "测试三号"
                },
                {
                    "appId": "f6bbd4bce5924fde807dbd7ccc17af53",
                    "appKey": "u11zt3o3Q09s",
                    "companyId": "6f77727bdb074a128fc43d8788ee5a09",
                    "companyName": "测试一号"
                },
            ],
            "time": "2020-04-01 10:39:21"
        },
        "retCode": "000000",
        "retMsg": "操作成功"
    }
    
    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

    # 客服状态明细接口

    接口说明:

    通过接口获取客服明细状态列表

    接口信息:

    请求地址:

     https://www.sobot.com/tenantpro/coutomer/getStaffLogInfos
    
    1

    请求方式:

    GET

    请求参数:

    参数 类型 必填 描述
    unionCode String 必选 第三方平台唯一编码,智齿提供
    ts long 必选 当前时间戳,用于 token 的验证,单位为毫秒
    token String 必选 token = MD5(unionCode+ts+unionKey)unionKey:加密私钥由智齿提供
    startTime long 非必选 开始时间,精确到 ms 查询最多查询一周的数据。前台传参分为 4 种情况: 1)startTime,endTime 都不为空时, 如果时间范围超过1周, 以结束时间为准, 向前推一周重置开始时间; 2)startTime,endTime 都为空时, 结束时间为当前时间,开始时间为当前时间向前推一周; 3)startTime 不为空了, endTime 为空时,结束时间为开始时间向后推一周; 4)startTime 为空, endTime 不为空时, startTime 为endTime 向前推一周。
    endTime long 非必选 结束时间,精确到 ms

    返回示例:

    {
        "items":[
            {
                "companyId":"9e73cc58f2f7472d993e6772c250ed99",
                "companyStaffInfos":[
                    {
                        "staffId":"53df8dee9a9e4fdda236faf6351e7a8d",
                        "staffLogInfos":[
                            {
                                "datetime":1571037571921,
                                "datetimeFormat":"2019-10-14 15:19:31",
                                "source":0,
                                "operationAction":"在线"
                            }
                        ]
                    }
                ]
            }
        ],
        "retCode":"200000",
        "retMsg":"成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    items:

    参数 类型 必填 描述
    companyId String 商户 id
    companyStaffInfos List 商户的客服信息集合

    companyStaffInfos:

    参数 类型 必填 描述
    staffId String 客服 id
    staffLogInfos List 此客服日志信息集合

    staffLogInfos:

    参数 类型 必填 描述
    datetime Long 操作时间(时间戳)
    datetimeFormat String 操作时间(格式化后)
    source int 渠道 0-pc,2-app
    operationAction String 客服状态

    # 商户聊天列表

    接口说明:

    接口作用:获取客户的商户列表

    请求方式:

    POST 请求类型:

    application/json

    请求地址:

    http://www.sobot.com/chat-third/tenant/5/user/chatIndexPage
    
    1

    请求参数:

    参数 类型 必填 描述
    union_code String 是 平台 id
    partnerId String 是 对接 id
    ts Long 是 当前时间戳
    token String 是 接口调用凭证. token=MD5(unionCode+partnerId+ts+unionKey)

    响应格式:

    {
        "items": [
    
    	    {
    
    	        "unionCode": "10001",
    
    	        "sysNum": "a285455c3f3742a2abc5af9285e6a5fa",
    
    	        "companyName": "公司01",
    
    	        "companyLogo": "https://sobot.com/con3/imgpng",
    
    	        "visitorId": "442bcaceb7c3ee2a60f671605ed6e275",
    
    	        "partnerId": "test001",
    
    	        "lastCid": "032dc4dd38d24f97aeb6b38346854f71",
    
    	        "lastMsgContent": "ko",
    
    	        "lastMsgTime": 1607338626737,
    
    	        "lastMsgType": 0,
    
    	        "unReadNum": 0
    
    	    },
    	    {
    
    	        "unionCode": "10001",
    
    	        "sysNum": "dfa71d55d4ce419b8e4db044dc551961",
    
    	        "companyName": "公司02",
    
    	        "companyLogo": "https://sobot.com/con3/imgpng",
    
    	        "visitorId": "2b24b95ac255f1737349cb6ca49ecd3b",
    
    	        "partnerId": "test001",
    
    	        "lastCid": "742babf91b774b63951261712e3dacb8",
    
    	        "lastMsgContent": "ok",
    
    	        "lastMsgTime": 1605614529832,
    
    	        "lastMsgType": 0,
    
    	        "unReadNum": 0
    
    	    }
    
    	],
    
    	"status": 1
    
    }
    
    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

    响应数据:

    items 数据列表
    status 1:成功; 2:传参异常; 3:unionCode 异常; 4:接口调用频率超过限制,目前的上限是每分钟调用 20 次; 5:token 校验异常; 0:未知异常

    items:

    参数 类型 必填 描述
    unionCode String 平台id
    sysNum String 公司 id
    companyName String 公司名
    companyLogo String 公司 logo
    visitorId String 访客 id
    partnerId String 客户对接 id
    lastCid String 最新的会话 id
    lastMsgType String 最后一条消息类型,0:文本; 1:图片; 2:语音; 其他:富文本
    lastMsgContent String 最后一条消息内容,lastMsgType 是文本时展示内容
    lastMsgTime String 最后一条消息时间,单位是 ms
    unReadNum String 未读消息数

    # 客服统计接口

    接口作用:获取指定时间范围内平台所有商户的客服统计指标

    请求方式:

    POST

    请求地址:

    http://www.sobot.com/tenantpro/tenantReport/tenantStaffJobList
    
    1

    备注:如需使用接口,需提前联系客户经理进行数据整理安排

    请求参数:

    参数 类型 必填 描述
    union_code String 是 平台 id
    ts String 是 时间戳
    sign String 是 签名
    start_date String 是 开始日期 2018-09-04
    end_date String 是 结束日期 2018-09-05

    返回参数:

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

    item对象:

    参数 类型 必填 描述
    staffid String 客服 id
    companyid String 公司 id
    first_response_time_set Integer 首次接待首响会话
    transfer_first_response_count Integer 转接首响次数
    session_human_visitor_consult Integer 有效咨询会话
    first_response_in60s_rate String 首响 60s 应答率

    请求示例:

    {
        "union_code":"10004",
        "ts":"1569397773",
        "sign":"dldnscb2e9c740dba4b75a34d5358802",
        "start_date":"2021-03-02",
        "end_date":"2021-03-02"
    }
    
    1
    2
    3
    4
    5
    6
    7

    返回示例:

    {
        "items":[
            {
                "staffid":"0a499e5706fb454688abe23ffeb48e6f",
                "companyid":"f2749ad44367485796b3ca8d4777388c",
                "first_response_time_set":1,
                "transfer_first_response_count":0,
                "session_human_visitor_consult":1,
                "first_response_in60s_rate":"100%"
            },
            {
                "staffid":"441d1579b6364ab6b9a33b5f5d956852",
                "companyid":"a5b158a28fbf4a2d99ee1c374416573b",
                "first_response_time_set":0,
                "transfer_first_response_count":0,
                "session_human_visitor_consult":4,
                "first_response_in60s_rate":"00%"
            },
            {
                "staffid":"99653e9bf9534fd2bd542328ff2b31e1",
                "companyid":"7f9c02497a9a4423b5d2ada26d666951",
                "first_response_time_set":0,
                "transfer_first_response_count":0,
                "session_human_visitor_consult":1,
                "first_response_in60s_rate":"00%"
            }
        ],
        "retCode":"000000",
        "retMsg":"成功"
    }
    
    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

    # 错误编码

    错误编码 错误说明
    000000 操作成功(除此编码以外的编码为错误编码)
    220001 [x] 的长度超过最大限制,最多允许 x 个字符
    上次更新: 2025/3/12 17:33:00

    ← 知识库 API Android SDK→

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