Remove All Active Sessions
Removes all active sessions.
DELETE /v1/sessions
Removes all active sessions.
CoAP Options
Option | Description | Value | Required |
---|---|---|---|
URI-Path | Resource segment #1 | v1 | Yes |
URI-Path | Resource segment #2 | sessions | Yes |
Response 2.02
No payload is provided. Developers should use response code (2.02) to know that all active 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',
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