-
Notifications
You must be signed in to change notification settings - Fork 0
X bit API definition DOCUMENT
bstsnail edited this page Aug 2, 2016
·
11 revisions
This doc is to define the RESTFul API of V1 x-bit

-
Register
POST https://hostname/rest/settings/register { "username": xxx, "password": xxx }ie:
https://52.197.83.138/rest/settings/register { "username": "robin.deng", "password": "xxxxxxxxxx" } -
Login:
POST https://hostname/rest/settings/login { "username": xxx, "password": xxx }Response:
{ "status": 200, "errmsg": "OK", "data": { "id": 1 } } -
List user Info: (We can use session or basic authentication)
GET https://hostname/rest/settings/user/<id> { "status": 200, "data": { "username": xxx, "userKeys": [ "key1", "key2", ... ] } } -
Update User Info
PUT https://hostname/rest/settings/user/<id> { "password": xxx, "userKeys": [ "key1", "key2", ... ] } -
Delete a user
DELETE https://hostname/rest/settings/user/<id> { "status": 200 }
-
raw data
GET https://hostname/rest/data/<key> { "status": 200, "message": "OK", "data": [ { "timestamp": xxxx, "metrics": [{ "name": "metric1", "value": 123 }, ..., { "name": "metricN", "value": 789 }] } ] } -
upload data
POST https://hostname/rest/data/<key> [ { "timestamp": xxxx, "metrics": [{ "name": "metric1", "value": 123 }, ..., { "name": "metricN", "value": 789 }] } ] -
graph data
GET https://hostname/rest/data/<key> { "status": 200, "message": "OK", "data": [ { "timestamp": xxxx, "metrics": [{ "name": "metric1", "value": 123 }, ..., { "name": "metricN", "value": 789 }] } ] }