获取应用列表

请求地址

请求参数

Query parameters

Parameter Type Optional Description
pageNum Integer true 页数.
pageSize Integer true 页数大小.

请求结果

Path Type Description
code Integer 执行结果码
message String 执行结果说明
data Array 应用信息
data[].id Integer 应用ID.
data[].name String 应用名称.
data[].description String 应用描述.
data[].createTime String 应用创建时间.
data[].companyId Integer 应用的公司ID.
data[].accessKeyId String 应用accessKeyId.
data[].accessKeySecret String 应用accessKeySecret.
data[].appRobotResponseList Array 应用中绑定的机器人.
data[].appRobotResponseList[].robotId Integer 机器人ID.
data[].appRobotResponseList[].robotName String 机器人名称.

示例

$ curl 'https://km.udesk.cn/api/v1/apps?email=admin@udesk.cn&timestamp=1529402464&sign=8381262e495ae817172d466d976e42cc83bbbdb4&pageNum=1&pageSize=10' -i
返回
{
  "code" : 200,
  "message" : "OK",
  "visible" : false,
  "data" : [ {
    "id" : 11,
    "name" : "11",
    "description" : "222",
    "createTime" : "2017-12-22 15:45:19",
    "companyId" : 6,
    "accessKeyId" : "8HOlmb8WFfxnz5IMC8g",
    "accessKeySecret" : "rShtqhRO5VIUD76uvkbrkvnsOJSGAuXcKnFfhPW",
    "appRobotResponseList" : [ {
      "robotId" : 85,
      "robotName" : "ces "
    } ]
  }, {
    "id" : 10,
    "name" : "123",
    "description" : "",
    "createTime" : "2017-12-12 16:31:28",
    "companyId" : 6,
    "accessKeyId" : "9wLpiNVcbedPu6NVJR1H",
    "accessKeySecret" : "xg28NuRS1KU2wzcE3QvxlMQQaksIDNp3qytoOi9",
    "appRobotResponseList" : [ {
      "robotId" : 84,
      "robotName" : "hj测试机器人2号"
    } ]
  }, {
    "id" : 6,
    "name" : "测试2",
    "description" : "绑定时间-2017年10月24日10:22:14",
    "createTime" : "2017-10-24 10:21:58",
    "companyId" : 6,
    "accessKeyId" : "ZJxlAoIal+dmbZWalsNW",
    "accessKeySecret" : "9t/EvojGUdvfsMeftZjKM0YQ6iQtVboasEEcpRwM",
    "appRobotResponseList" : [ {
      "robotId" : 84,
      "robotName" : "hj测试机器人2号"
    } ]
  } ]
}

请求失败原因

Message Cause
Failed to convert value of type 'java.lang.String' to required type 'int'; 整型参数的值异常

获取应用下所有的机器人列表

请求地址

请求参数

Query parameters

Parameter Type Optional Description
appID String false 应用ID,在初始化会话中对应accessKeyId,在km-管理-应用管理中查看.

请求结果

Path Type Description
code Integer 执行结果码
message String 执行结果说明
visible Boolean
data Array 机器人信息
data[].id Integer 机器人id.
data[].name String 机器人名.
data[].logo String 机器人头像.
data[].channelList Array 机器人下属渠道列表.
data[].channelList[].id Integer 场景id.
data[].channelList[].robotId Integer 机器人Id.
data[].channelList[].name String 场景名称.
data[].channelList[].description String 场景描述.
data[].channelList[].type Integer type 1:默认 2:非默认.

示例

$ curl 'https://km.udesk.cn/api/v1/robots?email=admin@udesk.cn&timestamp=1529402448&sign=f9a267c5d3a10f144489f5ec61ce36c696d0fe2e&appID=%2F%2B7772AKE6kv8AVNjWqP' -i -H 'Accept: application/json'
返回
{
    "code": 200,
    "message": "OK",
    "visible": false,
    "exception": null,
    "paging": {
        "pageNum": 1,
        "pageSize": 2,
        "total": 2
    },
    "data": [
        {
            "id": 91,
            "name": "测试L",
            "logo": "https://xxx.oss-cn-beijing.aliyuncs.com/Data/robot/robot_logo_default.png",
            "channelList": [
                {
                    "robotId": 91,
                    "name": "系统默认场景",
                    "type": 1,
                    "id": 93
                }
            ]
        },
        {
            "id": 83,
            "name": "hj 测试机器人3",
            "logo": "https://xxx.oss-cn-beijing.aliyuncs.com/Data/image/ssjeBWZpJPaT8TQ3hXcwhSSx3NJRzjW2/u=3933150512,449646089&fm=27&gp=0.jpg",
            "channelList": [
                {
                    "robotId": 83,
                    "name": "系统默认场景",
                    "type": 1,
                    "id": 82
                },
                {
                    "robotId": 83,
                    "name": "场景2",
                    "type": 2,
                    "id": 83
                }
            ]
        }
    ]
}

请求失败原因

Message Description
"The ID has no corresponding application" APPID无效