This article lists the available documentation on the API and introduces the steps to take to develop an app for the platform by giving an overview on the platform's API and giving examples of queries to request data.
You will need a basic understanding of HTTP and APIs and a SuperAdmin user.
Contents:
Introduction
The API secures all queries by using a security token which is unique for each application and each account where the application is installed.
In order to obtain a security token, you will need to register an application, and install it in one of your accounts.
API v3 Technical documentation
All the technical documentation on the API is available in the platform's developer portal: developers.dexma.com.
Registering an application
If you want to register a new application, follow the steps described here.
Installing an application
The handshake process is described in the API's technical documentation.
Call examples
With the app registered and successfully installed in one of your accounts, you should have received the x-dexcell-token and stored it in your app. With that token, you can perform queries to the different endpoints of the API.
Obtain a list of all my locations
url: https://api.dexcell.com/v3/locations
Obtain the specific information of one location
url: https://api.dexcell.com/v3/locations/XXX (where XXX is one of the IDs obtained in the previous call)
Obtain electrical consumption data
How do I create the call?
http://api.dexcell.com/v3/readings + “?” + all the parameters joint by “&”
- device_id: 3473 (id of the device)
- Operation: DELTA (delta readings)
- Parameter_key: EACTIVE (key of the Active Energy parameter)
- Resolution: D (daily). Others: FM, TM, QH, HH, H, D, M
- From: 2016-05-08T00:00:00 (from date with the format YYYY-MM-DDT00:00:00)
- To: 2016-05-10T23:59:59 (to date with the format YYYY-MM-DDT00:00:00)
Obtain electricity cost for a specific device
How I create the call?
http://api.dexcell.com/v3/cost/electrical/consumption + “?” + all the parameters joint by “&”
- device_id: 3473 (id of the device)
- Resolution: M (monthly). Others: FM, TM, QH, HH, H, D, M
- From: 2016-05-08T00:00:00 (from date with the format YYYY-MM-DDT00:00:00)
- To: 2016-05-10T23:59:59 (to date with the format YYYY-MM-DDT00:00:00)
All available queries are described in the platform's developer portal: developers.dexma.com.
Data insertion API
The EM platform offers an API to insert data from external applications. This API is based in HTTPS and JSON.
Check this article to learn how to insert data into your account through the HTTPS/JSON API.