HTTP Device Create


Required Fields


path
The base path for the Device. Flow objects will be created beneath this path for sending Drops to-and-from the device.

Optional Fields


token
An ID for a Token, which the Device must use to authenticate with flowthings.io. If no ID is provided, one will be automatically generated for the Device
displayName
A friendly name for the Device
reportPeriodicity
How often the device should send a report (applicable when using the flowthings.io Agent)

Request


POST https://api.flowthings.io/v0.1/<account_id>/device

Headers

NameDescription
Content-Typeapplication/json
X-Auth-TokenAuthentication Token

Example

  {
      "displayName": "Thermostat",
      "path" : "/alice/devices/home/thermostat"
  }

Response


HTTP Codes

CodeDescription
201Resource Created
400Bad Request
401Unauthorized
503Service Unavailable

Example Response Body

{
  "head": {
    "status": 201,
    "ok": true,
    "messages": [
      "Your request has been processed successfully. A new resource has been created."
    ],
    "errors": []
  },
  "body": {
    "id": "d5489f22ed4c66f8dfcbe2794",
    "creationDate": 1409455732680,
    "displayName": "Thermostat",
    "path" : "/alice/devices/home/thermostat",
    "token" : "k548b20f2d4c63c0634ad3cc8",
    "status" : "UNSEEN",
    "reportPeriodicity" : 60000
  }
}