Skip to main content

Introduction

API Availability

This feature is currently available in Enapter Cloud and Enapter Gateway with firmware version 2.1 and above.

API activation may be needed in Enapter Cloud. Please reach out to our developers support at developers@enapter.com.

API Base URL

Use the following base URLs to access this API:

  • Enapter Cloud: https://api.enapter.com/
  • Enapter Gateway: http://enapter-gateway.local/api/

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}'
$ curl https://api.enapter.com/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"
}
}

All Rights Reserved © 2024 Enapter AG.