├── .gitignore ├── LICENSE ├── README.md ├── adafruit-flower-left.png ├── bin └── export.rb ├── examples ├── curl │ └── createData.sh └── javascript │ └── allFeeds.js ├── images ├── Swagger_explorer.png ├── Swagger_explorer_min.png ├── adafruit-flower-left-white.png ├── explorer_icons.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── io_logo.png ├── logo.png ├── logo_small.png ├── pet_store_api.png ├── swagger-file-menu.png ├── swagger-generate-client-menu.png ├── throbber.gif └── wordnik_api.png ├── index.html ├── io_logo.png ├── package.json ├── v1.json ├── v2-description.md ├── v2.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swo 3 | *.swp 4 | node_modules/ 5 | npm-debug.log 6 | yarn-error.log 7 | export/ 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2018 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Adafruit IO API Documentation 2 | 3 | The HTTP REST API documentation for [Adafruit IO](https://io.adafruit.com) written using [Swagger v2](http://swagger.io). 4 | 5 | 6 | ## Generating Client Libraries With Swagger 7 | 8 | While we provide custom API clients in several languages (Javascript, Python, Ruby, Go), there are just too many languages for us to support everything. The good news is that Swagger can generate clients based on our [existing API documentation](https://io.adafruit.com/api/docs/). 9 | 10 | The easiest way to generate a client in a new language ([supported languages listed here](https://github.com/swagger-api/swagger-codegen#api-clients)) is to open up our documentation in the Swagger Editor at http://editor.swagger.io. Use `File` -> `Import URL...` to load the Adafruit IO API specification. 11 | 12 | ![Swagger file menu](https://github.com/adafruit/io-api/blob/gh-pages/images/swagger-file-menu.png) 13 | 14 | The URL to use for the current API is `https://io.adafruit.com/api/docs/v2.json`. 15 | 16 | Next, select the language you'd like to generate a library for, and download the resulting .zip file. 17 | 18 | ![Swagger generate client menu](https://github.com/adafruit/io-api/blob/gh-pages/images/swagger-generate-client-menu.png) 19 | 20 | Unfortunately, we can't provide support for specific, auto-generated clients, but we're always available to provide general support for our API. Please get in touch [on the Forum](https://forums.adafruit.com/viewforum.php?f=56) if you have any questions. 21 | 22 | 23 | ## License 24 | 25 | Copyright (c) 2015 [Adafruit Industries](https://adafruit.com). Licensed under the [MIT license](/LICENSE?raw=true). 26 | 27 | [Adafruit](https://adafruit.com) invests time and resources providing this open source code. Please support Adafruit and open-source hardware by purchasing products from [Adafruit](https://adafruit.com). 28 | -------------------------------------------------------------------------------- /adafruit-flower-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/adafruit-flower-left.png -------------------------------------------------------------------------------- /bin/export.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | require 'erb' 3 | require 'fileutils' 4 | 5 | content = open('v2.json').read() 6 | 7 | DOCS = JSON.parse(content) 8 | REF = { 9 | 'parameters' => DOCS['parameters'], 10 | 'definitions' => DOCS['definitions'] 11 | } 12 | REFERENCE_MATCHER = /#\/([a-z]+)\/(.+)/ 13 | 14 | template = DATA.read 15 | docs = ERB.new(template) 16 | 17 | def template_data(method, path, section) 18 | summary = section['summary'] 19 | description = section['description'] 20 | 21 | _response = section['responses']['200'] 22 | 23 | if _response['schema'] 24 | if ref = _response['schema']['$ref'] 25 | _, ref_type, label = REFERENCE_MATCHER.match(ref).to_a 26 | resp_content = REF[ref_type][label] 27 | response = JSON.pretty_generate(resp_content) 28 | else 29 | response = JSON.pretty_generate(_response['schema']) 30 | end 31 | else 32 | response = nil 33 | end 34 | 35 | response_description = _response['description'] 36 | parameters = { "path" => [], "query" => [], "body" => [] } 37 | 38 | if section['parameters'] 39 | section['parameters'].each do |param| 40 | if ref = param['$ref'] 41 | _, ref_type, label = REFERENCE_MATCHER.match(ref).to_a 42 | param = REF[ref_type][label] 43 | 44 | parameters[param['in']] << { 45 | parameter: param['name'], 46 | type: param['type'] || (param['schema']['type']), 47 | required: !!param['required'], 48 | description: param['description'], 49 | } 50 | end 51 | end 52 | end 53 | request = "#{method.upcase} #{path}" 54 | 55 | # puts "-" * 90 56 | # puts "REQUEST: #{request}" 57 | # puts "SUMMARY: #{summary}" 58 | # puts "DESCRIPTION: #{description}" 59 | # puts "RESPONSE: #{response}" 60 | # puts "PARAMETERS: #{parameters}" 61 | 62 | [ binding, section['tags'][0] ] 63 | end 64 | 65 | tags = {} 66 | 67 | DOCS['paths'].keys.each do |path| 68 | url_section = DOCS['paths'][path] 69 | 70 | %w(get post put delete).each do |method| 71 | if url_section[method] 72 | template_binding, tag = template_data(method, path, url_section[method]) 73 | filename = "export/_#{ tag.downcase }.md.erb" 74 | 75 | if tags[tag].nil? 76 | puts "=== #{filename}" 77 | FileUtils.touch(filename) 78 | open(filename, 'w') do |f| 79 | f.puts "# #{ tag }" 80 | end 81 | tags[tag] = true 82 | end 83 | 84 | puts "--- #{ tag } #{ method } #{ path } > #{ filename } ---" 85 | out = docs.result(template_binding) 86 | 87 | open(filename, 'a') do |f| 88 | f.puts "" 89 | f.puts out 90 | f.puts "" 91 | end 92 | end 93 | end 94 | end 95 | 96 | __END__ 97 | ## <%= summary %> 98 | 99 | ```shell 100 | ``` 101 | 102 | ```python 103 | ``` 104 | 105 | ```cpp 106 | ``` 107 | 108 | ```ruby 109 | ``` 110 | 111 | > Response Sample: 112 | 113 | ```json 114 | <%= response %> 115 | ``` 116 | 117 | <%= response_description %> 118 | 119 | 120 | ### HTTP Request 121 | 122 | `<%= request %>` 123 | 124 | <% if parameters['path'].size > 0 %> 125 | ### Path Parameters 126 | 127 | Parameter | Type | Required | Description 128 | --------- | ------- | --------- | ----------------------- 129 | <% parameters['path'].each do |param| %><%= param[:parameter] %> | <%= param[:type] %> | <%= param[:required] %> | <%= param[:description] %> 130 | <% end %> 131 | 132 | <% end %> 133 | 134 | 135 | <% if parameters['query'].size > 0 %> 136 | ### Query Parameters 137 | 138 | Parameter | Type | Required | Description 139 | --------- | ------- | --------- | ----------------------- 140 | <% parameters['query'].each do |param| %><%= param[:parameter] %> | <%= param[:type] %> | <%= param[:required] %> | <%= param[:description] %> 141 | <% end %> 142 | 143 | <% end %> 144 | 145 | 146 | <% if parameters['body'].size > 0 %> 147 | ### Body Parameters 148 | 149 | Parameter | Type | Required | Description 150 | --------- | ------- | --------- | ----------------------- 151 | <% parameters['body'].each do |param| %><%= param[:parameter] %> | <%= param[:type] %> | <%= param[:required] %> | <%= param[:description] %> 152 | <% end %> 153 | 154 | <% end %> 155 | 156 | -------------------------------------------------------------------------------- /examples/curl/createData.sh: -------------------------------------------------------------------------------- 1 | curl -F 'value=65.5' -H 'X-AIO-Key: io_key_12345' \ 2 | http://io.adafruit.vm/api/v2/io_username/feeds/io-feed-key/data 3 | -------------------------------------------------------------------------------- /examples/javascript/allFeeds.js: -------------------------------------------------------------------------------- 1 | var request = require('request'); 2 | 3 | var options = { 4 | url: 'https://io.adafruit.com/api/v2/io_username/feeds', 5 | headers: { 6 | 'X-AIO-Key': 'io_key_12345', 7 | 'Content-Type': 'application/json' 8 | } 9 | }; 10 | 11 | function callback(error, response, body) { 12 | if (!error && response.statusCode == 200) { 13 | var feeds = JSON.parse(body); 14 | console.log(feeds.length + " FEEDS AVAILABLE"); 15 | 16 | feeds.forEach(function (feed) { 17 | console.log(" ", feed.name, "||", feed.key); 18 | }) 19 | } 20 | } 21 | 22 | request(options, callback); 23 | -------------------------------------------------------------------------------- /images/Swagger_explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/Swagger_explorer.png -------------------------------------------------------------------------------- /images/Swagger_explorer_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/Swagger_explorer_min.png -------------------------------------------------------------------------------- /images/adafruit-flower-left-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/adafruit-flower-left-white.png -------------------------------------------------------------------------------- /images/explorer_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/explorer_icons.png -------------------------------------------------------------------------------- /images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/favicon-16x16.png -------------------------------------------------------------------------------- /images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/favicon-32x32.png -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/favicon.ico -------------------------------------------------------------------------------- /images/io_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/io_logo.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/logo.png -------------------------------------------------------------------------------- /images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/logo_small.png -------------------------------------------------------------------------------- /images/pet_store_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/pet_store_api.png -------------------------------------------------------------------------------- /images/swagger-file-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/swagger-file-menu.png -------------------------------------------------------------------------------- /images/swagger-generate-client-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/swagger-generate-client-menu.png -------------------------------------------------------------------------------- /images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/throbber.gif -------------------------------------------------------------------------------- /images/wordnik_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/images/wordnik_api.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Adafruit IO HTTP API Specification v2 6 | 7 | 8 | 9 | 10 | 13 | 65 | 66 | 67 | 68 | 74 | 75 | 76 | 77 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /io_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/io-api/2995a32c86d184bd401781df3c7f297e70ca6341/io_logo.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "io-api", 3 | "version": "1.0.1", 4 | "description": "io api docs", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "lint": "jsonlint --quiet v2.json && jsonlint --quiet v1.json" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/adafruit/io-api.git" 13 | }, 14 | "author": "", 15 | "license": "MIT", 16 | "bugs": { 17 | "url": "https://github.com/adafruit/io-api/issues" 18 | }, 19 | "homepage": "https://github.com/adafruit/io-api#readme", 20 | "devDependencies": { 21 | "jsonlint": "^1.6.2" 22 | }, 23 | "dependencies": { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /v1.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Adafruit IO", 5 | "description": "The Internet of Things for Everyone", 6 | "version": "1.1.0" 7 | }, 8 | "host": "io.adafruit.com", 9 | "schemes": [ 10 | "https", 11 | "http" 12 | ], 13 | "basePath": "/api", 14 | "produces": [ 15 | "application/json", 16 | "application/xml", 17 | "text/csv" 18 | ], 19 | "security": [ 20 | { 21 | "HeaderKey": [] 22 | }, 23 | { 24 | "QueryKey": [] 25 | } 26 | ], 27 | "paths": { 28 | "/feeds": { 29 | "get": { 30 | "x-swagger-router-controller": "Feeds", 31 | "operationId": "all", 32 | "summary": "All feeds for current user", 33 | "description": "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.", 34 | "tags": [ 35 | "Feeds" 36 | ], 37 | "responses": { 38 | "200": { 39 | "description": "An array of feeds", 40 | "schema": { 41 | "type": "array", 42 | "items": { 43 | "$ref": "#/definitions/Feed" 44 | } 45 | } 46 | }, 47 | "403": { 48 | "description": "Unauthorized" 49 | }, 50 | "404": { 51 | "description": "Not Found" 52 | }, 53 | "500": { 54 | "description": "Server Error" 55 | } 56 | } 57 | }, 58 | "post": { 59 | "summary": "Create a new Feed", 60 | "description": "", 61 | "x-swagger-router-controller": "Feeds", 62 | "operationId": "create", 63 | "consumes": [ 64 | "application/json", 65 | "application/x-www-form-urlencoded" 66 | ], 67 | "parameters": [ 68 | { 69 | "$ref": "#/parameters/Feed" 70 | } 71 | ], 72 | "tags": [ 73 | "Feeds" 74 | ], 75 | "responses": { 76 | "200": { 77 | "description": "New feed", 78 | "schema": { 79 | "$ref": "#/definitions/Feed" 80 | } 81 | }, 82 | "403": { 83 | "description": "Unauthorized" 84 | }, 85 | "404": { 86 | "description": "Not Found" 87 | }, 88 | "500": { 89 | "description": "Server Error" 90 | } 91 | } 92 | } 93 | }, 94 | "/feeds/{id}": { 95 | "get": { 96 | "description": "Returns feed based on ID", 97 | "summary": "Get feed by ID, Feed key, or Feed Name", 98 | "x-swagger-router-controller": "Feeds", 99 | "operationId": "get", 100 | "tags": [ 101 | "Feeds" 102 | ], 103 | "responses": { 104 | "200": { 105 | "description": "Feed response", 106 | "schema": { 107 | "$ref": "#/definitions/Feed" 108 | } 109 | }, 110 | "403": { 111 | "description": "Unauthorized" 112 | }, 113 | "404": { 114 | "description": "Not Found" 115 | }, 116 | "500": { 117 | "description": "Server Error" 118 | } 119 | }, 120 | "parameters": [ 121 | { 122 | "name": "id", 123 | "in": "path", 124 | "description": "ID, key, or name of feed to use", 125 | "required": true, 126 | "type": "string" 127 | } 128 | ] 129 | }, 130 | "put": { 131 | "summary": "Replace an existing Feed", 132 | "x-swagger-router-controller": "Feeds", 133 | "operationId": "replace", 134 | "description": "", 135 | "consumes": [ 136 | "application/json", 137 | "application/x-www-form-urlencoded" 138 | ], 139 | "parameters": [ 140 | { 141 | "name": "id", 142 | "in": "path", 143 | "description": "ID, key, or name of Feed", 144 | "required": true, 145 | "type": "string" 146 | }, 147 | { 148 | "$ref": "#/parameters/Feed" 149 | } 150 | ], 151 | "tags": [ 152 | "Feeds" 153 | ], 154 | "responses": { 155 | "200": { 156 | "description": "Updated feed", 157 | "schema": { 158 | "type": "object", 159 | "$ref": "#/definitions/Feed" 160 | } 161 | }, 162 | "403": { 163 | "description": "Unauthorized" 164 | }, 165 | "404": { 166 | "description": "Not Found" 167 | }, 168 | "500": { 169 | "description": "Server Error" 170 | } 171 | } 172 | }, 173 | "patch": { 174 | "summary": "Update properties of an existing Feed", 175 | "description": "", 176 | "x-swagger-router-controller": "Feeds", 177 | "operationId": "update", 178 | "consumes": [ 179 | "application/json", 180 | "application/x-www-form-urlencoded" 181 | ], 182 | "parameters": [ 183 | { 184 | "name": "id", 185 | "in": "path", 186 | "description": "ID, key, or name of feed to use", 187 | "required": true, 188 | "type": "string" 189 | }, 190 | { 191 | "$ref": "#/parameters/Feed" 192 | } 193 | ], 194 | "tags": [ 195 | "Feeds" 196 | ], 197 | "responses": { 198 | "200": { 199 | "description": "Updated feed", 200 | "schema": { 201 | "$ref": "#/definitions/Feed" 202 | } 203 | }, 204 | "403": { 205 | "description": "Unauthorized" 206 | }, 207 | "404": { 208 | "description": "Not Found" 209 | }, 210 | "500": { 211 | "description": "Server Error" 212 | } 213 | } 214 | }, 215 | "delete": { 216 | "summary": "Delete an existing Feed", 217 | "description": "", 218 | "x-swagger-router-controller": "Feeds", 219 | "operationId": "destroy", 220 | "parameters": [ 221 | { 222 | "name": "id", 223 | "in": "path", 224 | "description": "ID, key, or name of feed to use", 225 | "required": true, 226 | "type": "string" 227 | } 228 | ], 229 | "tags": [ 230 | "Feeds" 231 | ], 232 | "responses": { 233 | "200": { 234 | "description": "Deleted feed successfully", 235 | "schema": { 236 | "type": "string" 237 | } 238 | }, 239 | "403": { 240 | "description": "Unauthorized" 241 | }, 242 | "404": { 243 | "description": "Not Found" 244 | }, 245 | "500": { 246 | "description": "Server Error" 247 | } 248 | } 249 | } 250 | }, 251 | "/feeds/{feed_id}/data": { 252 | "get": { 253 | "x-swagger-router-controller": "Data", 254 | "operationId": "all", 255 | "summary": "All data for current feed", 256 | "description": "", 257 | "tags": [ 258 | "Data" 259 | ], 260 | "parameters": [ 261 | { 262 | "name": "feed_id", 263 | "in": "path", 264 | "description": "ID, key, or name of feed", 265 | "required": true, 266 | "type": "string" 267 | }, 268 | { 269 | "name": "start_time", 270 | "in": "query", 271 | "description": "Start time for filtering data. Returns data created after given time.", 272 | "required": false, 273 | "type": "dateTime" 274 | }, 275 | { 276 | "name": "end_time", 277 | "in": "query", 278 | "description": "End time for filtering data. Returns data created before given time.", 279 | "required": false, 280 | "type": "dateTime" 281 | }, 282 | { 283 | "name": "limit", 284 | "in": "query", 285 | "description": "Limit the number of records returned.", 286 | "required": false, 287 | "type": "integer" 288 | } 289 | ], 290 | "responses": { 291 | "200": { 292 | "description": "An array of data", 293 | "schema": { 294 | "type": "array", 295 | "items": { 296 | "$ref": "#/definitions/Data" 297 | } 298 | } 299 | }, 300 | "403": { 301 | "description": "Unauthorized" 302 | }, 303 | "404": { 304 | "description": "Not Found" 305 | }, 306 | "500": { 307 | "description": "Server Error" 308 | } 309 | } 310 | }, 311 | "post": { 312 | "summary": "Create new Data", 313 | "description": "", 314 | "x-swagger-router-controller": "Data", 315 | "operationId": "create", 316 | "consumes": [ 317 | "application/json", 318 | "application/x-www-form-urlencoded" 319 | ], 320 | "parameters": [ 321 | { 322 | "name": "feed_id", 323 | "in": "path", 324 | "description": "ID, key, or name of feed", 325 | "required": true, 326 | "type": "string" 327 | }, 328 | { 329 | "$ref": "#/parameters/Data" 330 | } 331 | ], 332 | "tags": [ 333 | "Data" 334 | ], 335 | "responses": { 336 | "200": { 337 | "description": "New data", 338 | "schema": { 339 | "$ref": "#/definitions/Data" 340 | } 341 | }, 342 | "403": { 343 | "description": "Unauthorized" 344 | }, 345 | "404": { 346 | "description": "Not Found" 347 | }, 348 | "500": { 349 | "description": "Server Error" 350 | } 351 | } 352 | } 353 | }, 354 | "/feeds/{feed_id}/data/send": { 355 | "post": { 356 | "summary": "Create new Data and Feed", 357 | "description": "", 358 | "x-swagger-router-controller": "Data", 359 | "operationId": "send", 360 | "consumes": [ 361 | "application/json", 362 | "application/x-www-form-urlencoded" 363 | ], 364 | "parameters": [ 365 | { 366 | "name": "feed_id", 367 | "in": "path", 368 | "description": "ID, key, or name of feed", 369 | "required": true, 370 | "type": "string" 371 | }, 372 | { 373 | "$ref": "#/parameters/Data" 374 | } 375 | ], 376 | "tags": [ 377 | "Data" 378 | ], 379 | "responses": { 380 | "200": { 381 | "description": "New data", 382 | "schema": { 383 | "$ref": "#/definitions/Data" 384 | } 385 | }, 386 | "403": { 387 | "description": "Unauthorized" 388 | }, 389 | "404": { 390 | "description": "Not Found" 391 | }, 392 | "500": { 393 | "description": "Server Error" 394 | } 395 | } 396 | } 397 | }, 398 | "/feeds/{feed_id}/data/receive": { 399 | "get": { 400 | "summary": "Receive data?", 401 | "description": "", 402 | "x-swagger-router-controller": "Data", 403 | "operationId": "receive", 404 | "consumes": [ 405 | "application/json", 406 | "application/x-www-form-urlencoded" 407 | ], 408 | "parameters": [ 409 | { 410 | "name": "feed_id", 411 | "in": "path", 412 | "description": "ID, key, or name of feed", 413 | "required": true, 414 | "type": "string" 415 | } 416 | ], 417 | "tags": [ 418 | "Data" 419 | ], 420 | "responses": { 421 | "200": { 422 | "description": "Data response", 423 | "schema": { 424 | "type": "object", 425 | "$ref": "#/definitions/Data" 426 | } 427 | }, 428 | "403": { 429 | "description": "Unauthorized" 430 | }, 431 | "404": { 432 | "description": "Not Found" 433 | }, 434 | "500": { 435 | "description": "Server Error" 436 | } 437 | } 438 | } 439 | }, 440 | "/feeds/{feed_id}/data/previous": { 441 | "get": { 442 | "summary": "Previous Data in Queue", 443 | "description": "", 444 | "x-swagger-router-controller": "Data", 445 | "operationId": "previous", 446 | "consumes": [ 447 | "application/json", 448 | "application/x-www-form-urlencoded" 449 | ], 450 | "parameters": [ 451 | { 452 | "name": "feed_id", 453 | "in": "path", 454 | "description": "ID, key, or name of feed", 455 | "required": true, 456 | "type": "string" 457 | } 458 | ], 459 | "tags": [ 460 | "Data" 461 | ], 462 | "responses": { 463 | "200": { 464 | "description": "Data response", 465 | "schema": { 466 | "type": "object", 467 | "$ref": "#/definitions/Data" 468 | } 469 | }, 470 | "403": { 471 | "description": "Unauthorized" 472 | }, 473 | "404": { 474 | "description": "Not Found" 475 | }, 476 | "500": { 477 | "description": "Server Error" 478 | } 479 | } 480 | } 481 | }, 482 | "/feeds/{feed_id}/data/next": { 483 | "get": { 484 | "summary": "Next Data in Queue", 485 | "description": "", 486 | "x-swagger-router-controller": "Data", 487 | "operationId": "next", 488 | "consumes": [ 489 | "application/json", 490 | "application/x-www-form-urlencoded" 491 | ], 492 | "parameters": [ 493 | { 494 | "name": "feed_id", 495 | "in": "path", 496 | "description": "ID, key, or name of feed", 497 | "required": true, 498 | "type": "string" 499 | } 500 | ], 501 | "tags": [ 502 | "Data" 503 | ], 504 | "responses": { 505 | "200": { 506 | "description": "Data response", 507 | "schema": { 508 | "$ref": "#/definitions/Data" 509 | } 510 | }, 511 | "403": { 512 | "description": "Unauthorized" 513 | }, 514 | "404": { 515 | "description": "Not Found" 516 | }, 517 | "500": { 518 | "description": "Server Error" 519 | } 520 | } 521 | } 522 | }, 523 | "/feeds/{feed_id}/data/last": { 524 | "get": { 525 | "summary": "Last Data in Queue", 526 | "description": "", 527 | "x-swagger-router-controller": "Data", 528 | "operationId": "last", 529 | "consumes": [ 530 | "application/json", 531 | "application/x-www-form-urlencoded" 532 | ], 533 | "parameters": [ 534 | { 535 | "name": "feed_id", 536 | "in": "path", 537 | "description": "ID, key, or name of feed", 538 | "required": true, 539 | "type": "string" 540 | } 541 | ], 542 | "tags": [ 543 | "Data" 544 | ], 545 | "responses": { 546 | "200": { 547 | "description": "Data response", 548 | "schema": { 549 | "$ref": "#/definitions/Data" 550 | } 551 | }, 552 | "403": { 553 | "description": "Unauthorized" 554 | }, 555 | "404": { 556 | "description": "Not Found" 557 | }, 558 | "500": { 559 | "description": "Server Error" 560 | } 561 | } 562 | } 563 | }, 564 | "/feeds/{feed_id}/data/{id}": { 565 | "get": { 566 | "summary": "Returns data based on ID", 567 | "description": "", 568 | "x-swagger-router-controller": "Data", 569 | "operationId": "get", 570 | "tags": [ 571 | "Data" 572 | ], 573 | "responses": { 574 | "200": { 575 | "description": "Data response", 576 | "schema": { 577 | "$ref": "#/definitions/Data" 578 | } 579 | }, 580 | "403": { 581 | "description": "Unauthorized" 582 | }, 583 | "404": { 584 | "description": "Not Found" 585 | }, 586 | "500": { 587 | "description": "Server Error" 588 | } 589 | }, 590 | "parameters": [ 591 | { 592 | "name": "feed_id", 593 | "in": "path", 594 | "description": "ID, key, or name of feed to use", 595 | "required": true, 596 | "type": "string" 597 | }, 598 | { 599 | "name": "id", 600 | "in": "path", 601 | "description": "ID, key, or name of Data", 602 | "required": true, 603 | "type": "string" 604 | } 605 | ] 606 | }, 607 | "put": { 608 | "summary": "Replace existing Data", 609 | "x-swagger-router-controller": "Data", 610 | "operationId": "replace", 611 | "description": "", 612 | "consumes": [ 613 | "application/json", 614 | "application/x-www-form-urlencoded" 615 | ], 616 | "parameters": [ 617 | { 618 | "name": "feed_id", 619 | "in": "path", 620 | "description": "ID, key, or name of feed", 621 | "required": true, 622 | "type": "string" 623 | }, 624 | { 625 | "name": "id", 626 | "in": "path", 627 | "description": "ID, key, or name of Data", 628 | "required": true, 629 | "type": "string" 630 | }, 631 | { 632 | "$ref": "#/parameters/Data" 633 | } 634 | ], 635 | "tags": [ 636 | "Data" 637 | ], 638 | "responses": { 639 | "200": { 640 | "description": "Updated Data", 641 | "schema": { 642 | "$ref": "#/definitions/Data" 643 | } 644 | }, 645 | "403": { 646 | "description": "Unauthorized" 647 | }, 648 | "404": { 649 | "description": "Not Found" 650 | }, 651 | "500": { 652 | "description": "Server Error" 653 | } 654 | } 655 | }, 656 | "patch": { 657 | "summary": "Update properties of existing Data", 658 | "description": "", 659 | "x-swagger-router-controller": "Data", 660 | "operationId": "update", 661 | "consumes": [ 662 | "application/json", 663 | "application/x-www-form-urlencoded" 664 | ], 665 | "parameters": [ 666 | { 667 | "name": "feed_id", 668 | "in": "path", 669 | "description": "ID, key, or name of feed", 670 | "required": true, 671 | "type": "string" 672 | }, 673 | { 674 | "name": "id", 675 | "in": "path", 676 | "description": "ID, key, or name of Data", 677 | "required": true, 678 | "type": "string" 679 | }, 680 | { 681 | "$ref": "#/parameters/Data" 682 | } 683 | ], 684 | "tags": [ 685 | "Data" 686 | ], 687 | "responses": { 688 | "200": { 689 | "description": "Updated Data", 690 | "schema": { 691 | "$ref": "#/definitions/Data" 692 | } 693 | }, 694 | "403": { 695 | "description": "Unauthorized" 696 | }, 697 | "404": { 698 | "description": "Not Found" 699 | }, 700 | "500": { 701 | "description": "Server Error" 702 | } 703 | } 704 | }, 705 | "delete": { 706 | "summary": "Delete existing Data", 707 | "description": "", 708 | "x-swagger-router-controller": "Data", 709 | "operationId": "destroy", 710 | "parameters": [ 711 | { 712 | "name": "feed_id", 713 | "in": "path", 714 | "description": "ID, key, or name of feed", 715 | "required": true, 716 | "type": "string" 717 | }, 718 | { 719 | "name": "id", 720 | "in": "path", 721 | "description": "ID, key, or name of Data", 722 | "required": true, 723 | "type": "string" 724 | } 725 | ], 726 | "tags": [ 727 | "Data" 728 | ], 729 | "responses": { 730 | "200": { 731 | "description": "Deleted Group successfully", 732 | "schema": { 733 | "type": "string" 734 | } 735 | }, 736 | "403": { 737 | "description": "Unauthorized" 738 | }, 739 | "404": { 740 | "description": "Not Found" 741 | }, 742 | "500": { 743 | "description": "Server Error" 744 | } 745 | } 746 | } 747 | }, 748 | "/groups": { 749 | "get": { 750 | "summary": "All groups for current user", 751 | "description": "The Groups endpoint returns information about the user's groups.\nThe response includes the latest value of each feed in the group, and other\nmetadata about the group.\n", 752 | "x-swagger-router-controller": "Groups", 753 | "operationId": "all", 754 | "tags": [ 755 | "Groups" 756 | ], 757 | "responses": { 758 | "200": { 759 | "description": "An array of groups", 760 | "schema": { 761 | "type": "array", 762 | "items": { 763 | "$ref": "#/definitions/Group" 764 | } 765 | } 766 | }, 767 | "403": { 768 | "description": "Unauthorized" 769 | }, 770 | "404": { 771 | "description": "Not Found" 772 | }, 773 | "500": { 774 | "description": "Server Error" 775 | } 776 | } 777 | }, 778 | "post": { 779 | "summary": "Create a new Group", 780 | "description": "", 781 | "x-swagger-router-controller": "Groups", 782 | "operationId": "create", 783 | "consumes": [ 784 | "application/json", 785 | "application/x-www-form-urlencoded" 786 | ], 787 | "parameters": [ 788 | { 789 | "$ref": "#/parameters/Group" 790 | } 791 | ], 792 | "tags": [ 793 | "Groups" 794 | ], 795 | "responses": { 796 | "200": { 797 | "description": "New Group", 798 | "schema": { 799 | "$ref": "#/definitions/Group" 800 | } 801 | }, 802 | "403": { 803 | "description": "Unauthorized" 804 | }, 805 | "404": { 806 | "description": "Not Found" 807 | }, 808 | "500": { 809 | "description": "Server Error" 810 | } 811 | } 812 | } 813 | }, 814 | "/groups/{id}": { 815 | "get": { 816 | "summary": "Returns Group based on ID", 817 | "description": "", 818 | "x-swagger-router-controller": "Groups", 819 | "operationId": "get", 820 | "tags": [ 821 | "Groups" 822 | ], 823 | "responses": { 824 | "200": { 825 | "description": "Group response", 826 | "schema": { 827 | "$ref": "#/definitions/Group" 828 | } 829 | }, 830 | "403": { 831 | "description": "Unauthorized" 832 | }, 833 | "404": { 834 | "description": "Not Found" 835 | }, 836 | "500": { 837 | "description": "Server Error\"" 838 | } 839 | }, 840 | "parameters": [ 841 | { 842 | "name": "id", 843 | "in": "path", 844 | "description": "ID, key, or name of Group", 845 | "required": true, 846 | "type": "string" 847 | } 848 | ] 849 | }, 850 | "put": { 851 | "summary": "Replace an existing Group", 852 | "x-swagger-router-controller": "Groups", 853 | "operationId": "replace", 854 | "description": "", 855 | "consumes": [ 856 | "application/json", 857 | "application/x-www-form-urlencoded" 858 | ], 859 | "parameters": [ 860 | { 861 | "name": "id", 862 | "in": "path", 863 | "description": "ID, key, or name of Group", 864 | "required": true, 865 | "type": "string" 866 | }, 867 | { 868 | "$ref": "#/parameters/Group" 869 | } 870 | ], 871 | "tags": [ 872 | "Groups" 873 | ], 874 | "responses": { 875 | "200": { 876 | "description": "Updated group", 877 | "schema": { 878 | "$ref": "#/definitions/Group" 879 | } 880 | }, 881 | "403": { 882 | "description": "Unauthorized" 883 | }, 884 | "404": { 885 | "description": "Not Found" 886 | }, 887 | "500": { 888 | "description": "Server Error" 889 | } 890 | } 891 | }, 892 | "patch": { 893 | "summary": "Update properties of an existing Group", 894 | "description": "", 895 | "x-swagger-router-controller": "Groups", 896 | "operationId": "update", 897 | "consumes": [ 898 | "application/json", 899 | "application/x-www-form-urlencoded" 900 | ], 901 | "parameters": [ 902 | { 903 | "name": "id", 904 | "in": "path", 905 | "description": "ID, key, or name of Group", 906 | "required": true, 907 | "type": "string" 908 | }, 909 | { 910 | "$ref": "#/parameters/Group" 911 | } 912 | ], 913 | "tags": [ 914 | "Groups" 915 | ], 916 | "responses": { 917 | "200": { 918 | "description": "Updated Group", 919 | "schema": { 920 | "$ref": "#/definitions/Group" 921 | } 922 | }, 923 | "403": { 924 | "description": "Unauthorized" 925 | }, 926 | "404": { 927 | "description": "Not Found" 928 | }, 929 | "500": { 930 | "description": "Server Error" 931 | } 932 | } 933 | }, 934 | "delete": { 935 | "summary": "Delete an existing Group", 936 | "description": "", 937 | "x-swagger-router-controller": "Groups", 938 | "operationId": "destroy", 939 | "parameters": [ 940 | { 941 | "name": "id", 942 | "in": "path", 943 | "description": "ID, key, or name of Group", 944 | "required": true, 945 | "type": "string" 946 | } 947 | ], 948 | "tags": [ 949 | "Groups" 950 | ], 951 | "responses": { 952 | "200": { 953 | "description": "Deleted Group successfully", 954 | "schema": { 955 | "type": "string" 956 | } 957 | }, 958 | "403": { 959 | "description": "Unauthorized" 960 | }, 961 | "404": { 962 | "description": "Not Found" 963 | }, 964 | "500": { 965 | "description": "Server Error" 966 | } 967 | } 968 | } 969 | } 970 | }, 971 | "parameters": { 972 | "Data": { 973 | "name": "data", 974 | "in": "body", 975 | "required": true, 976 | "schema": { 977 | "type": "object", 978 | "properties": { 979 | "value": { 980 | "type": "string" 981 | }, 982 | "lat": { 983 | "type": "string" 984 | }, 985 | "lon": { 986 | "type": "string" 987 | }, 988 | "ele": { 989 | "type": "string" 990 | } 991 | } 992 | } 993 | }, 994 | "Feed": { 995 | "name": "feed", 996 | "in": "body", 997 | "required": true, 998 | "schema": { 999 | "type": "object", 1000 | "properties": { 1001 | "name": { 1002 | "type": "string" 1003 | }, 1004 | "key": { 1005 | "type": "string" 1006 | }, 1007 | "description": { 1008 | "type": "string" 1009 | }, 1010 | "unit_type": { 1011 | "type": "string" 1012 | }, 1013 | "unit_symbol": { 1014 | "type": "string" 1015 | }, 1016 | "visibility": { 1017 | "type": "string", 1018 | "default": "private", 1019 | "enum": [ 1020 | "private", 1021 | "public" 1022 | ] 1023 | }, 1024 | "license": { 1025 | "type": "string" 1026 | }, 1027 | "group_id": { 1028 | "type": "string" 1029 | }, 1030 | "history": { 1031 | "type": "boolean" 1032 | } 1033 | } 1034 | } 1035 | }, 1036 | "Group": { 1037 | "name": "group", 1038 | "in": "body", 1039 | "required": true, 1040 | "schema": { 1041 | "type": "object", 1042 | "properties": { 1043 | "name": { 1044 | "type": "string" 1045 | }, 1046 | "description": { 1047 | "type": "string" 1048 | } 1049 | } 1050 | } 1051 | } 1052 | }, 1053 | "securityDefinitions": { 1054 | "HeaderKey": { 1055 | "description": "The AIO Key is used to restrict or grant access to your data. The key is unique, and you can generate a key per feed, and control it in many different ways. The easiest process is to just use your automatically generated master key. You can access this key right from the right-hand side of your dashboard or from an individual feed page.", 1056 | "type": "apiKey", 1057 | "in": "header", 1058 | "name": "X-AIO-Key" 1059 | }, 1060 | "QueryKey": { 1061 | "description": "The AIO Key is used to restrict or grant access to your data. The key is unique, and you can generate a key per feed, and control it in many different ways. The easiest process is to just use your automatically generated master key. You can access this key right from the right-hand side of your dashboard or from an individual feed page.", 1062 | "type": "apiKey", 1063 | "in": "query", 1064 | "name": "X-AIO-Key" 1065 | } 1066 | }, 1067 | "definitions": { 1068 | "Group": { 1069 | "type": "object", 1070 | "properties": { 1071 | "id": { 1072 | "type": "number", 1073 | "readOnly": true 1074 | }, 1075 | "name": { 1076 | "type": "string" 1077 | }, 1078 | "description": { 1079 | "type": "string" 1080 | }, 1081 | "feeds": { 1082 | "type": "array", 1083 | "readOnly": true, 1084 | "items": { 1085 | "$ref": "#/definitions/Feed" 1086 | } 1087 | }, 1088 | "created_at": { 1089 | "type": "string", 1090 | "readOnly": true 1091 | }, 1092 | "updated_at": { 1093 | "readOnly": true, 1094 | "type": "string" 1095 | } 1096 | } 1097 | }, 1098 | "Feed": { 1099 | "type": "object", 1100 | "properties": { 1101 | "id": { 1102 | "type": "number", 1103 | "readOnly": true 1104 | }, 1105 | "name": { 1106 | "type": "string" 1107 | }, 1108 | "key": { 1109 | "type": "string" 1110 | }, 1111 | "description": { 1112 | "type": "string" 1113 | }, 1114 | "unit_type": { 1115 | "type": "string" 1116 | }, 1117 | "unit_symbol": { 1118 | "type": "string" 1119 | }, 1120 | "history": { 1121 | "type": "boolean" 1122 | }, 1123 | "visibility": { 1124 | "type": "string", 1125 | "default": "private", 1126 | "enum": [ 1127 | "private", 1128 | "public" 1129 | ] 1130 | }, 1131 | "license": { 1132 | "type": "string" 1133 | }, 1134 | "enabled": { 1135 | "type": "boolean", 1136 | "readOnly": true 1137 | }, 1138 | "last_value": { 1139 | "type": "string", 1140 | "readOnly": true 1141 | }, 1142 | "status": { 1143 | "type": "string", 1144 | "readOnly": true 1145 | }, 1146 | "group_id": { 1147 | "type": "number", 1148 | "readOnly": true 1149 | }, 1150 | "created_at": { 1151 | "type": "string", 1152 | "readOnly": true 1153 | }, 1154 | "updated_at": { 1155 | "type": "string", 1156 | "readOnly": true 1157 | } 1158 | } 1159 | }, 1160 | "Data": { 1161 | "type": "object", 1162 | "properties": { 1163 | "id": { 1164 | "type": "string", 1165 | "readOnly": true 1166 | }, 1167 | "value": { 1168 | "type": "string" 1169 | }, 1170 | "position": { 1171 | "type": "string" 1172 | }, 1173 | "feed_id": { 1174 | "type": "number" 1175 | }, 1176 | "group_id": { 1177 | "readOnly": true, 1178 | "type": "number" 1179 | }, 1180 | "expiration": { 1181 | "type": "string" 1182 | }, 1183 | "lat": { 1184 | "type": "number" 1185 | }, 1186 | "lon": { 1187 | "type": "number" 1188 | }, 1189 | "ele": { 1190 | "type": "number" 1191 | }, 1192 | "completed_at": { 1193 | "readOnly": true, 1194 | "type": "string" 1195 | }, 1196 | "created_at": { 1197 | "readOnly": true, 1198 | "type": "string" 1199 | }, 1200 | "updated_at": { 1201 | "readOnly": true, 1202 | "type": "string" 1203 | }, 1204 | "created_epoch": { 1205 | "readOnly": true, 1206 | "type": "number" 1207 | } 1208 | } 1209 | } 1210 | } 1211 | } 1212 | -------------------------------------------------------------------------------- /v2-description.md: -------------------------------------------------------------------------------- 1 | ### The Internet of Things for Everyone 2 | 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](https://learn.adafruit.com/series/adafruit-io-basics) and [a simple Internet of Things capable device like the Feather Huzzah](https://www.adafruit.com/product/2821). 4 | 5 | This API documentation is hosted on GitHub Pages and is available at [https://github.com/adafruit/io-api](https://github.com/adafruit/io-api). For questions or comments visit the [Adafruit IO Forums](https://forums.adafruit.com/viewforum.php?f=56) or the [adafruit-io channel on the Adafruit Discord server](https://discord.gg/adafruit). 6 | 7 | #### Authentication 8 | 9 | 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: 10 | 11 | $ curl -H "X-AIO-Key: io_key_12345" https://io.adafruit.com/api/v2/io_username/feeds 12 | 13 | Or like this: 14 | 15 | $ curl "https://io.adafruit.com/api/v2/io_username/feeds?X-AIO-Key=io_key_12345 16 | 17 | Using the node.js [request](https://github.com/request/request) library, IO HTTP requests are as easy as: 18 | 19 | ```js 20 | var request = require('request'); 21 | 22 | var options = { 23 | url: 'https://io.adafruit.com/api/v2/io_username/feeds', 24 | headers: { 25 | 'X-AIO-Key': 'io_key_12345', 26 | 'Content-Type': 'application/json' 27 | } 28 | }; 29 | 30 | function callback(error, response, body) { 31 | if (!error && response.statusCode == 200) { 32 | var feeds = JSON.parse(body); 33 | console.log(feeds.length + " FEEDS AVAILABLE"); 34 | 35 | feeds.forEach(function (feed) { 36 | console.log(feed.name, feed.key); 37 | }) 38 | } 39 | } 40 | 41 | request(options, callback); 42 | ``` 43 | 44 | Using the ESP8266 Arduino HTTPClient library, an HTTPS GET request would look like this (replacing `---` with your own values in the appropriate locations): 45 | 46 | ```arduino 47 | /// based on 48 | /// https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino 49 | 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | ESP8266WiFiMulti WiFiMulti; 56 | 57 | const char* ssid = "---"; 58 | const char* password = "---"; 59 | 60 | const char* host = "io.adafruit.com"; 61 | 62 | const char* io_key = "---"; 63 | const char* path_with_username = "/api/v2/---/dashboards"; 64 | 65 | // Use web browser to view and copy 66 | // SHA1 fingerprint of the certificate 67 | const char* fingerprint = "77 00 54 2D DA E7 D8 03 27 31 23 99 EB 27 DB CB A5 4C 57 18"; 68 | 69 | void setup() { 70 | Serial.begin(115200); 71 | 72 | for(uint8_t t = 4; t > 0; t--) { 73 | Serial.printf("[SETUP] WAIT %d...\n", t); 74 | Serial.flush(); 75 | delay(1000); 76 | } 77 | 78 | WiFi.mode(WIFI_STA); 79 | WiFiMulti.addAP(ssid, password); 80 | 81 | // wait for WiFi connection 82 | while(WiFiMulti.run() != WL_CONNECTED) { 83 | Serial.print('.'); 84 | delay(1000); 85 | } 86 | 87 | Serial.println("[WIFI] connected!"); 88 | 89 | HTTPClient http; 90 | 91 | // start request with URL and TLS cert fingerprint for verification 92 | http.begin("https://" + String(host) + String(path_with_username), fingerprint); 93 | 94 | // IO API authentication 95 | http.addHeader("X-AIO-Key", io_key); 96 | 97 | // start connection and send HTTP header 98 | int httpCode = http.GET(); 99 | 100 | // httpCode will be negative on error 101 | if(httpCode > 0) { 102 | // HTTP header has been send and Server response header has been handled 103 | Serial.printf("[HTTP] GET response: %d\n", httpCode); 104 | 105 | // HTTP 200 OK 106 | if(httpCode == HTTP_CODE_OK) { 107 | String payload = http.getString(); 108 | Serial.println(payload); 109 | } 110 | 111 | http.end(); 112 | } 113 | } 114 | 115 | void loop() {} 116 | ``` 117 | 118 | #### Client Libraries 119 | 120 | We have client libraries to help you get started with your project: [Python](https://github.com/adafruit/io-client-python), [Ruby](https://github.com/adafruit/io-client-ruby), [Arduino C++](https://github.com/adafruit/Adafruit_IO_Arduino), [Javascript](https://github.com/adafruit/adafruit-io-node), and [Go](https://github.com/adafruit/io-client-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. 121 | 122 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "JSV@>= 4.0.x": 6 | version "4.0.2" 7 | resolved "https://registry.yarnpkg.com/JSV/-/JSV-4.0.2.tgz#d077f6825571f82132f9dffaed587b4029feff57" 8 | 9 | ansi-styles@~1.0.0: 10 | version "1.0.0" 11 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" 12 | 13 | chalk@~0.4.0: 14 | version "0.4.0" 15 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f" 16 | dependencies: 17 | ansi-styles "~1.0.0" 18 | has-color "~0.1.0" 19 | strip-ansi "~0.1.0" 20 | 21 | has-color@~0.1.0: 22 | version "0.1.7" 23 | resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" 24 | 25 | jsonlint@^1.6.2: 26 | version "1.6.2" 27 | resolved "https://registry.yarnpkg.com/jsonlint/-/jsonlint-1.6.2.tgz#5737045085f55eb455c68b1ff4ebc01bd50e8830" 28 | dependencies: 29 | JSV ">= 4.0.x" 30 | nomnom ">= 1.5.x" 31 | 32 | "nomnom@>= 1.5.x": 33 | version "1.8.1" 34 | resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7" 35 | dependencies: 36 | chalk "~0.4.0" 37 | underscore "~1.6.0" 38 | 39 | strip-ansi@~0.1.0: 40 | version "0.1.1" 41 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" 42 | 43 | underscore@~1.6.0: 44 | version "1.6.0" 45 | resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" 46 | --------------------------------------------------------------------------------