@datafire/adafruit
v5.0.0
Published
DataFire integration for Adafruit IO REST API
Downloads
8
Readme
@datafire/adafruit
Client library for Adafruit IO REST API
Installation and Usage
npm install --save @datafire/adafruit
let adafruit = require('@datafire/adafruit').create({
HeaderKey: "",
HeaderSignature: "",
QueryKey: ""
});
.then(data => {
console.log(data);
});
Description
The Internet of Things for Everyone
The Adafruit IO HTTP API provides access to your Adafruit IO data from any programming language or hardware environment that can speak HTTP. The easiest way to get started is with an Adafruit IO learn guide and a simple Internet of Things capable device like the Feather Huzzah.
This API documentation is hosted on GitHub Pages and is available at https://github.com/adafruit/io-api. For questions or comments visit the Adafruit IO Forums or the adafruit-io channel on the Adafruit Discord server.
Authentication
Authentication for every API request happens through the X-AIO-Key
header or query parameter and your IO API key. A simple cURL request to get all available feeds for a user with the username "io_username" and the key "io_key_12345" could look like this:
$ curl -H "X-AIO-Key: io_key_12345" https://io.adafruit.com/api/v2/io_username/feeds
Or like this:
$ curl "https://io.adafruit.com/api/v2/io_username/feeds?X-AIO-Key=io_key_12345
Using the node.js request library, IO HTTP requests are as easy as:
var request = require('request');
var options = {
url: 'https://io.adafruit.com/api/v2/io_username/feeds',
headers: {
'X-AIO-Key': 'io_key_12345',
'Content-Type': 'application/json'
}
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
var feeds = JSON.parse(body);
console.log(feeds.length + " FEEDS AVAILABLE");
feeds.forEach(function (feed) {
console.log(feed.name, feed.key);
})
}
}
request(options, callback);
Using the ESP8266 Arduino HTTPClient library, an HTTPS GET request would look like this (replacing ---
with your own values in the appropriate locations):
/// based on
/// https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
ESP8266WiFiMulti WiFiMulti;
const char* ssid = "---";
const char* password = "---";
const char* host = "io.adafruit.com";
const char* io_key = "---";
const char* path_with_username = "/api/v2/---/dashboards";
// Use web browser to view and copy
// SHA1 fingerprint of the certificate
const char* fingerprint = "77 00 54 2D DA E7 D8 03 27 31 23 99 EB 27 DB CB A5 4C 57 18";
void setup() {
Serial.begin(115200);
for(uint8_t t = 4; t > 0; t--) {
Serial.printf("[SETUP] WAIT %d...\n", t);
Serial.flush();
delay(1000);
}
WiFi.mode(WIFI_STA);
WiFiMulti.addAP(ssid, password);
// wait for WiFi connection
while(WiFiMulti.run() != WL_CONNECTED) {
Serial.print('.');
delay(1000);
}
Serial.println("[WIFI] connected!");
HTTPClient http;
// start request with URL and TLS cert fingerprint for verification
http.begin("https://" + String(host) + String(path_with_username), fingerprint);
// IO API authentication
http.addHeader("X-AIO-Key", io_key);
// start connection and send HTTP header
int httpCode = http.GET();
// httpCode will be negative on error
if(httpCode > 0) {
// HTTP header has been send and Server response header has been handled
Serial.printf("[HTTP] GET response: %d\n", httpCode);
// HTTP 200 OK
if(httpCode == HTTP_CODE_OK) {
String payload = http.getString();
Serial.println(payload);
}
http.end();
}
}
void loop() {}
Client Libraries
We have client libraries to help you get started with your project: Python, Ruby, Arduino C++, Javascript, and Go are available. They're all open source, so if they don't already do what you want, you can fork and add any feature you'd like.
Actions
currentUser
Get information about the current user
adafruit.currentUser(null, context)
Input
This action has no parameters
Output
- output User
createWebhookFeedData
Send data to a feed via webhook URL.
adafruit.createWebhookFeedData({
"payload": {}
}, context)
Input
- input
object
- payload required
object
- value
string
- value
- payload required
Output
- output Data
createRawWebhookFeedData
The raw data webhook receiver accepts POST requests and stores the raw request body on your feed. This is useful when you don't have control of the webhook sender. If feed history is turned on, payloads will be truncated at 1024 bytes. If feed history is turned off, payloads will be truncated at 100KB.
adafruit.createRawWebhookFeedData(null, context)
Input
This action has no parameters
Output
- output Data
destroyActivities
Delete all your activities.
adafruit.destroyActivities({
"username": ""
}, context)
Input
- input
object
- username required
string
: a valid username string
- username required
Output
Output schema unknown
allActivities
The Activities endpoint returns information about the user's activities.
adafruit.allActivities({
"username": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - start_time
string
: Start time for filtering, returns records created after given time. - end_time
string
: End time for filtering, returns records created before give time. - limit
integer
: Limit the number of records returned.
- username required
Output
- output
array
- items Activity
getActivity
The Activities endpoint returns information about the user's activities.
adafruit.getActivity({
"username": "",
"type": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - type required
string
- start_time
string
: Start time for filtering, returns records created after given time. - end_time
string
: End time for filtering, returns records created before give time. - limit
integer
: Limit the number of records returned.
- username required
Output
- output
array
- items Activity
allDashboards
The Dashboards endpoint returns information about the user's dashboards.
adafruit.allDashboards({
"username": ""
}, context)
Input
- input
object
- username required
string
: a valid username string
- username required
Output
- output
array
- items Dashboard
createDashboard
Create a new Dashboard
adafruit.createDashboard({
"username": "",
"dashboard": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - dashboard required
object
- description
string
- key
string
- name
string
- description
- username required
Output
- output Dashboard
allBlocks
The Blocks endpoint returns information about the user's blocks.
adafruit.allBlocks({
"username": "",
"dashboard_id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - dashboard_id required
string
- username required
Output
- output
array
- items Block
createBlock
Create a new Block
adafruit.createBlock({
"username": "",
"block": {},
"dashboard_id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - block required
object
- block_feeds
array
- items
object
- feed_id
string
- group_id
string
- feed_id
- items
- column
number
- dashboard_id
number
- description
string
- key
string
- name
string
- properties
object
- row
number
- size_x
number
- size_y
number
- visual_type
string
- block_feeds
- dashboard_id required
string
- username required
Output
- output Block
destroyBlock
Delete an existing Block
adafruit.destroyBlock({
"username": "",
"dashboard_id": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - dashboard_id required
string
- id required
string
- username required
Output
- output
string
getBlock
Returns Block based on ID
adafruit.getBlock({
"username": "",
"dashboard_id": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - dashboard_id required
string
- id required
string
- username required
Output
- output Block
updateBlock
Update properties of an existing Block
adafruit.updateBlock({
"username": "",
"dashboard_id": "",
"id": "",
"block": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - dashboard_id required
string
- id required
string
- block required
object
- block_feeds
array
- items
object
- feed_id
string
- group_id
string
- feed_id
- items
- column
number
- dashboard_id
number
- description
string
- key
string
- name
string
- properties
object
- row
number
- size_x
number
- size_y
number
- visual_type
string
- block_feeds
- username required
Output
- output Block
replaceBlock
Replace an existing Block
adafruit.replaceBlock({
"username": "",
"dashboard_id": "",
"id": "",
"block": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - dashboard_id required
string
- id required
string
- block required
object
- block_feeds
array
- items
object
- feed_id
string
- group_id
string
- feed_id
- items
- column
number
- dashboard_id
number
- description
string
- key
string
- name
string
- properties
object
- row
number
- size_x
number
- size_y
number
- visual_type
string
- block_feeds
- username required
Output
- output Block
destroyDashboard
Delete an existing Dashboard
adafruit.destroyDashboard({
"username": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- username required
Output
- output
string
getDashboard
Returns Dashboard based on ID
adafruit.getDashboard({
"username": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- username required
Output
- output Dashboard
updateDashboard
Update properties of an existing Dashboard
adafruit.updateDashboard({
"username": "",
"id": "",
"dashboard": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- dashboard required
object
- description
string
- key
string
- name
string
- description
- username required
Output
- output Dashboard
replaceDashboard
Replace an existing Dashboard
adafruit.replaceDashboard({
"username": "",
"id": "",
"dashboard": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- dashboard required
object
- description
string
- key
string
- name
string
- description
- username required
Output
- output Dashboard
allFeeds
The Feeds endpoint returns information about the user's feeds. The response includes the latest value of each feed, and other metadata about each feed.
adafruit.allFeeds({
"username": ""
}, context)
Input
- input
object
- username required
string
: a valid username string
- username required
Output
- output
array
- items Feed
createFeed
Create a new Feed
adafruit.createFeed({
"username": "",
"feed": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key
string
- feed required
object
- description
string
- key
string
- license
string
- name
string
- description
- username required
Output
- output Feed
destroyFeed
Delete an existing Feed
adafruit.destroyFeed({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key
- username required
Output
Output schema unknown
getFeed
Returns feed based on the feed key
adafruit.getFeed({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key
- username required
Output
- output Feed
updateFeed
Update properties of an existing Feed
adafruit.updateFeed({
"username": "",
"feed_key": "",
"feed": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - feed required
object
- description
string
- key
string
- license
string
- name
string
- description
- username required
Output
- output Feed
replaceFeed
Replace an existing Feed
adafruit.replaceFeed({
"username": "",
"feed_key": "",
"feed": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - feed required
object
- description
string
- key
string
- license
string
- name
string
- description
- username required
Output
- output Feed
allData
Get all data for the given feed
adafruit.allData({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - start_time
string
: Start time for filtering, returns records created after given time. - end_time
string
: End time for filtering, returns records created before give time. - limit
integer
: Limit the number of records returned. - include
string
: List of Data record fields to include in response as comma separated list. Acceptable values are:value
,lat
,lon
,ele
,id
, andcreated_at
.
- username required
Output
- output
array
- items DataResponse
createData
Create new data records on the given feed.
NOTE: when feed history is on, data value
size is limited to 1KB, when feed history is turned off data value size is limited to 100KB.
adafruit.createData({
"username": "",
"feed_key": "",
"datum": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - datum required
object
- created_at
string
- ele
string
- epoch
number
- lat
string
- lon
string
- value
string
- created_at
- username required
Output
- output Data
batchCreateData
Create multiple new Data records
adafruit.batchCreateData({
"username": "",
"feed_key": "",
"data": []
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - data required
array
- items
object
- created_at
string
- ele
string
- epoch
number
- lat
string
- lon
string
- value
string
- created_at
- items
- username required
Output
- output
array
- items DataResponse
chartData
The Chart API is what we use on io.adafruit.com to populate charts over varying timespans with a consistent number of data points. The maximum number of points returned is 480. This API works by aggregating slices of time into a single value by averaging.
All time-based parameters are optional, if none are given it will default to 1 hour at the finest-grained resolution possible.
adafruit.chartData({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - start_time
string
: Start time for filtering, returns records created after given time. - end_time
string
: End time for filtering, returns records created before give time. - resolution
integer
: A resolution size in minutes. By giving a resolution value you will get back grouped data points aggregated over resolution-sized intervals. NOTE: time span is preferred over resolution, so if you request a span of time that includes more than max limit points you may get a larger resolution than you requested. Valid resolutions are 1, 5, 10, 30, 60, and 120. - hours
integer
: The number of hours the chart should cover.
- username required
Output
- output
object
- columns
array
: The names of the columns returned as data.- items
string
- items
- data
array
: The actual chart data.- items
array
- items
string
- items
- items
- feed
object
- id
integer
- key
string
- name
string
- id
- parameters
object
- columns
firstData
Get the oldest data point in the feed. This request sets the queue pointer to the beginning of the feed.
adafruit.firstData({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - include
string
: List of Data record fields to include in response as comma separated list. Acceptable values are:value
,lat
,lon
,ele
,id
, andcreated_at
.
- username required
Output
- output DataResponse
lastData
Get the most recent data point in the feed. This request sets the queue pointer to the end of the feed.
adafruit.lastData({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - include
string
: List of Data record fields to include in response as comma separated list. Acceptable values are:value
,lat
,lon
,ele
,id
, andcreated_at
.
- username required
Output
- output DataResponse
nextData
Get the next newest data point in the feed. If queue processing hasn't been started, the first data point in the feed will be returned.
adafruit.nextData({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - include
string
: List of Data record fields to include in response as comma separated list. Acceptable values are:value
,lat
,lon
,ele
,id
, andcreated_at
.
- username required
Output
- output DataResponse
previousData
Get the previously processed data point in the feed. NOTE: this method doesn't move the processing queue pointer.
adafruit.previousData({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - include
string
: List of Data record fields to include in response as comma separated list. Acceptable values are:value
,lat
,lon
,ele
,id
, andcreated_at
.
- username required
Output
- output DataResponse
retainData
Get the most recent data point in the feed in an MQTT compatible CSV format: value,lat,lon,ele
adafruit.retainData({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key
- username required
Output
- output
string
destroyData
Delete existing Data
adafruit.destroyData({
"username": "",
"feed_key": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - id required
string
- username required
Output
- output
string
getData
Returns data based on feed key
adafruit.getData({
"username": "",
"feed_key": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - id required
string
- include
string
: List of Data record fields to include in response as comma separated list. Acceptable values are:value
,lat
,lon
,ele
,id
, andcreated_at
.
- username required
Output
- output DataResponse
updateData
Update properties of existing Data
adafruit.updateData({
"username": "",
"feed_key": "",
"id": "",
"datum": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - id required
string
- datum required
object
- created_at
string
- ele
string
- epoch
number
- lat
string
- lon
string
- value
string
- created_at
- username required
Output
- output DataResponse
replaceData
Replace existing Data
adafruit.replaceData({
"username": "",
"feed_key": "",
"id": "",
"datum": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key - id required
string
- datum required
object
- created_at
string
- ele
string
- epoch
number
- lat
string
- lon
string
- value
string
- created_at
- username required
Output
- output DataResponse
getFeedDetails
Returns more detailed feed record based on the feed key
adafruit.getFeedDetails({
"username": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - feed_key required
string
: a valid feed key
- username required
Output
- output Feed
allGroups
The Groups endpoint returns information about the user's groups. The response includes the latest value of each feed in the group, and other metadata about the group.
adafruit.allGroups({
"username": ""
}, context)
Input
- input
object
- username required
string
: a valid username string
- username required
Output
- output
array
- items Group
createGroup
Create a new Group
adafruit.createGroup({
"username": "",
"group": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - group required
object
- description
string
- key
string
- name
string
- description
- username required
Output
- output Group
destroyGroup
Delete an existing Group
adafruit.destroyGroup({
"username": "",
"group_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- username required
Output
- output
string
getGroup
Returns Group based on ID
adafruit.getGroup({
"username": "",
"group_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- username required
Output
- output Group
updateGroup
Update properties of an existing Group
adafruit.updateGroup({
"username": "",
"group_key": "",
"group": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- group required
object
- description
string
- key
string
- name
string
- description
- username required
Output
- output Group
replaceGroup
Replace an existing Group
adafruit.replaceGroup({
"username": "",
"group_key": "",
"group": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- group required
object
- description
string
- key
string
- name
string
- description
- username required
Output
- output Group
addFeedToGroup
Add an existing Feed to a Group
adafruit.addFeedToGroup({
"group_key": "",
"username": ""
}, context)
Input
- input
object
- group_key required
string
- username required
string
: a valid username string - feed_key
string
- group_key required
Output
- output Group
createGroupData
Create new data for multiple feeds in a group
adafruit.createGroupData({
"username": "",
"group_key": "",
"group_feed_data": {
"feeds": []
}
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- group_feed_data required
object
- created_at
string
: Optional created_at timestamp which will be applied to all feed values created. - feeds required
array
: An array of feed data records withkey
andvalue
properties.- items
object
- key required
string
- value required
string
- key required
- items
- location
object
: A location record withlat
,lon
, and [optional]ele
properties.- ele
number
- lat required
number
- lon required
number
- ele
- created_at
- username required
Output
- output
array
- items DataResponse
allGroupFeeds
The Group Feeds endpoint returns information about the user's feeds. The response includes the latest value of each feed, and other metadata about each feed, but only for feeds within the given group.
adafruit.allGroupFeeds({
"group_key": "",
"username": ""
}, context)
Input
- input
object
- group_key required
string
- username required
string
: a valid username string
- group_key required
Output
- output
array
- items Feed
createGroupFeed
Create a new Feed in a Group
adafruit.createGroupFeed({
"username": "",
"group_key": "",
"feed": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- feed required
object
- description
string
- key
string
- license
string
- name
string
- description
- username required
Output
- output Feed
allGroupFeedData
All data for current feed in a specific group
adafruit.allGroupFeedData({
"username": "",
"group_key": "",
"feed_key": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- feed_key required
string
: a valid feed key - start_time
string
: Start time for filtering data. Returns data created after given time. - end_time
string
: End time for filtering data. Returns data created before give time. - limit
integer
: Limit the number of records returned.
- username required
Output
- output
array
- items DataResponse
createGroupFeedData
Create new Data in a feed belonging to a particular group
adafruit.createGroupFeedData({
"username": "",
"group_key": "",
"feed_key": "",
"datum": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- feed_key required
string
: a valid feed key - datum required
object
- created_at
string
- ele
string
- epoch
number
- lat
string
- lon
string
- value
string
- created_at
- username required
Output
- output DataResponse
batchCreateGroupFeedData
Create multiple new Data records in a feed belonging to a particular group
adafruit.batchCreateGroupFeedData({
"username": "",
"group_key": "",
"feed_key": "",
"data": []
}, context)
Input
- input
object
- username required
string
: a valid username string - group_key required
string
- feed_key required
string
: a valid feed key - data required
array
- items
object
- created_at
string
- ele
string
- epoch
number
- lat
string
- lon
string
- value
string
- created_at
- items
- username required
Output
- output
array
- items DataResponse
removeFeedFromGroup
Remove a Feed from a Group
adafruit.removeFeedFromGroup({
"group_key": "",
"username": ""
}, context)
Input
- input
object
- group_key required
string
- username required
string
: a valid username string - feed_key
string
- group_key required
Output
- output Group
getCurrentUserThrottle
Get the user's data rate limit and current activity level.
adafruit.getCurrentUserThrottle({
"username": ""
}, context)
Input
- input
object
- username required
string
: a valid username string
- username required
Output
- output
object
- active_data_rate
integer
: Actions taken inside the time window. - data_rate_limit
integer
: Max possible actions inside the time window (usually 1 minute).
- active_data_rate
allTokens
The Tokens endpoint returns information about the user's tokens.
adafruit.allTokens({
"username": ""
}, context)
Input
- input
object
- username required
string
: a valid username string
- username required
Output
- output
array
- items Token
createToken
Create a new Token
adafruit.createToken({
"username": "",
"token": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - token required
object
- token
string
- token
- username required
Output
- output Token
destroyToken
Delete an existing Token
adafruit.destroyToken({
"username": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- username required
Output
- output
string
getToken
Returns Token based on ID
adafruit.getToken({
"username": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- username required
Output
- output Token
updateToken
Update properties of an existing Token
adafruit.updateToken({
"username": "",
"id": "",
"token": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- token required
object
- token
string
- token
- username required
Output
- output Token
replaceToken
Replace an existing Token
adafruit.replaceToken({
"username": "",
"id": "",
"token": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- token required
object
- token
string
- token
- username required
Output
- output Token
allTriggers
The Triggers endpoint returns information about the user's triggers.
adafruit.allTriggers({
"username": ""
}, context)
Input
- input
object
- username required
string
: a valid username string
- username required
Output
- output
array
- items Trigger
createTrigger
Create a new Trigger
adafruit.createTrigger({
"username": "",
"trigger": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - trigger required
object
- name
string
- name
- username required
Output
- output Trigger
destroyTrigger
Delete an existing Trigger
adafruit.destroyTrigger({
"username": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- username required
Output
- output
string
getTrigger
Returns Trigger based on ID
adafruit.getTrigger({
"username": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- username required
Output
- output Trigger
updateTrigger
Update properties of an existing Trigger
adafruit.updateTrigger({
"username": "",
"id": "",
"trigger": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- trigger required
object
- name
string
- name
- username required
Output
- output Trigger
replaceTrigger
Replace an existing Trigger
adafruit.replaceTrigger({
"username": "",
"id": "",
"trigger": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - id required
string
- trigger required
object
- name
string
- name
- username required
Output
- output Trigger
allPermissions
The Permissions endpoint returns information about the user's permissions.
adafruit.allPermissions({
"username": "",
"type": "",
"type_id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - type required
string
- type_id required
string
- username required
Output
- output
array
- items Permission
createPermission
Create a new Permission
adafruit.createPermission({
"username": "",
"type": "",
"type_id": "",
"permission": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - type required
string
- type_id required
string
- permission required
object
- mode
string
(values: r, w, rw) - scope
string
(values: secret, public, user, organization) - scope_value
string
- mode
- username required
Output
- output Permission
destroyPermission
Delete an existing Permission
adafruit.destroyPermission({
"username": "",
"type": "",
"type_id": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - type required
string
- type_id required
string
- id required
string
- username required
Output
- output
string
getPermission
Returns Permission based on ID
adafruit.getPermission({
"username": "",
"type": "",
"type_id": "",
"id": ""
}, context)
Input
- input
object
- username required
string
: a valid username string - type required
string
- type_id required
string
- id required
string
- username required
Output
- output Permission
updatePermission
Update properties of an existing Permission
adafruit.updatePermission({
"username": "",
"type": "",
"type_id": "",
"id": "",
"permission": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - type required
string
- type_id required
string
- id required
string
- permission required
object
- mode
string
(values: r, w, rw) - scope
string
(values: secret, public, user, organization) - scope_value
string
- mode
- username required
Output
- output Permission
replacePermission
Replace an existing Permission
adafruit.replacePermission({
"username": "",
"type": "",
"type_id": "",
"id": "",
"permission": {}
}, context)
Input
- input
object
- username required
string
: a valid username string - type required
string
- type_id required
string
- id required
string
- permission required
object
- mode
string
(values: r, w, rw) - scope
string
(values: secret, public, user, organization) - scope_value
string
- mode
- username required
Output
- output Permission
Definitions
Activity
- Activity
object
- action
string
- created_at
string
- data
object
- id
number
- model
string
- updated_at
string
- user_id
number
- action
Block
- Block
object
- block_feeds
array
- items BlockFeed
- column
number
- description
string
- key
string
- name
string
- row
number
- size_x
number
- size_y
number
- visual_type
string
- block_feeds
BlockFeed
Dashboard
- Dashboard
object
- blocks
array
- items Block
- description
string
- key
string
- name
string
- blocks
Data
- Data
object
- completed_at
string
- created_at
string
- created_epoch
number
- ele
number
- expiration
string
- feed_id
number
- group_id
number
- id
string
- lat
number
- lon
number
- updated_at
string
- value
string
- completed_at
DataResponse
- DataResponse
object
- completed_at
string
- created_at
string
- created_epoch
number
- ele
number
- expiration
string
- feed_id
number
- group_id
number
- id
string
- lat
number
- lon
number
- updated_at
string
- value
string
- completed_at
Error
- Error
object
- code
string
- message
string
- code
Feed
- Feed
object
- created_at
string
- description
string
- details
object
: Additional details about this feed.- data
object
- count
integer
: Number of data points stored by this feed. - first
object
- last
object
- count
- shared_with
array
: Access control list for this feed- items
object
- items
- data
- enabled
boolean
- group
object
- groups
array
- items ShallowGroup
- history
boolean
- id
number
- key
string
- last_value
string
- license
string
- name
string
- status
string
- status_notify
boolean
: Is status notification active? - status_timeout
integer
: Status notification timeout in minutes. - unit_symbol
string
- unit_type
string
- updated_at
string
- visibility
string
(values: private, public)
- created_at
Group
- Group
object
- created_at
string
- description
string
- feeds
array
- items Feed
- id
number
- name
string
- updated_at
string
- created_at
Permission
- Permission
object
- created_at
string
- id
number
- model
string
(values: feed, group, dashboard) - object_id
number
- scope
string
(values: secret, public, user, organization) - scope_value
string
- updated_at
string
- user_id
number
- created_at
ShallowGroup
- ShallowGroup
object
- created_at
string
- description
string
- id
number
- name
string
- updated_at
string
- created_at
Token
- Token
object
- token
string
- token
Trigger
- Trigger
object
- name
string
- name
User
- User
object
- color
string
- created_at
string
- id
number
- name
string
- time_zone
string
- updated_at
string
- username
string
- color