Skip to main content

Introduction

Gateway devices only

This feature is currently available only on Gateway and requires firmware version 2.1 and above.

Authentication

Enapter HTTP API uses API tokens to authenticate requests. The token must be provided for every API request via custom HTTP header X-Enapter-Auth-Token:

$ curl http://enapter-gateway.local/api/assets/v1/devices -X GET \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}'

Errors

Enapter uses conventional HTTP response codes to indicate success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate request payload errors. Codes in the 5xx range indicate Enapter servers' errors.

HTTP Status CodeExplanation
200 — OKEverything worked as expected.
400 — Bad RequestThe request payload has failed parsing or validation.
403 — ForbiddenAuthentication token is invalid, missing or expired.
404 — Not FoundA non-existent resource is requested.
422 — Unprocessable EntityUnable to process the contained instructions.
429 — Too Many RequestsToo many requests hit the API too quickly.
500 — Internal Server ErrorSomething went wrong on Enapter's end.

Common Error Format

codestringrequired#

A short string indicating the reported error code.

messagestringrequired#

A human-readable message that provides more details about the error.

detailsobject#

Additional error-specific fields.

Sample error object
{
"code": "invalid_header",
"message": "Authentication token is invalid.",
"details": {
"header": "X-Enapter-Auth-Token"
}
}
Hardware diversity is welcome. Integrate any device into a unified energy network.
© 2022 Enapter
Developer toolkit
DocumentationReference