Find field

Find a field by id.

URI
/field/find/{nodeShortId}/{fieldName}
Method
GET

URI parameters

nodeShortId
The short id of the node
fieldName
The name of the field

Request headers

Access token (optional)
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The (filtered) JSON of the field
{  
   "nodeId":"d6102670-d5e1-11e7-942c-f138c28ad955",
   "name":"temperature",
   "description":"temperature",
   "displayOffset":0.0,
   "input":true,
   "lastUpdate":1552732300817,
   "offset":0.0,
   "publicity":"GUEST",
   "retention":157680000,
   "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
}
403 Field not found or allowed to see

                            

List of fields

List of fields of the node.

URI
/field/listByNode/{nodeShortId}
Method
GET

URI parameters

nodeShortId
The id of the node

Request headers

Access token (optional)
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The (filtered) JSON of the list of fields
[  
   {  
      "nodeId":"d6102670-d5e1-11e7-942c-f138c28ad955",
      "name":"temperature",
      "description":"temperature",
      "displayOffset":0.0,
      "input":true,
      "lastUpdate":1552732300817,
      "offset":0.0,
      "publicity":"GUEST",
      "retention":157680000,
      "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
   }
]

Update the field

Create a new field or update the editable fields of the field.

URI
/field/update
Method
POST

URI parameters

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Create or update new field
{  
   "nodeId":"d6102670-d5e1-11e7-942c-f138c28ad955",
   "name":"temperature",
   "description":"temperature",
   "displayOffset":0.0,
   "input":true,
   "offset":0.0,
   "publicity":"GUEST"
}

Response body

200 The (filtered) JSON of the created or update field
{
   "fieldId":"6061c320-3cce-11e9-b6bd-7f24822e244f",
   "fieldShortId":"tr1_JIIuJE9gYcMgPM4R6Q",
   "description":"Desktop sensor field",
   "deviceId":"a7f71080-3bef-11e9-9115-7bf125b17ae7",
   "fields":[
      "temperature"
   ],
   "lastUpdate":1551685939128,
   "name":"Desktop",
   "fieldKey":"xxxxxxxxxxxxxxxxxxxxxx",
   "offset":{
      "temperature":0.0
   },
   "publicity":"GUEST",
   "retention":2592000,
   "userId":"42118de0-3bef-11e9-bbc1-f9cb7c3062e5"
}
401 The provided JWT access token is invalid or expired

                            
403 Node not found or not owned