Retrieve All Archived Sessions

Retrieves sessions that have completed its lifecycle.

GET /v1/sessions/history

CoAP Options

OptionDescriptionValueRequired
URI-PathResource segment #1v1Yes
URI-PathResource segment #2sessionsYes
URI-PathResource segment #3historyYes

Response Parameters

Session History

All archived session objects are assumed to be cleared. Much of the properties are the same as the active session property except with an added clearType property to define whether a session was cleared or removed.

PropertyDescriptionType
idUnique sequential number for each session that is created.number
uuidUUID v4 that is generated for each session.number
numberPager number the session is bound to.number
partySizeThe size of the party for a session.number
goalInSecondsThe target goal in seconds that was assigned to the session.number
createdTimestamp of when the session is created.string (ISO8601)
startedTimestamp of when the session is started. Will be the same as startedstring (ISO8601)
notifiedTimestamp when the session is paged.string (ISO8601)
clearedTimestamp when the session is cleared. (Will only appear for notifications)string (ISO8601)
clearTypeThe type of session clearing.string (enum)
values:
STOP
REMOVED
labelAssigned label to a sessionstring | null
stateThe state of a session.string (enum)
values:
started
paged
* cleared

Example Response

{
  "responseTypes": [
    "session_history"
  ],
  "globalSessionSequence": 116,
  "timestamp": "2018-03-15T11:45:29",
  "deviceName": "T7470",
  "firmwareVersion": "8.4.100.43",
  "session_history": [
    {
      "id": 11,
      "uuid": "15e958b7-bc83-4dd1-b4ae-d2bc27f39b3e",
      "number": 4,
      "goalInSeconds": 300,
      "created": "2018-03-15T08:44:13",
      "started": "2018-03-15T08:44:13",
      "notified": "2018-03-15T08:49:13",
      "cleared": "2018-03-15T11:45:18",
      "label": null,
      "clearType": "STOP"
    },
    {
      "id": 17,
      "uuid": "da4b66f6-af73-45ae-8ad0-c155a306832b",
      "number": 10,
      "goalInSeconds": 300,
      "created": "2018-03-15T08:44:35",
      "started": "2018-03-15T08:44:35",
      "notified": "2018-03-15T08:49:35",
      "cleared": "2018-03-15T11:45:22",
      "label": null,
      "clearType": "REMOVED"
    }
  ]
}

Example Code Request

// Using node-coap (yarn add coap, npm install coap): https://github.com/mcollina/node-coap
const coap = require('coap');

// Retrieving session with number 23
let req = coap.request({
  host: '10.0.1.32',
  port: 5683,
  pathname: '/v1/sessions/history',
  method: 'GET'
});

req.on('response', res => {
  let json = JSON.parse(res.payload.toString('utf-8'));
  if (res.code[0] === '2') { // Success
    console.log(json.session_history);
  } else {
    // Some other error.
    console.error(json);
  }
});

// Send request
req.end();