user1542652
user1542652

Reputation: 73

Getting error while getting device data from watson iot platform using Rest API

I have added 2 type of devices in Watson-Iot platform, one is Iot-Bridge and one is gateway. When I make the API call to get device info for gateway type of device, it gives me the information but same type of call for Iot-Bridge type device says NotFound. e.g. https://internetofthings.ibmcloud.com/api/v0002/organizations/{orgId}/device/types/gateway01/devices/{deviceId} gives device Info but below call gives NOT FOUND, however there is a device by that name as /bulk/devices gives list of all devices. https://internetofthings.ibmcloud.com/api/v0002/organizations/{orgId}/device/types/iot-bridge/devices/{deviceId}

Can anyone provide any idea?

Also how can I get all the information for data sent by these devices to Iot Platform? API endpoint is given but its giving Bad Request.

Upvotes: 0

Views: 161

Answers (1)

ValerieLampkin
ValerieLampkin

Reputation: 2626

I am glad to hear you identified the device info endpoint was checking for cases sensitivity and resolved the problem by correcting the case of the device type name.

An application can subscribe to monitor the status of one or more devices, for example:

Subscribe to topic iot-2/type/device_type/id/device_id/mon

Note: To subscribe to updates from more than one device, use the MQTT "any" wildcard character (+) for any of the following components:

device_type
device_id

For managed devices, you can use the API to get log connection information to determine when managed devices have connected and disconnected.

You may find this recipe for displaying status of devices useful: https://developer.ibm.com/recipes/tutorials/display-status-of-registered-devices-on-watson-iot-platform/

Upvotes: 0

Related Questions