【发布时间】:2020-12-02 15:35:00
【问题描述】:
我在 Watson IoT Platform 在线仪表板上创建了一个设备。 此设备使用基本身份验证和 use-token-auth 及其密码发布数据:
URL: https://noz238.messaging.internetofthings.ibmcloud.com:8883/api/v0002/device/types/Light/devices/TestLight/events/status
Method: POST
Body: {"isOn":false}
此发送正文在 https://noz238.internetofthings.ibmcloud.com/dashboard/devices/browse 的最新事件视图中可见
我无法使用此 REST API(以及用于可视化的 API 密钥)获取此设备的最新状态/事件。我在尝试不同的 api 时确实得到了意想不到的响应
我试过这个端点:https://noz238.internetofthings.ibmcloud.com/api/v0002/device/types/Light/devices/TestLight/events (https://docs.internetofthings.ibmcloud.com/apis/swagger/v0002/info-mgmt.html#/Last%20Event%20Cache/get_device_types__deviceType__devices__deviceId__events)
回答: 钢筋混凝土:403
{
"message": "CUDCS0106E: <missing messageId in bundle com.ibm.wiotp.util.httpservice.nls.servicemessages>",
"exception": {
"id": "CUDCS0106E",
"properties": [
"noz238"
]
}
}
我尝试了这个端点:https://noz238.internetofthings.ibmcloud.com/api/v0002/device/types/Light/devices/TestLight/state/test (https://docs.internetofthings.ibmcloud.com/apis/swagger/v0002/state-mgmt.html#/Devices/get_device_types__typeId__devices__deviceId__state__logicalInterfaceId_)
回答: 遥控:404
{
"message": "CUDIM0001E: No 'Device Type' with id 'Light' could be found in org 'noz238'",
"exception": {
"id": "CUDIM0001E",
"properties": [
"noz238",
"Light",
"Device Type"
]
}
}
如何获取设备的最新事件/状态?
【问题讨论】:
标签: ibm-cloud iot ibm-watson watson-iot