Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 711 Bytes

api_examples.md

File metadata and controls

42 lines (32 loc) · 711 Bytes

API Usage Examples

All the requests have to be authenticated unless you compiled Foxbox with authentication disabled.

To change light status:

PUT to api/v1/channels/set :

{ "select": {
    "id": "channel:[email protected]",
    "feature": "light/is-on"
  },
  "value": "Off"
}

To retrieve light status:

PUT to api/v1/channels/get :

{
  "id": "channel:[email protected]", 
  "feature": "light/is-on"
}

To say something:

PUT to api/v1/channels/set :

{
  "select": {
    "id": "setter:[email protected]",
    "feature": "speak/sentence"
  },
  "value": "Hello FoxBox"
}