Remove All Archived Sessions

Removes all archived sessions.

DELETE /v1/sessions/history

Removes all archived sessions.

CoAP Options

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

Response 2.02

No payload is provided. Developers should use response code (2.02) to know that all archived sessions are 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: 'DELETE'
});

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

// Send request
req.end();