eGauge Meter API
eGauge Meter API
The eGauge WebAPI is a JSON-based API that provides access to eGauge meters. It offers secure means to read device data, configure the device, and perform various control operations.
The WebAPI is intended to eventually replace the eGauge XML API. For new applications, developers are encouraged to use WebAPI rather than the legacy XML API.
The authentication service. Clients can use this to obtain and manage tokens that grant access to the other resources in this API.
The meter uses JSON Web Tokens (JWT or simply token) to restrict access to protected resources. Clients must include such tokens in requests via the HTTP Authorization header. This header must have the form:
Authorization: Bearer JWT
where JWT is a valid token.
Tokens are valid for a limited time; typically for about 10 minutes. However, a meter may revoke a token earlier, e.g., due to a reboot.
The service provides the ability to execute various operations for their side effects, such as rebooting the meter. Unless stated otherwise, the resources in this service are available only to users with the save right (see /auth/rights).
curl -i -X GET \ 'https://webapi.egauge.net/_mock/webapi/4.6/openapi/config/alert/custom/{idx}/cond?filter=string&max-depth=1' \ -H 'Authorization: Bearer <YOUR_JWT_HERE>'
{ "result": { "lhs": "temp_internal()", "op": "<", "rhs": "30" }, "error": "Error message (present if an error occurred)." }
An eScript expression that returns the value to use on the left hand side of the comparison.
The comparison-operator to use for comparing the left-hand-side expression lhs
against the right-hand side expression rhs
. It may be one of:
<
: Condition is true if lhs
is less than rhs
.<=
: Condition is true if lhs
is less-than-or-equal to rhs
.=
: Condition is true if lhs
is equal to rhs
.!=
: Condition is true if lhs
differs from rhs
.>=
: Condition is true if lhs
is greater-than-or-equal to rhs
.>
: Condition is true if lhs
is greater than rhs
.An eScript expression that returns the value that to use on the right hand side of the comparison.
curl -i -X PUT \ 'https://webapi.egauge.net/_mock/webapi/4.6/openapi/config/alert/custom/{idx}/cond' \ -H 'Authorization: Bearer <YOUR_JWT_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "lhs": "temp_internal()", "op": "<", "rhs": "30" }'
{ "status": "OK", "error": "Error message (present if an error occurred)." }
An eScript expression that returns the value to use on the left hand side of the comparison.
The comparison-operator to use for comparing the left-hand-side expression lhs
against the right-hand side expression rhs
. It may be one of:
<
: Condition is true if lhs
is less than rhs
.<=
: Condition is true if lhs
is less-than-or-equal to rhs
.=
: Condition is true if lhs
is equal to rhs
.!=
: Condition is true if lhs
differs from rhs
.>=
: Condition is true if lhs
is greater-than-or-equal to rhs
.>
: Condition is true if lhs
is greater than rhs
.An eScript expression that returns the value that to use on the right hand side of the comparison.
curl -i -X POST \ 'https://webapi.egauge.net/_mock/webapi/4.6/openapi/config/alert/custom/{idx}/cond' \ -H 'Authorization: Bearer <YOUR_JWT_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "lhs": "temp_internal()", "op": "<", "rhs": "30" }'
{ "status": "OK", "error": "Error message (present if an error occurred)." }