0
votes

I've created devices and managed them with Node-RED. And receiving real-time data in my IoT platform board. So i wanted to access those data by REST API which i found this: https://docs.internetofthings.ibmcloud.com/apis/swagger/v0002-beta/info-mgmt-beta.html

Specially wanted to use this /device/types/{typeId}/devices/{deviceId}/state/{applicationInterfaceId}

And i created schema by following this: https://developer.ibm.com/courses/labs/create-device-schema-internet-things-platform-service-ibm-bluemix-dwc013/

Then i requested to /api/v0002/applicationinterfaces, /api/v0002/schemas.

But both result was: {"results": [], "meta": {"total_rows": 0}}

How can i create schema and application interface?

2

2 Answers

2
votes

The /api/v0002/applicationinterfaces, /api/v0002/schemas will return 0 results because you need to use the POST methods described in https://docs.internetofthings.ibmcloud.com/apis/swagger/v0002-beta/info-mgmt-beta.html to create the schema and application interface.

However, from your question I think you simply want to access the device data. In which case view the documentation for developing applications https://console.bluemix.net/docs/services/IoT/applications/api.html#api, in particular you can access the last event for a particular device using the last event cache e.g. /api/v0002/device/types/{deviceType}/devices/{deviceId}/events

0
votes

Finally I found the correct REST here which returns event data i.e. sensor data. On this link refer Last Event Cache. The REST will return the "payload" field with encrypted value. Just decrypt that value and you will see the sensor data.

Thanks, Rahul