Get Channel Feeds September 29, 2017

Overview

The Get Channel Feeds API is used to read the data feed from all the sensor fields in a channel. This method can return either a JSON or CSV object.

API URL

To return a JSON object:

https://api.ubibot.io/channels/CHANNEL_ID/feeds.json?parameters

To return a CSV file:

http://api.ubibot.cn/channels/CHANNEL_ID/feeds.csv?parameters

Where CHANNEL_ID is the ID of the target channel.

HTTP Method

GET

URL Parameters

Name Type Required Description
api_key or token_id String Required for private channels Specify the API write key or read key of the channel, or token_id obtained after the user logged in.
results Integer Optional Number of entries to retrieve. The maximum number is 8,000
start Datetime Optional Start date in format YYYY-MM-DD%20HH:NN:SS.
end Datetime Optional End date in format YYYY-MM-DD%20HH:NN:SS.
status Boolean Optional Include status updates in the feed by setting “status=true”.
metadata Boolean Optional Include metadata for a channel by setting “metadata=true”.
timezone String Optional Identifier from Time Zones Reference for this request.
min Decimal Optional Minimum value to include in response.
max Decimal Optional Maximum value to include in response.
sum String Optional Get sum of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, “daily”.
average String Optional Get average of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, “daily”.
round Integer Optional Round to this many decimal places.
callback String Optional Function name to be used for JSONP cross-domain requests.

 Response

200 Success. Body contains a JSON object with the feeds data in the requested format.  If is_truncated is presented in the response JSON and value is true, it means the result has been truncated because of the maximum number of entries for retrieving has been reached. You can change the start and end value to shrink the range.

Error: See the list of error codes for details.

Examples

GET https://api.ubibot.io/channels/123/feeds?api_key=4bf72312d2d14038aedee7985846e65f

The response is a JSON object containing a list of channels, for example: