Eniris API documentation

This document provides an brief overview of available endpoints and their parameters. The API is a basic REST API. The API accepts JSON as request body (not form data, just plain JSON).

Introduction

To be able to authenticate to the Eniris API it is required you have an open API account. To login you need a valid email address and password. When the credentials are valid, a web-token will be generated which will then be required for subsequent calls to the api. If the token expires, an error message will be returned, which therefore means you have to request a new token with the original login-credentials.

Base URL

The base URL of the API is:

				
					https://api.eniris.be/
				
			

Rate limiting

If you receive an error “Too many requests”, it means that you have exceeded rate limiter limits.

Authentication endpoints

The authentication endpoints include the only endpoints in the API for which no authorization header is required to access them.

POST login 

				
					https://api.eniris.be/auth/login
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{ 
"credentials": {
    "username": string,
    "password": string
    }
}
				
			
When logging in a token is issued which may be used to authorize further requests by including it in the “X-Authorization” request header.
				
					X-Authorization: Bearer {token}
				
			

POST logout 

Accessing this endpoint with a token set in the Authorization header will blacklist the token at the server side for further use.
				
					https://api.eniris.be/auth/logout
				
			

User Management

POST user/updatePassword

Updating the current user’s password.
				
					https://api.eniris.be/user/updatePassword
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "oldPassword": string,
  "newPassword": string,
  "refreshSalt": boolean,
  "generateToken": boolean
}
				
			

Role Management

Roles can be created and managed.

GET role/getAll

List all roles.
				
					https://api.eniris.be/role/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw

POST role/create

List all roles.
				
					https://api.eniris.be/role/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": number,
  "role": {name: string, roleManagement: boolean, userManagement: boolean, viewManagement: boolean, accessRightManagement: boolean, deviceManagement: boolean},
  "manages": {parentRoleId: number, roleManagement: boolean, userManagement: boolean, viewManagement: boolean, accessRightManagement: boolean, deviceManagement: boolean}
}
				
			

POST role/update

				
					https://api.eniris.be/role/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": number,
  "role": {name: string, roleManagement: boolean, userManagement: boolean, viewManagement: boolean, accessRightManagement: boolean, deviceManagement: boolean}
}
				
			

View Management

GET view/getAllWithoutContent

Returns all views for the current user.
				
					https://api.eniris.be/view/getAllWithoutContent
				
			
HEADERS
Content-Type: application/json
 
BODY raw

GET view/get

Return name, id and content of the requested view.
				
					https://api.eniris.be/view/get
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "viewId": ""
}
				
			
RESPONSE
				
					{
    "id": "",
    "name": "",
    "content: ""
}
				
			

POST view/create

				
					https://api.eniris.be/view/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "view": {name: string, content: string},
  "views": {roleId: number}
}
				
			
RESPONSE
				
					{
    "view": {
            "id": "",
            "name": "",
            "content": ""
        },
    "views": {
            "id": "",
            "roleId": "",
            "viewId": "",
            "viewerManagement": "",
            "edits": ""
        }
}
				
			

POST view/update

				
					https://api.eniris.be/view/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "view": ""
}
				
			
RESPONSE
				
					{
            "id": "",
            "name": "",
            "content": ""
}
				
			

Device Management

GET device/getAll

Return all devices assigned to the view.
				
					https://api.eniris.be/device/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "viewId": ""
}
				
			
RESPONSE
				
					{
           "device": Array of devices
}
				
			

POST device/create

				
					https://api.eniris.be/device/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "device": any,
  "monitors": {"roleId": number, "reads": string[], "edits": string[]}
}
				
			

POST device/update

				
					https://api.eniris.be/device/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "device": any
}
				
			

Access Management

GET accessRight/getAll

				
					https://api.eniris.be/accessRight/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw

POST accessRight/create

				
					https://api.eniris.be/accessRight/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "accessRight": "",
  "allows": ""
}
				
			

POST accessRight/update

				
					https://api.eniris.be/accessRight/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "accessRight": ""
}
				
			

Report Management

GET report/getAll

Return all reports for the given view.
				
					https://api.eniris.be/report/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "viewId": ""
}
				
			

POST report/create

				
					https://api.eniris.be/report/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "report": "",
  "reports": ""
}
				
			
RESPONSE
				
					{
  "report": {
            "id": "",
            "url": "",
            "period": "",
            "delay": "",
            "emails": ""
        },
  "reports": {
            "id": "",
            "viewId": "",
            "reportId": ""
        }
}
				
			

