Some basic rules that apply for all requests to our API.
https://esaveag.com/slcontrol/api/API endpoint/URL parameters
Do not forget the Slash after API endpoint even if you do not use any URL parameters.
We have several API endpoints you can communicate with. Watch out that you are using the correct one as documented.
API endpoint names are case sensitive.
To control your result you may/must use parameters.
Do not use any parameter more than once in the same URL.
URL parameter names and values are case sensitive.
Do not forget to properly URL-encode your URL parameters.
Make sure you are using the correct HTTP request method as documented.
GET | POST | PUT | DELETE
There are two HTTP headers required in all requests to get authorization by the server.
Additional HTTP headers may be optionally available or even required.
GET /slcontrol/api/lightRadar/?limit=10&serial=0478303&format=json HTTP/1.1 Host: esaveag.com X-PUBLIC-KEY: 90a236c3cae7f726a1a993460fe03c0b X-SIGNATURE: df11689d8c690c10d72bbfad1d2afe46
You will receive a public key by an esave-Administrator. Just add it as given.
You will also receive your private key. You need this key to calculate the X-Signature. It is a simple MD5-Hash (Text-mode, not binary mode) as the following pseudo-code shows:
MD5( api/API endpoint/BASE64_ENCODED_STRINGae6ec807800829494c6621ad96f3437a )
Do not forget the Slash after API endpoint even if you do not use any URL parameters.
Do not include any URL parameters for calculation of the hash.
The content of the message must be base64 encoded for the calculation of the X-Signature.
Required for POST and PUT Requests only.
You should receive one of the following response codes if you are addressing our API correctly.
HTTP/1.1 200 OK HTTP/1.1 201 Created HTTP/1.1 204 No Content
If you are receiving the following HTTP status code, there probably is something wrong with your hash calculation or you are trying to access something you are not allowed to. Ask esave for help if you cannot figure the problem out by yourself.
HTTP/1.1 401 Unauthorized
If you are receiving the follwoing HTTP status code, your request is either completely fucked up or you are trying to do something you really must not do.
HTTP/1.1 400 Bad Request
If we can identify what is going wrong, you will receive a JSON error that looks like this:
{"error":1001}
You will find the description for such error codes within the documentation for the API Endpoint you are trying to access.
We do not look for all possible errors. We stop parsing as soon as we encounter any grave error.
Charset of content of requests and responses must be UTF-8.
Content format is JSON and data must be properly JSON-encoded.
URL-Parameter values must be URL-encoded.
Default Content format is JSON.
Content format may be XML if requested by using the approriate URL Parameter.
Root node of XML is always named slControl.
Date format is ISO if not declared otherwise.
Dates ar local time if not stated/requested otherwise.
Usually, anything is identified by its respective slcID (slControl system ID). But there are, as always, some exceptions.
Expect to handle the following Identifiers, also:
slcDeviceAddress - field communication address of a device/lamp slcWirelessID - field communication address of a gateway slcHardwareID - hardware id of a gateway