Development API - Create an app

Follow

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:

  1. Introduction
  2. API v3 documentation
  3. Registering an Application
  4. Calls examples

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

Once the app has been registered in the platform you can install it in one of your accounts. The app should respond to the handshake performed by the platform when installing the app in order to obtain the security token 'x-dexcell-token' (also refered to as 'permanent token').

The handshake process is described in the API's technical documentation.

In order to install your app, head over to the Apps Market and follow the process described here.

Call examples

With the app registered and succesfully 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

ae0297a62d7dc329423a6102fa876126ce49b6d75c7a60890ec31b9dd66b8df0.png

 

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)

51df1b07e83cb95d52eca1d3186ed9c5c6c38a4503d7c85807cb75afa5a86023.png


 

Obtain electrical consumption data

url: http://api.dexcell.com/v3/readings?device_id=XXXXX&operation=DELTA&parameter_key=EACTIVE&resolution=D&from=2015-05-08T00:00:00&to=2015-05-09T23:59:59​

4c24fdc2426fd0e89c57a414e958a855549b1e9a8a5f64e065a295051de946e2.png


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

url: http://api.dexcell.com/v3/cost/electrical/consumption?device_id=XXXX&from=2016-04-01T00:00:00&to=2015-12-31T23:59:59&resolution=M

2a97fc1c3b18e3e296146719ddda56b9c1993006faf86d806775f0303a2cbc07.png

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.

 

Was this article helpful?