DataFire integration for Adafruit IO REST API
npm install @datafire/adafruitClient library for Adafruit IO REST API
bash
npm install --save @datafire/adafruit
`
`js
let adafruit = require('@datafire/adafruit').create({
HeaderKey: "",
HeaderSignature: "",
QueryKey: ""
});.then(data => {
console.log(data);
});
`Description
$3
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:
`js
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):`arduino
/// based on
/// https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino#include
#include
#include
#include
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
$3
Get information about the current user
`js
adafruit.currentUser(null, context)
`#### Input
This action has no parameters
#### Output
* output User
$3
Send data to a feed via webhook URL.
`js
adafruit.createWebhookFeedData({
"payload": {}
}, context)
`#### Input
* input
object
* payload required object
* value string#### Output
* output Data
$3
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.
`js
adafruit.createRawWebhookFeedData(null, context)
`#### Input
This action has no parameters
#### Output
* output Data
$3
Delete all your activities.
`js
adafruit.destroyActivities({
"username": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string#### Output
Output schema unknown
$3
The Activities endpoint returns information about the user's activities.
`js
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.#### Output
* output
array
* items Activity$3
The Activities endpoint returns information about the user's activities.
`js
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.#### Output
* output
array
* items Activity$3
The Dashboards endpoint returns information about the user's dashboards.`js
adafruit.allDashboards({
"username": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string#### Output
* output
array
* items Dashboard$3
Create a new Dashboard
`js
adafruit.createDashboard({
"username": "",
"dashboard": {}
}, context)
`#### Input
* input
object
* username required string: a valid username string
* dashboard required object
* description string
* key string
* name string#### Output
* output Dashboard
$3
The Blocks endpoint returns information about the user's blocks.`js
adafruit.allBlocks({
"username": "",
"dashboard_id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* dashboard_id required string#### Output
* output
array
* items Block$3
Create a new Block
`js
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
* column number
* dashboard_id number
* description string
* key string
* name string
* properties object
* row number
* size_x number
* size_y number
* visual_type string
* dashboard_id required string#### Output
* output Block
$3
Delete an existing Block
`js
adafruit.destroyBlock({
"username": "",
"dashboard_id": "",
"id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* dashboard_id required string
* id required string#### Output
* output
string$3
Returns Block based on ID
`js
adafruit.getBlock({
"username": "",
"dashboard_id": "",
"id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* dashboard_id required string
* id required string#### Output
* output Block
$3
Update properties of an existing Block
`js
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
* column number
* dashboard_id number
* description string
* key string
* name string
* properties object
* row number
* size_x number
* size_y number
* visual_type string#### Output
* output Block
$3
Replace an existing Block
`js
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
* column number
* dashboard_id number
* description string
* key string
* name string
* properties object
* row number
* size_x number
* size_y number
* visual_type string#### Output
* output Block
$3
Delete an existing Dashboard
`js
adafruit.destroyDashboard({
"username": "",
"id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string#### Output
* output
string$3
Returns Dashboard based on ID
`js
adafruit.getDashboard({
"username": "",
"id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string#### Output
* output Dashboard
$3
Update properties of an existing Dashboard
`js
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#### Output
* output Dashboard
$3
Replace an existing Dashboard
`js
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#### Output
* output Dashboard
$3
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.
`js
adafruit.allFeeds({
"username": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string#### Output
* output
array
* items Feed$3
Create a new Feed
`js
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#### Output
* output Feed
$3
Delete an existing Feed
`js
adafruit.destroyFeed({
"username": "",
"feed_key": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* feed_key required string: a valid feed key#### Output
Output schema unknown
$3
Returns feed based on the feed key
`js
adafruit.getFeed({
"username": "",
"feed_key": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* feed_key required string: a valid feed key#### Output
* output Feed
$3
Update properties of an existing Feed
`js
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#### Output
* output Feed
$3
Replace an existing Feed
`js
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#### Output
* output Feed
$3
Get all data for the given feed
`js
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, and created_at. #### Output
* output
array
* items DataResponse$3
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.
`js
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#### Output
* output Data
$3
Create multiple new Data records
`js
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#### Output
* output
array
* items DataResponse$3
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.
`js
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.#### Output
* output
object
* columns array: The names of the columns returned as data.
* items string
* data array: The actual chart data.
* items array
* items string
* feed object
* id integer
* key string
* name string
* parameters object$3
Get the oldest data point in the feed. This request sets the queue pointer to the beginning of the feed.
`js
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, and created_at. #### Output
* output DataResponse
$3
Get the most recent data point in the feed. This request sets the queue pointer to the end of the feed.
`js
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, and created_at. #### Output
* output DataResponse
$3
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.
`js
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, and created_at. #### Output
* output DataResponse
$3
Get the previously processed data point in the feed. NOTE: this method doesn't move the processing queue pointer.
`js
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, and created_at. #### Output
* output DataResponse
$3
Get the most recent data point in the feed in an MQTT compatible CSV format: value,lat,lon,ele
`js
adafruit.retainData({
"username": "",
"feed_key": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* feed_key required string: a valid feed key#### Output
* output
string$3
Delete existing Data
`js
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#### Output
* output
string$3
Returns data based on feed key
`js
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, and created_at. #### Output
* output DataResponse
$3
Update properties of existing Data
`js
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#### Output
* output DataResponse
$3
Replace existing Data
`js
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#### Output
* output DataResponse
$3
Returns more detailed feed record based on the feed key
`js
adafruit.getFeedDetails({
"username": "",
"feed_key": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* feed_key required string: a valid feed key#### Output
* output Feed
$3
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.`js
adafruit.allGroups({
"username": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string#### Output
* output
array
* items Group$3
Create a new Group
`js
adafruit.createGroup({
"username": "",
"group": {}
}, context)
`#### Input
* input
object
* username required string: a valid username string
* group required object
* description string
* key string
* name string#### Output
* output Group
$3
Delete an existing Group
`js
adafruit.destroyGroup({
"username": "",
"group_key": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* group_key required string#### Output
* output
string$3
Returns Group based on ID
`js
adafruit.getGroup({
"username": "",
"group_key": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* group_key required string#### Output
* output Group
$3
Update properties of an existing Group
`js
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#### Output
* output Group
$3
Replace an existing Group
`js
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#### Output
* output Group
$3
Add an existing Feed to a Group
`js
adafruit.addFeedToGroup({
"group_key": "",
"username": ""
}, context)
`#### Input
* input
object
* group_key required string
* username required string: a valid username string
* feed_key string#### Output
* output Group
$3
Create new data for multiple feeds in a group
`js
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 with key and value properties.
* items object
* key required string
* value required string
* location object: A location record with lat, lon, and [optional] ele properties.
* ele number
* lat required number
* lon required number#### Output
* output
array
* items DataResponse$3
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.
`js
adafruit.allGroupFeeds({
"group_key": "",
"username": ""
}, context)
`#### Input
* input
object
* group_key required string
* username required string: a valid username string#### Output
* output
array
* items Feed$3
Create a new Feed in a Group
`js
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#### Output
* output Feed
$3
All data for current feed in a specific group
`js
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.#### Output
* output
array
* items DataResponse$3
Create new Data in a feed belonging to a particular group
`js
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#### Output
* output DataResponse
$3
Create multiple new Data records in a feed belonging to a particular group
`js
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#### Output
* output
array
* items DataResponse$3
Remove a Feed from a Group
`js
adafruit.removeFeedFromGroup({
"group_key": "",
"username": ""
}, context)
`#### Input
* input
object
* group_key required string
* username required string: a valid username string
* feed_key string#### Output
* output Group
$3
Get the user's data rate limit and current activity level.
`js
adafruit.getCurrentUserThrottle({
"username": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string#### 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).$3
The Tokens endpoint returns information about the user's tokens.`js
adafruit.allTokens({
"username": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string#### Output
* output
array
* items Token$3
Create a new Token
`js
adafruit.createToken({
"username": "",
"token": {}
}, context)
`#### Input
* input
object
* username required string: a valid username string
* token required object
* token string#### Output
* output Token
$3
Delete an existing Token
`js
adafruit.destroyToken({
"username": "",
"id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string#### Output
* output
string$3
Returns Token based on ID
`js
adafruit.getToken({
"username": "",
"id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string#### Output
* output Token
$3
Update properties of an existing Token
`js
adafruit.updateToken({
"username": "",
"id": "",
"token": {}
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string
* token required object
* token string#### Output
* output Token
$3
Replace an existing Token
`js
adafruit.replaceToken({
"username": "",
"id": "",
"token": {}
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string
* token required object
* token string#### Output
* output Token
$3
The Triggers endpoint returns information about the user's triggers.`js
adafruit.allTriggers({
"username": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string#### Output
* output
array
* items Trigger$3
Create a new Trigger
`js
adafruit.createTrigger({
"username": "",
"trigger": {}
}, context)
`#### Input
* input
object
* username required string: a valid username string
* trigger required object
* name string#### Output
* output Trigger
$3
Delete an existing Trigger
`js
adafruit.destroyTrigger({
"username": "",
"id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string#### Output
* output
string$3
Returns Trigger based on ID
`js
adafruit.getTrigger({
"username": "",
"id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string#### Output
* output Trigger
$3
Update properties of an existing Trigger
`js
adafruit.updateTrigger({
"username": "",
"id": "",
"trigger": {}
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string
* trigger required object
* name string#### Output
* output Trigger
$3
Replace an existing Trigger
`js
adafruit.replaceTrigger({
"username": "",
"id": "",
"trigger": {}
}, context)
`#### Input
* input
object
* username required string: a valid username string
* id required string
* trigger required object
* name string#### Output
* output Trigger
$3
The Permissions endpoint returns information about the user's permissions.`js
adafruit.allPermissions({
"username": "",
"type": "",
"type_id": ""
}, context)
`#### Input
* input
object
* username required string: a valid username string
* type required string
* type_id required string#### Output
* output
array
* items Permission$3
Create a new Permission
`js
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#### Output
* output Permission
$3
Delete an existing Permission
`js
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#### Output
* output
string$3
Returns Permission based on ID
`js
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#### Output
* output Permission
$3
Update properties of an existing Permission
`js
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#### Output
* output Permission
$3
Replace an existing Permission
`js
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#### Output
* output Permission
Definitions
$3
* Activity object
* action string
* created_at string
* data object
* id number
* model string
* updated_at string
* user_id number$3
* 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$3
* BlockFeed object
* feed Feed
* group Group
* id string$3
* Dashboard object
* blocks array
* items Block
* description string
* key string
* name string$3
* 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$3
* 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$3
* Error object
* code string
* message string$3
* 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
* shared_with array: Access control list for this feed
* items object
* 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)$3
* Group object
* created_at string
* description string
* feeds array
* items Feed
* id number
* name string
* updated_at string$3
* 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$3
* ShallowGroup object
* created_at string
* description string
* id number
* name string
* updated_at string$3
* Token object
* token string$3
* Trigger object
* name string$3
* User object
* color string
* created_at string
* id number
* name string
* time_zone string
* updated_at string
* username string`