Remove All Archived Sessions
Removes all archived sessions.
DELETE /v1/sessions/history
Removes all archived sessions.
CoAP Options
Option | Description | Value | Required |
---|---|---|---|
URI-Path | Resource segment #1 | v1 | Yes |
URI-Path | Resource segment #2 | sessions | Yes |
URI-Path | Resource segment #3 | history | Yes |
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();
Updated over 6 years ago