IoT Cores Dashboard APIs
API Endpoint
https://dashboard-api.iotcores.com/v0Authentication
The IoT Cores dashboard requires users to authenticate using a bearer token issues by the base IoT Cores API.
A token can be obtained by issueing a POST
to https://api.iotcores.com/v0/oauth/token
.
The POST body must be application/x-www-form-urlencoded
and contain the following fields:
-
grant_type
with the value set topassword
. -
username
with the value set to your username/email address. -
password
with the value set to your password. -
client
with the value aset to a descriptor of your application. E.g. the dashboard usesvelocity-dashboard
.
If successful you’ll receive a 200 status code response with an application/json
body as shown in this example:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoidXNlciIsIm5hbWVpZCI6ImFjOGUxYmUwLTg4MGUtNGI2My1hZzUyMTkzOSwibmJmIjoxNTM2NjU3OTM5fQ.J2090TZaL-hSWCsifl0KegSe7iuaDkhs87WZKgqDf1c",
"token_type": "bearer",
"expires_in": 863999
}
The access_token
field needs to be used for authenticating requests to all dashboard APIs.
In order to authenticate include an Authorization
with the value in the format bearer <access_token>
.
Note that the access_token
is not valid forever.
The expires_in
field specifies how many seconds the token will remain valid before it expires.
After the token expires it will be rejected and you’ll need to get a new token by authenticating again.
Project Devices ¶
List Project Devices ¶
Headers
Content-Type: application/json
Body
[
{
"display": "North Paddock",
"deviceId": "a013170112ecc060",
"type": "BlueNode",
"firstContact": "2018-02-13T23:55:58.2375888+00:00",
"lastContact": "2018-09-11T08:23:57.3806751+00:00",
"userMeta": {
"soilTypeOption": 4,
"soilUnitOption": 0,
"hide": false
},
"state": {
"sensorUID": {
"value": 11534588364005884000,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"sensorUIDHex": {
"value": "a013170112ecc060",
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"packetId": {
"value": 901,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"batteryOkay": {
"value": true,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"probeData.serialNumber": {
"value": "S0000202658",
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"probeData.sensorReading.0.temperature_raw": {
"value": 168,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"probeData.sensorReading.1.temperature_raw": {
"value": 164,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"probeData.sensorReading.2.temperature_raw": {
"value": 166,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"sensorVersion_word": {
"value": 16779777,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"baseBlock.loraRSSI_dBm": {
"value": 66,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"nodeTemperature_dC": {
"value": 224,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
}
}
}
]
List Project DevicesGET/devices/{organisation}/{project}
- organisation
string
(required) Example: lxThe name of the organisation the device belongs to.
- project
string
(required) Example: demoThe name of the project the device belongs to.
Device ¶
Project Device ¶
Headers
Content-Type: application/json
Body
{
"display": "North Paddock",
"deviceId": "a013170112ecc060",
"type": "BlueNode",
"firstContact": "2018-02-13T23:55:58.2375888+00:00",
"lastContact": "2018-09-11T08:23:57.3806751+00:00",
"userMeta": {
"soilTypeOption": 4,
"soilUnitOption": 0,
"hide": false
},
"state": {
"sensorUID": {
"value": 11534588364005884000,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"sensorUIDHex": {
"value": "a013170112ecc060",
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"packetId": {
"value": 901,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"batteryOkay": {
"value": true,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"probeData.serialNumber": {
"value": "S0000202658",
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"probeData.sensorReading.0.temperature_raw": {
"value": 168,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"probeData.sensorReading.1.temperature_raw": {
"value": 164,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"probeData.sensorReading.2.temperature_raw": {
"value": 166,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"sensorVersion_word": {
"value": 16779777,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"baseBlock.loraRSSI_dBm": {
"value": 66,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
},
"nodeTemperature_dC": {
"value": 224,
"timestamp": "2018-09-11T08:23:57.3806751+00:00",
"event": "0000000000fe6c1a"
}
}
}
GET Device DetailGET/devices/{organisation}/{project}/{serial}
- organisation
string
(required) Example: lxThe name of the organisation the device belongs to.
- project
string
(required) Example: demoThe name of the project the device belongs to.
- serial
string
(required) Example: a013170112ecc060The serial number of the device to remove
Update Device MetadataPATCH/devices/{organisation}/{project}/{serial}
- organisation
string
(required) Example: lxThe name of the organisation the device belongs to.
- project
string
(required) Example: demoThe name of the project the device belongs to.
- serial
string
(required) Example: a01317015604fbffThe serial number of the device to remove
Remove DeviceDELETE/devices/{organisation}/{project}/{serial}
- organisation
string
(required) Example: lxThe name of the organisation the device belongs to.
- project
string
(required) Example: demoThe name of the project the device belongs to.
- serial
string
(required) Example: a01317015604fbffThe serial number of the device to remove
Timeseries Data ¶
Device Time Series ¶
Headers
Content-Type: application/json
Body
{
"organisation": "Smart Elements",
"project": "Head Office",
"deviceId": "a01317fe09f7a990",
"rangeStart": "2018-09-11T07:50:02.707+00:00",
"rangeEnd": "2018-09-11T08:50:02.707+00:00",
"series": {
"humidity_pc": [
25,
25,
25,
25,
25,
24
],
"temperature_dC": [
221,
225,
220,
231,
228,
236
],
"vibrationData.isVibrating": [
null,
null,
null,
null,
null,
null
],
"timestamp": [
"2018-09-11T07:55:45.5414039+00:00",
"2018-09-11T08:06:39.3085374+00:00",
"2018-09-11T08:15:49.9205904+00:00",
"2018-09-11T08:26:02.7166261+00:00",
"2018-09-11T08:35:56.8792886+00:00",
"2018-09-11T08:45:38.1750121+00:00"
]
}
}
Time Series DataGET/{organisation}/{project}/{serial}/timeseries{?rangeStart,rangeEnd,fields}
ISO8601 timestamps
📖 The ISO8601 timestamp strings will be assumed to be UTC unless an offset from UTC time is specified e.g. 2018-07-30T16:30+10:00
.
- organisation
string
(required) Example: lxThe name of the organisation the device belongs to.
- project
string
(required) Example: demoThe name of the project the device belongs to.
- serial
string
(required) Example: a0131701757db90The serial number of the device that the data should be loaded for
- rangeStart
ISO8601 string
(required) Example: 2018-09-11T07:50:02The time to begin loading data from. If no time offset is specified then it will be assumed to be UTC.
- rangeEnd
ISO8601 string
(required) Example: 2018-09-11T08:50:02The cut off time for the last data entry to load.
- fields
string
(required) Example: humidity_pc,temperature_dC,vibrationData.isVibratingComma separated list of values to fetch.
Generated by aglio on 11 Sep 2018