GET |
PUT |
DELETE |
POST |
Path |
Description |
X |
X |
X |
X |
Common to all endpoints: |
Parameters:
- sort the result set, defaults to asc
/api/v1/packets?sort=(desc or asc)
- offset the result set, by the passed integer number
/api/v1/packets?offset=(positive and negative work)
- length the result set, is limited to only return the first integer number of results. Max of 200
/api/v1/packets?length=(positive integer)
|
X |
|
|
|
/api/v1/nodes |
Retrieve a list of Nodes and authenticate with API Key:
/api/v1/nodes?key=0dfdFFeeDx
The following Parameters are respected:
Typical response from the gateway:
{
"nodes": [
{
"name": "node0",
"key": "500d81aafe637717a52f8650e54206e64da33d27",
"description": "This node has a temperature sensor",
"version": "0.2.1",
"sensors": [
"Temperature"
],
"packets": 0
},
{
"name": "node1",
"key": "f937c37e949d9efa20d2958af309235c73ec039a",
"description": "This node has a movement sensor",
"version": "0.2.1",
"sensors": [
"Movement"
],
"packets": 0
}
],
"total": 2,
"found": 2
}
|
X |
|
|
X |
/api/v1/packets |
Retrieve a list of packets and authenticate with API Key:
/api/v1/packets?key=0dfdFFeeDx
The following parameters are respected:
- node
- seqno
- hour
- minute
- date
Typical response from the gateway:
{
"packets": [
{
"date": "2013-11-11",
"hour": "22",
"minute": "04",
"node": "node0",
"key": "500d81aafe637717a52f8650e54206e64da33d27",
"seqNo": 0,
"data": [
13
]
}
],
"total": 1,
"found": 1
}
|
X |
|
|
|
/api/v1/zones |
Retrieve a list of zones and authenticate with API Key:
/api/v1/zones?key=0dfdFFeeDx
The following parameters are respected:
Typical response from the gateway:
{
"zones": [
{
"zonename": "testzone1",
"key": "79a7c75758879243418fe2c87ec7d5d4e1451129",
"nodes": [
"node1"
]
},
{
"zonename": "testzone0",
"key": "455a807bb34b1976bac820b07c263ee81bd267cc",
"nodes": [
"node0"
]
}
],
"total": 2,
"found": 2
}
|
X |
|
|
|
/api/v1/zones/:zonename |
Retrieve a list of zones and authenticate with API Key:
/api/v1/zones/testzone1?key=0dfdFFeeDx
Typical response from the gateway:
{
"zones": [
{
"zonename": "testzone1",
"key": "79a7c75758879243418fe2c87ec7d5d4e1451129",
"nodes": [
"node1"
]
}
],
"total": 2,
"found": 1
}
|
X |
|
|
|
/api/v1/watch |
Retrieve a list of nodes currently on the watch list and authenticate with API Key:
/api/v1/watch?key=0dfdFFeeDx
Typical response from the gateway:
{
"watched": [
]
}
|
X |
|
|
X |
/api/v1/watch/:node |
Retrieve a list of nodes currently on the watch list and authenticate with API Key:
/api/v1/watch/node0?key=0dfdFFeeDx
Typical response from the gateway:
{
"watched": false
}
To add a node to the watchlist use the following parameters in a POST request:
- node
- notifyURL
- method
- timeout
See the following full example for more information:
require 'rubygems'
require 'typhoeus'
require 'json'
body = {:key=> "1230aea77d7bd38898fec74a75a87738dea9f657",
:notifyURL=>"http://some-server/push/notifications",
:method=>"POST",
:timeout=>"60"}
puts Typhoeus::Request.post("http://localhost:4567/api/v1/watch/node2", :body=>body)
|