Run console commands
POST
/api/v1/console
const url = 'http://pwrman.local/api/v1/console';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/plain'}, body: 'status\nfaults\n'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://pwrman.local/api/v1/console \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: text/plain' \ --data 'statusfaults'Console commands as text, one per line, under 2048 bytes in all. The reply is for people to read, and its wording can change in any release; programs should use the JSON requests instead. The commands are listed in the console reference. Some commands are refused here, and the transcript says so.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typetext/plain
string
Example
statusfaultsResponses
Section titled “Responses”Started. The result shows up later.
Media typeapplication/json
object
ok
required
boolean
Example
{ "ok": true}The body is empty.
Media typeapplication/json
object
error
required
Why the request was refused, in words.
string
Example
{ "error": "no command"}The token is missing or wrong, or no token is set yet.
Media typeapplication/json
object
error
required
Why the request was refused, in words.
string
Examples
{ "error": "bearer token required"}{ "error": "no API token set yet: finish first-time setup first"}The last batch is still running or still being read.
Media typeapplication/json
object
error
required
Why the request was refused, in words.
string
Example
{ "error": "the last commands are still running"}The body is 2048 bytes or more.
Media typeapplication/json
object
error
required
Why the request was refused, in words.
string
Example generated
{ "error": "example"}USB Type-C® and USB-C® are registered trademarks of USB Implementers Forum.