Fetch all device data

🚧

Pro API

This API is not a part of the Free plan. To upgrade to Bolt Cloud Pro click here.

Command : fetchData

Description
API to return ALL the data collected by the device.

Pre-requisites

  • The device must be linked to a product.
  • The product must have a valid hardware configuration.

Parameters

  • deviceName: The name of the Bolt device that you want to fetch data.

Example:

https://cloud.boltiot.com/remote/44b2de6b-7e68-40e7-a27f-814b58afe008/fetchData?deviceName=BOLT13819450

Response

{
	"success": 1,
	"data_format": ["time_stamp", "ana0", "dig0", "dig3"],
	"data": [
		["2019-03-20 08:02:53", "244", "1", "0"],
		["2019-03-20 08:04:09", "245", "0", "1"],
		["2019-03-20 08:04:27", "246", "1", "1"]
	]
}

Response explanation:

  • status:
    • 1 - For success
    • 0 - For failure
  • data_format: List describing the hardware configuration names. This is the same name as your hardware configuration. "timestamp" is added by default.
  • data: List which contains the data points. Each entry in the data list is a list that contains the data for the device in the format as given by the data_format field.
    For example,
    data[0][1] in the above example refers to 244 which is the ana0 value.
    data[1][2] in the above example refers to 0 which is the dig0 value.
    * data[2][0] in the above example refers to "2019-03-20 08:04:27" which is the timestamp at which that data point was collected.
Filter Result

You can use the below filter parameters to fetch the specific records.

  1. limit
  2. order

1. limit Limit the number of records in results. The maximum value of this parameter is 100. If the passed value is more than 100 then the fetchdata API will return maximum of 100 records.

Example

https://cloud.boltiot.com/remote/44b2de6b-7e68-40e7-a27f-814b58afe008/fetchData?deviceName=BOLT13819450&limit=2

2. order Organize the results by ascending or descending order of timestamp of data points. The allowed values are 'DESC' or 'ASC' for descending and ascending respectively. If no order parameters is passed then the default value will be ASC.
Using ASC will apply the filtering conditions on the data from the oldest timestamp to latest timestamp. Using DESC will apply the filtering conditions on the data from the latest timestamp to oldest timestamp.

Example

https://cloud.boltiot.com/remote/44b2de6b-7e68-40e7-a27f-814b58afe008/fetchData?deviceName=BOLT13819450&limit=2&order=ASC