POST report/update

				
					https://api.eniris.be/report/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "report": ""
}
				
			
RESPONSE
				
					{
            "id": "",
            "url": "",
            "period": "",
            "delay": "",
            "emails": ""
}
				
			

POST report/delete

				
					https://api.eniris.be/report/delete
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "report": ""
}
				
			

Member Management

GET memberOf/getAll

Return all members of a relation (ie return all users).
HEADERS
Content-Type: application/json
 
BODY raw
				
					https://api.eniris.be/memberOf/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw
RESPONSE
				
					{
"memberOf" : 
            {"id": "",
            "userEmail": "",
            "roleId": "",
            "expirationTs": ""
            }
}
				
			

POST memberOf/create

Create a MemberOf (ie a user)
				
					https://api.eniris.be/memberOf/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "memberOf": {"userEmail": string, "roleId": number, "expirationTs": number},
  "options": {"layout": string}
}
				
			
RESPONSE
				
					{
"memberOf" : 
            {
            "id": "",
            "userEmail": "",
            "roleId": "",
            "expirationTs": ""
            }
}
				
			

POST memberOf/update

				
					https://api.eniris.be/memberOf/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "memberOf": {"id": number, "expirationTs": number}
}
				
			
RESPONSE
				
					{
"memberOf" : 
            {
            "id": "",
            "userEmail": "",
            "roleId": "",
            "expirationTs": ""
            }
}
				
			

POST memberOf/delete

				
					https://api.eniris.be/memberOf/delete
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "memberOf": {"id": number}
}
				
			

Views Management

GET views/getAll

				
					https://api.eniris.be/views/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw

POST views/create

				
					https://api.eniris.be/views/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "views": ""
}
				
			

POST views/update

				
					https://api.eniris.be/views/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "views": ""
}
				
			

POST views/delete

				
					https://api.eniris.be/views/delete
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "views": ""
}
				
			

Manages

GET manages/getAll

				
					https://api.eniris.be/manages/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw

POST manages/create

				
					https://api.eniris.be/manages/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "manages": {      
    "parentRoleId": number,
    "roleManagement": boolean, 
    "userManagement": boolean, 
    "viewManagement": boolean,
    "accessRightManagement": boolean,
    "deviceManagement": boolean
    }
}
				
			

POST manages/update

				
					https://api.eniris.be/manages/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "manages": {      
    "parentRoleId": number,
    "roleManagement": boolean, 
    "userManagement": boolean, 
    "viewManagement": boolean,
    "accessRightManagement": boolean,
    "deviceManagement": boolean
    }
}
				
			

POST manages/delete

				
					https://api.eniris.be/manages/delete
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "manages": {      
    "parentRoleId": number,
    "roleManagement": boolean, 
    "userManagement": boolean, 
    "viewManagement": boolean,
    "accessRightManagement": boolean,
    "deviceManagement": boolean
    }
}
				
			

Monitors

GET monitors/getAll

				
					https://api.eniris.be/monitors/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw

POST monitors/create

				
					https://api.eniris.be/monitors/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "monitors": {roleId: number, reads: string[], edits: string[]}
}
				
			

POST monitors/update

				
					https://api.eniris.be/monitors/update
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "monitors": {roleId: number, reads: string[], edits: string[]}
}
				
			

POST monitors/delete

				
					https://api.eniris.be/monitors/delete
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "monitors": {roleId: number, reads: string[], edits: string[]}
}
				
			

Allows

GET allows/getAll

				
					https://api.eniris.be/allows/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw

POST allows/create

				
					https://api.eniris.be/allows/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "allows": ""
}
				
			

POST allows/delete

				
					https://api.eniris.be/allows/delete
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "allows": ""
}
				
			

Contains

GET contains/getAll

				
					https://api.eniris.be/contains/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "viewId": ""
}
				
			

POST contains/create

				
					https://api.eniris.be/contains/create
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "contains": ""
}
				
			

POST contains/delete

				
					https://api.eniris.be/contains/delete
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": "",
  "contains": ""
}
				
			

Alarm Management

GET alarm/getAll

Return all alarms for the requested view.
				
					https://api.eniris.be/alarm/getAll
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "viewId": number
}
				
			

GET alarm/alarmCreate

				
					https://api.eniris.be/alarmCreate
				
			
HEADERS
Content-Type: application/json
 
BODY raw
				
					{
  "authRoleId": number, 
  "alarm": any, 
  "generates": any
}
				
			
Contacteer ons

Eniris Energie:
energie@eniris.be

Eniris Proces:
proces@eniris.be

Eniris Assets

assets@eniris.be

Copyright © 2021 Eniris bv

Start vandaag
met Eniris Insights