Connected Devices/Projects/Project Link/Taxonomy: Difference between revisions

Jump to navigation Jump to search
Changing TOC.
(→‎Channels: + Mucho documentation)
(Changing TOC.)
Line 1: Line 1:
== Taxonomy Documentation ==
= Taxonomy Documentation =
Github Link: http://fxbox.github.io/taxonomy/doc/foxbox_taxonomy/index.html
Github Link: http://fxbox.github.io/taxonomy/doc/foxbox_taxonomy/index.html


== Current REST API Examples ==
= Current REST API =


=== Account ===
== Account ==
* To create account:
* To create account:
** POST http://localhost:3000/users/setup {"email": "a@b.com","username":"admin","password": "00000000"}
** POST http://localhost:3000/users/setup {"email": "a@b.com","username":"admin","password": "00000000"}
Line 10: Line 10:
** POST http://localhost:3000/users/login (Header contains Authorization: Basic <base64 encode of username:password)
** POST http://localhost:3000/users/login (Header contains Authorization: Basic <base64 encode of username:password)


=== Service List ===
== Service List ==
Services may requested by selector. A service selector is an object with the following fields:
Services may requested by selector. A service selector is an object with the following fields:


Line 35: Line 35:
** GET http://localhost:3000/api/v1/services
** GET http://localhost:3000/api/v1/services


=== Channels ===
== Channels ==


Channels are designed to be used by selector.
Channels are designed to be used by selector.
Line 52: Line 52:




==== Fetching ====
=== Fetching ===


* Fetch values from all channels matching any of the selectors
* Fetch values from all channels matching any of the selectors
Line 62: Line 62:
** PUT http://localhost:3000/api/v1/channels/get [{"tags": "location: entrance", kind: "OpenClosed"}
** PUT http://localhost:3000/api/v1/channels/get [{"tags": "location: entrance", kind: "OpenClosed"}


==== Sending ====
=== Sending ===


* Send one values to all channels matching any of the selectors:
* Send one values to all channels matching any of the selectors:
Line 73: Line 73:
See http://fxbox.github.io/taxonomy/doc/foxbox_taxonomy/values/enum.Value.html for the full documentation on values.
See http://fxbox.github.io/taxonomy/doc/foxbox_taxonomy/values/enum.Value.html for the full documentation on values.


=== Time ===
= Specific services and channels =
== Time ==
* Get the current time
* Get the current time
** PUT http://localhost:3000/api/v1/channels/get {"id":"getter:timeofday.clock@link.mozilla.org"}
** PUT http://localhost:3000/api/v1/channels/get {"id":"getter:timeofday.clock@link.mozilla.org"}
Line 87: Line 88:
** POST http://localhost:3000/api/v1/services {"setters":[{"kind":{"adapter":"Adapter","kind":"snapshot","type": "Json", "vendor":"DLink"} }]}
** POST http://localhost:3000/api/v1/services {"setters":[{"kind":{"adapter":"Adapter","kind":"snapshot","type": "Json", "vendor":"DLink"} }]}


=== Tags ===
== Tags ==
* Assign Tags to a service
* Assign Tags to a service
** POST http://localhost:3000/api/v1/services/tags {"services":[{"id":"thinkerbell-root-service"}],"tags":["Living Room"] }
** POST http://localhost:3000/api/v1/services/tags {"services":[{"id":"thinkerbell-root-service"}],"tags":["Living Room"] }
Line 96: Line 97:
* Query all devices matching the tag
* Query all devices matching the tag
** POST http://localhost:3000/api/v1/services {"tags":["Living"]}
** POST http://localhost:3000/api/v1/services {"tags":["Living"]}
=== Recipe ===
== Recipe ==
* Send Recipe
* Send Recipe
* List available Recipes
* List available Recipes


=== WebPush ===
== WebPush ==
* Add push subscription
* Add push subscription
** PUT http://localhost:3000/api/v1/channels/set {"select": {"id": "setter:subscribe.webpush@link.mozilla.org"}, "value": {"Json": {“subscriptions”:[{“push_uri”:”http://push.service/t54wtresfesfd”,”public_key”:”base64_encoded_key”}]}}}
** PUT http://localhost:3000/api/v1/channels/set {"select": {"id": "setter:subscribe.webpush@link.mozilla.org"}, "value": {"Json": {“subscriptions”:[{“push_uri”:”http://push.service/t54wtresfesfd”,”public_key”:”base64_encoded_key”}]}}}
184

edits

Navigation menu