Account API¶
This API provides information for accounts and devices owned by the account.
- GET /account/api/(target)¶
Get information for the specified target, which can be account, gateway, or meter.
- Query Parameters:
key (string) – the owner account key. Used to authenticate request.
id (string) – the target id (ie. meter address). There can be multiple ids. Ignored for account targets, only a key is necessary.
deep (boolean) – optional - include child device metadata.
state (boolean) – optional - include state data (such as last kWh meter reading).
indent (int) – optional - pretty print the json output using the indent value.
- Request Headers:
Content-Type – application/json
- Status Codes:
200 OK – request succeeded
400 Bad Request – when parameters are invalid
Targets¶
Account JSON¶
- key:
(string) The account key
- key_type:
(string) One of ‘account’, ‘gateway’, or ‘meter’
- host:
(string) The data collector host associated with this account
- gateways:
(list) A list of gateways owned by this account
- meters:
(list) A list of meters owned by this account
- metersets:
(list) A list of meter sets owned by this account
Example:
GET /account/api/account?key=MTAxMDoyMDIw HTTP/1.1
Host: api.ekmpush.com
Accept: application/json
curl -i -X GET 'https://api.ekmpush.com/account/api/account?key=MTAxMDoyMDIw' -H "Accept: application/json"
HTTP/1.1 200 OK
Content-Type: application/json
{
"key": "MTAxMDoyMDIw",
"key_type": "account",
"host": "psrv1.ekmmetering.com",
"gateways": [
{
"mac_address": "4016fa010226"
},
{
"mac_address": "4016fa010912"
},
{
"mac_address": "4016fa000217"
},
{
"mac_address": "4016fa010930"
},
{
"mac_address": "4016fa0100da"
},
{
"mac_address": "4016fa010021"
},
{
"mac_address": "4016fa010006"
},
{
"mac_address": "4016fa010053"
},
{
"mac_address": "4016fa0500d7"
},
{
"mac_address": "4016fa050012"
},
{
"mac_address": "4016fa0500cd"
}
],
"meters": [
{
"address": "000000000099"
},
{
"address": "000000010388"
},
{
"address": "000000010389"
},
{
"address": "000000015635"
},
{
"address": "000000017507"
},
{
"address": "000300000930"
},
{
"address": "000300001240"
},
{
"address": "000300001290"
},
{
"address": "000300002509"
},
{
"address": "000300002513"
},
{
"address": "000300002524"
},
{
"address": "000300002581"
},
{
"address": "000300002585"
},
{
"address": "000300002588"
},
{
"address": "000300002589"
},
{
"address": "000300002600"
},
{
"address": "000300002617"
},
{
"address": "000300002841"
},
{
"address": "000300004127"
},
{
"address": "000300004128"
},
{
"address": "000300004129"
},
{
"address": "000350000900"
},
{
"address": "000350005367"
},
{
"address": "000550001039"
}
],
"sets": {}
}
Try it:
Gateway JSON¶
- gateways:
(list) A list of gateways owned by this account
GET /account/api/gateway?key=MTAxMDoyMDIw&id=4016fa0500cd&state=true HTTP/1.1
Host: api.ekmpush.com
Accept: application/json
curl -i -X GET 'https://api.ekmpush.com/account/api/gateway?key=MTAxMDoyMDIw&id=4016fa0500cd&state=true' -H "Accept: application/json"
HTTP/1.1 200 OK
Content-Type: application/json
{
"gateways": [
{
"key": "NjUyNTQwNzI6dUU5N2F3MEFOMmxSdlVadTM0",
"mac_address": "4016fa0500cd",
"timezone": "US/Pacific",
"name": "",
"firmware": "Push3: Embedded-0.01-ekmboard1",
"update_interval": 120,
"push_version": "Push3",
"state": {
"timestamp": "2021-02-01T19:47:24.341000+00:00",
"build": "1.6519",
"lan_ip": "10.100.253.132"
},
"meters": [
{
"address": "000350000900"
}
]
}
]
}
Try it:
Meter JSON¶
- meters:
(list) A list of meters owned by this account
GET /account/api/meter?key=MTAxMDoyMDIw&id=000350000900&state=true HTTP/1.1
Host: api.ekmpush.com
Accept: application/json
curl -i -X GET 'https://api.ekmpush.com/account/api/meter?key=MTAxMDoyMDIw&id=000350000900&state=true' -H "Accept: application/json"
HTTP/1.1 200 OK
Content-Type: application/json
{
"meters": [
{
"key": "NjUyNDI4MjI6eDFXaEVyeVA",
"address": "000350000900",
"name": "",
"interval": 4000,
"version": "v4",
"gateway_mac": "4016fa0500cd",
"set_id": null,
"model_name": "Omnimeter v4",
"state": {
"timestamp": "2021-01-25T22:46:12.087000+00:00",
"kwh": 0,
"watts": 0
}
}
]
}
Try it: