# 获取机器人状态

[同步接口]获取指定机器人在线以及可用状态。 扫码号具有在线状态 平台号没有在线状态

请求方式:POST

请求地址:https://$basehost/gateway/qopen/GetRobotStatusSync

body参数

{
    "robot_id_list": ["机器人id"]
}
字段 类型 必填 说明
robot_id_list array 机器人id列表,不可传空,最多支持传入100个

返回值:

{
    "data": {
        "failed_list": [],
        "robot_status_list": [
            {
                "robot_id": "机器人id",
                "is_online": true,
                "enable": true
            }
        ]
    },
    "errcode": 0,
    "errmsg": "",
    "hint": ""
}

返回说明

字段 类型 说明
errcode int 状态码,0为正常,非0代表错误
errmsg string 错误信息
data json json返回值
   failed_list array 查询失败的机器人编号列表
   robot_status_list array 机器人状态列表
     robot_id string 机器人id
     is_online bool 是否在线:true在线,false不在线
     enable bool 是否正常:true正常,false已回收
hint string 请求日志ID

完整请求示例:

curl -X POST \
  https://$basehost/gateway/qopen/GetRobotStatusSync \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Token: c2NdxDHKXIJ5j1zrhJeq2eJEHjh9xxx' \
  -d '{"robot_id_list": ["机器人id"]}'
最后更新时间: 2023/5/24 10:48:59