besmart REST API v0.36.5.1
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
https://api.besmart.energy/api
Authentication
- HTTP Authentication, scheme: bearer
- API Key (APIKeyHeader)
- Parameter Name: X-Auth, in: header.
Sensors
Get list of sensor types
Code samples
GET /api/sensors/types HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/sensors/types', headers = headers)
print(r.json())
GET /api/sensors/types
Using this endpoint client gets the list of all sensor types
Example responses
200 Response
[
{
"description": "string",
"id": 0,
"name": "string",
"sensor_custom_fields": "string",
"sensor_state_custom_fields": "string"
}
]
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully read sensor types |
401 | Unauthorized | Not valid authentication credentials |
Response Schema
Status Code 200
Response 200 Api Endpoints Sensors Get Types Api Sensors Types Get
Name | Type | Description |
---|---|---|
Response 200 Api Endpoints Sensors Get Types Api Sensors Types Get | [SensorTypeResponse] | [NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). TODO: Update the class' descriptions SensorTypeResponse - a model defined in OpenAPI description: The description of this SensorTypeResponse [Optional]. id: The id of this SensorTypeResponse [Optional]. name: The name of this SensorTypeResponse [Optional]. sensor_custom_fields: The sensor_custom_fields of this SensorTypeResponse [Optional]. sensor_state_custom_fields: The sensor_state_custom_fields of this SensorTypeResponse [Optional].] |
» SensorTypeResponse | SensorTypeResponse | NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). TODO: Update the class' descriptions SensorTypeResponse - a model defined in OpenAPI description: The description of this SensorTypeResponse [Optional]. id: The id of this SensorTypeResponse [Optional]. name: The name of this SensorTypeResponse [Optional]. sensor_custom_fields: The sensor_custom_fields of this SensorTypeResponse [Optional]. sensor_state_custom_fields: The sensor_state_custom_fields of this SensorTypeResponse [Optional]. |
»» description | string | none |
»» id | integer | none |
»» name | string | none |
»» sensor_custom_fields | string | none |
»» sensor_state_custom_fields | string | none |
Get sensor
Code samples
GET /api/sensors/{client_cid}.{sensor_mid} HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/sensors/{client_cid}.{sensor_mid}', headers = headers)
print(r.json())
GET /api/sensors/{client_cid}.{sensor_mid}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | path | integer | true | Client CID |
sensor_mid | path | integer | true | Sensor MID |
Example responses
404 Response
"string"
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully read sensor information |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Update sensor
Code samples
PUT /api/sensors/{client_cid}.{sensor_mid} HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('/api/sensors/{client_cid}.{sensor_mid}', headers = headers)
print(r.json())
PUT /api/sensors/{client_cid}.{sensor_mid}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | path | integer | true | Client CID |
sensor_mid | path | integer | true | Sensor MID |
node_id | query | integer | false | Node ID |
name | query | string | false | Name of the sensor |
sensor_type_id | query | integer | false | Sensor type ID |
sensor_eid | query | string | false | Sensor external ID |
lat | query | number | false | Sensor latitude |
lon | query | number | false | Sensor longitude |
annotations | query | string | false | Annotations to sensor update, in json format |
info | query | string | false | Additional information, in json format |
comments | query | string | false | none |
uncertain | query | boolean | false | Uncertain sensor |
negligible | query | boolean | false | Negligible sensor |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully updated sensor |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Remove sensor
Code samples
DELETE /api/sensors/{client_cid}.{sensor_mid} HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('/api/sensors/{client_cid}.{sensor_mid}', headers = headers)
print(r.json())
DELETE /api/sensors/{client_cid}.{sensor_mid}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | path | integer | true | Client CID |
sensor_mid | path | integer | true | Sensor MID |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully removed sensor |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Create new sensor
Code samples
POST /api/sensors?client_cid=0&name=string HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/sensors', params={
'client_cid': '0', 'name': 'string'
}, headers = headers)
print(r.json())
POST /api/sensors
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | query | integer | true | Client CID |
name | query | string | true | Name of the sensor |
sensor_type_id | query | integer | false | Sensor type ID |
sensor_eid | query | string | false | Sensor external ID |
lat | query | number | false | Sensor latitude |
lon | query | number | false | Sensor longitude |
info | query | string | false | Additional information, in json format |
comments | query | string | false | none |
uncertain | query | boolean | false | Uncertain sensor |
negligible | query | boolean | false | Negligible sensor |
Example responses
200 Response
null
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successful Response |
201 | Created | Successfully created sensor |
401 | Unauthorized | Not valid authentication credentials |
409 | Conflict | Conflict |
422 | Unprocessable Entity | Unprocessable entity |
Response Schema
Signals
Update sensor state for signal
Code samples
PUT /api/sensors/states/signals/{signal_state_id} HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('/api/sensors/states/signals/{signal_state_id}', headers = headers)
print(r.json())
PUT /api/sensors/states/signals/{signal_state_id}
Using this endpoint client can update sensor state for signal
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
signal_state_id | path | integer | true | Signal state ID |
value_for_since | query | string | false | Value for state start |
value_for_till | query | string | false | Value for state end |
info | query | string | false | Additional information |
Example responses
200 Response
null
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Updated state for signal |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Delete sensor state for signal
Code samples
DELETE /api/sensors/states/signals/{signal_state_id} HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('/api/sensors/states/signals/{signal_state_id}', headers = headers)
print(r.json())
DELETE /api/sensors/states/signals/{signal_state_id}
Using this endpoint client can delete sensor state for signal
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
signal_state_id | path | integer | true | Signal state ID |
Example responses
200 Response
null
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Removed state for signal |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Put multiple signals data
Code samples
PUT /api/sensors/signals/data/v2 HTTP/1.1
Content-Type: application/json
Accept: application/json
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('/api/sensors/signals/data/v2', headers = headers)
print(r.json())
PUT /api/sensors/signals/data/v2
Using this endpoint client can put multiple signals data
Body parameter
[]
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | array | true | none |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully updated signals data |
401 | Unauthorized | Not valid authentication credentials |
422 | Unprocessable Entity | Unprocessable entity |
Response Schema
Get multiple signals data
Code samples
POST /api/sensors/signals/data/v2 HTTP/1.1
Content-Type: application/json
Accept: application/json
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/sensors/signals/data/v2', headers = headers)
print(r.json())
POST /api/sensors/signals/data/v2
Using this endpoint client can get multiple signals data
Body parameter
[]
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | array | true | none |
Example responses
200 Response
[
{
"client_cid": 0,
"sensor_mid": 0,
"signal_type_moid": 0,
"unit": "string",
"time_tstorage": 0,
"time_other": 0
}
]
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully read signal data |
401 | Unauthorized | Not valid authentication credentials |
422 | Unprocessable Entity | Unprocessable entity |
Response Schema
Status Code 200
Response 200 Api Endpoints Sensors Post Signals Data V2 Api Sensors Signals Data V2 Post
Name | Type | Description |
---|---|---|
Response 200 Api Endpoints Sensors Post Signals Data V2 Api Sensors Signals Data V2 Post | [SignalResponse] | none |
» SignalResponse | SignalResponse | none |
»» client_cid | integer | none |
»» sensor_mid | integer | none |
»» signal_type_moid | integer | none |
»» unit | string | none |
»» time_tstorage | number | none |
»» time_other | number | none |
Get signals types
Code samples
GET /api/sensors/signals/types HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/sensors/signals/types', headers = headers)
print(r.json())
GET /api/sensors/signals/types
Using this endpoint client can get all signal types
Example responses
200 Response
[
{
"signal_type_moid": 0,
"symbol": "string",
"description": "string",
"is_incremental": true,
"apply_multiplier": true,
"apply_current_ratio": true,
"apply_voltage_ratio": true,
"obis_mapping": "string",
"chart_expected_unit": "string",
"keep_prefix": true,
"draw_chart": true,
"unit_id": 0,
"unit_symbol": "string",
"group_id": 0,
"group": "string",
"data_processor_type": null,
"chart_expected_summary": [],
"columns": {},
"payload_mapping": {}
}
]
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully read signals types |
401 | Unauthorized | Not valid authentication credentials |
Response Schema
Status Code 200
Response 200 Api Endpoints Sensors Get Signals Types Api Sensors Signals Types Get
Name | Type | Description |
---|---|---|
Response 200 Api Endpoints Sensors Get Signals Types Api Sensors Signals Types Get | [SignalTypesResponse] | [SignalTypesResponse] |
» SignalTypesResponse | SignalTypesResponse | SignalTypesResponse |
»» signal_type_moid | integer | none |
»» symbol | string | none |
»» description | string | none |
»» is_incremental | boolean | none |
»» apply_multiplier | boolean | none |
»» apply_current_ratio | boolean | none |
»» apply_voltage_ratio | boolean | none |
»» obis_mapping | string | none |
»» chart_expected_unit | string | none |
»» keep_prefix | boolean | none |
»» draw_chart | boolean | none |
»» unit_id | integer | none |
»» unit_symbol | string | none |
»» group_id | integer | none |
»» group | string | none |
»» data_processor_type | any | none |
»» chart_expected_summary | array | none |
»»» anonymous | any | none |
»» columns | object | none |
»» payload_mapping | object | none |
Get sensor states for signal
Code samples
GET /api/sensors/states/signals HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/sensors/states/signals', headers = headers)
print(r.json())
GET /api/sensors/states/signals
Using this endpoint client can read signals states for signal
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | query | integer | false | Client CID |
sensor_mid | query | integer | false | Sensor MID |
signal_type_moid | query | integer | false | Signal type MOID |
Example responses
200 Response
[
{
"client_cid": 0,
"info": "string",
"meter_eid": "string",
"meter_type_id": 0,
"meter_type_is_ami": true,
"meter_type_is_dcu": true,
"meter_type_name": "string",
"sensor_mid": 0,
"sensor_state_id": 0,
"signal_states": [],
"since": 0,
"till": 0
}
]
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully read signals states for signal |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Status Code 200
Response 200 Api Endpoints Sensors Get States Signals Api Sensors States Signals Get
Name | Type | Description |
---|---|---|
Response 200 Api Endpoints Sensors Get States Signals Api Sensors States Signals Get | [SignalStatesResponse] | [NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). TODO: Update the class' descriptions SignalStatesResponse - a model defined in OpenAPI client_cid: The client_cid of this SignalStatesResponse [Optional]. info: The info of this SignalStatesResponse [Optional]. meter_eid: The meter_eid of this SignalStatesResponse [Optional]. meter_type_id: The meter_type_id of this SignalStatesResponse [Optional]. meter_type_is_ami: The meter_type_is_ami of this SignalStatesResponse [Optional]. meter_type_is_dcu: The meter_type_is_dcu of this SignalStatesResponse [Optional]. meter_type_name: The meter_type_name of this SignalStatesResponse [Optional]. sensor_mid: The sensor_mid of this SignalStatesResponse [Optional]. sensor_state_id: The sensor_state_id of this SignalStatesResponse [Optional]. signal_states: The signal_states of this SignalStatesResponse [Optional]. since: The since of this SignalStatesResponse [Optional]. till: The till of this SignalStatesResponse [Optional].] |
» SignalStatesResponse | SignalStatesResponse | NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). TODO: Update the class' descriptions SignalStatesResponse - a model defined in OpenAPI client_cid: The client_cid of this SignalStatesResponse [Optional]. info: The info of this SignalStatesResponse [Optional]. meter_eid: The meter_eid of this SignalStatesResponse [Optional]. meter_type_id: The meter_type_id of this SignalStatesResponse [Optional]. meter_type_is_ami: The meter_type_is_ami of this SignalStatesResponse [Optional]. meter_type_is_dcu: The meter_type_is_dcu of this SignalStatesResponse [Optional]. meter_type_name: The meter_type_name of this SignalStatesResponse [Optional]. sensor_mid: The sensor_mid of this SignalStatesResponse [Optional]. sensor_state_id: The sensor_state_id of this SignalStatesResponse [Optional]. signal_states: The signal_states of this SignalStatesResponse [Optional]. since: The since of this SignalStatesResponse [Optional]. till: The till of this SignalStatesResponse [Optional]. |
»» client_cid | integer | none |
»» info | string | none |
»» meter_eid | string | none |
»» meter_type_id | integer | none |
»» meter_type_is_ami | boolean | none |
»» meter_type_is_dcu | boolean | none |
»» meter_type_name | string | none |
»» sensor_mid | integer | none |
»» sensor_state_id | integer | none |
»» signal_states | array | none |
»»» anonymous | any | none |
»» since | integer | none |
»» till | integer | none |
Create sensor state for signal
Code samples
POST /api/sensors/states/{sensor_state_id}/signals?signal_type_moid=0 HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/sensors/states/{sensor_state_id}/signals', params={
'signal_type_moid': '0'
}, headers = headers)
print(r.json())
POST /api/sensors/states/{sensor_state_id}/signals
Using this endpoint client can create signal state for given sensor state
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
sensor_state_id | path | integer | true | State ID |
signal_type_moid | query | integer | true | Signal type moid |
value_for_since | query | string | false | Value for state start |
value_for_till | query | string | false | Value for state end |
info | query | string | false | Additional information |
Example responses
200 Response
null
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successful Response |
201 | Created | Successfully created state for signal |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Update sensor state
Code samples
PUT /api/sensors/states/{sensor_state_id} HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('/api/sensors/states/{sensor_state_id}', headers = headers)
print(r.json())
PUT /api/sensors/states/{sensor_state_id}
Using this endpoint client can update sensor state
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
sensor_state_id | path | integer | true | State ID |
since | query | integer | false | Start date (UTC unix timestamp in ms) |
till | query | integer | false | End date (UTC unix timestamp in ms) |
info | query | string | false | Additional information |
meter_eid | query | string | false | Meter external ID |
meter_type_id | query | string | false | Meter type id |
Example responses
200 Response
null
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Updated state |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
409 | Conflict | Conflict |
422 | Unprocessable Entity | Unprocessable entity |
Response Schema
Delete sensor state
Code samples
DELETE /api/sensors/states/{sensor_state_id} HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('/api/sensors/states/{sensor_state_id}', headers = headers)
print(r.json())
DELETE /api/sensors/states/{sensor_state_id}
Using this endpoint client can delete sensor state
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
sensor_state_id | path | integer | true | State ID |
Example responses
200 Response
null
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Removed state |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Get sensor states
Code samples
GET /api/sensors/states HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/sensors/states', headers = headers)
print(r.json())
GET /api/sensors/states
Using this endpoint client can get all states for given sensor
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | query | integer | false | Client CID |
sensor_mid | query | integer | false | Sensor MID |
Example responses
200 Response
[
{
"client_cid": 0,
"info": "string",
"meter_eid": "string",
"meter_type_id": 0,
"meter_type_is_ami": true,
"meter_type_is_dcu": true,
"meter_type_name": "string",
"sensor_mid": 0,
"sensor_state_id": 0,
"signal_states": [],
"since": 0,
"till": 0
}
]
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully read signals states |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
409 | Conflict | Conflict |
422 | Unprocessable Entity | Unprocessable entity |
500 | Internal Server Error | Server Error |
Response Schema
Status Code 200
Response 200 Api Endpoints Sensors Get States Api Sensors States Get
Name | Type | Description |
---|---|---|
Response 200 Api Endpoints Sensors Get States Api Sensors States Get | [SignalStatesResponse] | [NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). TODO: Update the class' descriptions SignalStatesResponse - a model defined in OpenAPI client_cid: The client_cid of this SignalStatesResponse [Optional]. info: The info of this SignalStatesResponse [Optional]. meter_eid: The meter_eid of this SignalStatesResponse [Optional]. meter_type_id: The meter_type_id of this SignalStatesResponse [Optional]. meter_type_is_ami: The meter_type_is_ami of this SignalStatesResponse [Optional]. meter_type_is_dcu: The meter_type_is_dcu of this SignalStatesResponse [Optional]. meter_type_name: The meter_type_name of this SignalStatesResponse [Optional]. sensor_mid: The sensor_mid of this SignalStatesResponse [Optional]. sensor_state_id: The sensor_state_id of this SignalStatesResponse [Optional]. signal_states: The signal_states of this SignalStatesResponse [Optional]. since: The since of this SignalStatesResponse [Optional]. till: The till of this SignalStatesResponse [Optional].] |
» SignalStatesResponse | SignalStatesResponse | NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). TODO: Update the class' descriptions SignalStatesResponse - a model defined in OpenAPI client_cid: The client_cid of this SignalStatesResponse [Optional]. info: The info of this SignalStatesResponse [Optional]. meter_eid: The meter_eid of this SignalStatesResponse [Optional]. meter_type_id: The meter_type_id of this SignalStatesResponse [Optional]. meter_type_is_ami: The meter_type_is_ami of this SignalStatesResponse [Optional]. meter_type_is_dcu: The meter_type_is_dcu of this SignalStatesResponse [Optional]. meter_type_name: The meter_type_name of this SignalStatesResponse [Optional]. sensor_mid: The sensor_mid of this SignalStatesResponse [Optional]. sensor_state_id: The sensor_state_id of this SignalStatesResponse [Optional]. signal_states: The signal_states of this SignalStatesResponse [Optional]. since: The since of this SignalStatesResponse [Optional]. till: The till of this SignalStatesResponse [Optional]. |
»» client_cid | integer | none |
»» info | string | none |
»» meter_eid | string | none |
»» meter_type_id | integer | none |
»» meter_type_is_ami | boolean | none |
»» meter_type_is_dcu | boolean | none |
»» meter_type_name | string | none |
»» sensor_mid | integer | none |
»» sensor_state_id | integer | none |
»» signal_states | array | none |
»»» anonymous | any | none |
»» since | integer | none |
»» till | integer | none |
Create sensor state
Code samples
POST /api/sensors/states?client_cid=0&sensor_mid=0 HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/sensors/states', params={
'client_cid': '0', 'sensor_mid': '0'
}, headers = headers)
print(r.json())
POST /api/sensors/states
Using this endpoint client can create sensor state for given sensor
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | query | integer | true | Client CID |
sensor_mid | query | integer | true | Sensor MID |
since | query | integer | false | Start date (UTC unix timestamp in ms) |
till | query | integer | false | End date (UTC unix timestamp in ms) |
info | query | string | false | Additional information |
meter_eid | query | string | false | Meter external ID |
meter_type_id | query | integer | false | Meter type id |
Example responses
200 Response
null
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successful Response |
201 | Created | Successfully created state |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
409 | Conflict | Conflict |
422 | Unprocessable Entity | Unprocessable entity |
Response Schema
Get signal data
Code samples
GET /api/sensors/{client_cid}.{sensor_mid}/signals/{signal_type_moid}/data?since=1701945980000&till=1702032380000 HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/sensors/{client_cid}.{sensor_mid}/signals/{signal_type_moid}/data', params={
'since': '1701945980000', 'till': '1702032380000'
}, headers = headers)
print(r.json())
GET /api/sensors/{client_cid}.{sensor_mid}/signals/{signal_type_moid}/data
Using this endpoint client can get signal data
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | path | integer | true | Client CID |
sensor_mid | path | integer | true | Sensor MID |
signal_type_moid | path | integer | true | Signal type MOID |
since | query | integer | true | Start date (UTC unix timestamp) |
till | query | integer | true | End date (UTC unix timestamp) |
get_last | query | boolean | false | Get only records with newest acq time for the same cap times |
delta_t | query | integer | false | Aggregate time (in minutes) |
raw | query | boolean | false | Fetch raw signal |
apply_multiplier | query | boolean | false | Apply multiplier |
output_unit_id | query | integer | false | Output unit id |
signal_origin_id | query | integer | false | Signal origin id |
Example responses
200 Response
{
"client_cid": 0,
"sensor_mid": 0,
"signal_type_moid": 0,
"unit": "string",
"time_tstorage": 0,
"time_other": 0
}
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully read signal data |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Put signal data
Code samples
PUT /api/sensors/{client_cid}.{sensor_mid}/signals/{signal_type_moid}/data/v2 HTTP/1.1
Content-Type: application/json
Accept: application/json
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('/api/sensors/{client_cid}.{sensor_mid}/signals/{signal_type_moid}/data/v2', headers = headers)
print(r.json())
PUT /api/sensors/{client_cid}.{sensor_mid}/signals/{signal_type_moid}/data/v2
Using this endpoint client can put signal data
Body parameter
false
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
client_cid | path | integer | true | Client CID |
sensor_mid | path | integer | true | Sensor MID |
signal_type_moid | path | integer | true | Signal type MOID |
unit | query | string | false | Signal unit |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully updated signal data |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Tasks
Run graph by name
Code samples
POST /api/tasks/graphs/run/name?graph_name=string HTTP/1.1
Content-Type: application/json
Accept: application/json
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/tasks/graphs/run/name', params={
'graph_name': 'string'
}, headers = headers)
print(r.json())
POST /api/tasks/graphs/run/name
Body parameter
null
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
graph_name | query | string | true | Graph name |
task_priority | query | integer | false | Graph priority (defaults to 5) |
task_async | query | boolean | false | Should task be asynchronous |
since | query | integer | false | Start date (UTC unix timestamp) |
till | query | integer | false | End date (UTC unix timestamp) |
body | body | any | true | none |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Graph result (only for synchronous graphs) |
202 | Accepted | Accepted for processing (only for asynchronous graphs) |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Unprocessable entity |
Response Schema
Run graph
Code samples
POST /api/tasks/graphs/run HTTP/1.1
Content-Type: application/json
Accept: application/json
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/tasks/graphs/run', headers = headers)
print(r.json())
POST /api/tasks/graphs/run
Using this endpoint client run graph
Body parameter
null
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
task_priority | query | integer | false | Graph priority (defaults to 5) |
task_async | query | boolean | false | Should task be asynchronous |
since | query | integer | false | Start date (UTC unix timestamp in ms) |
till | query | integer | false | End date (UTC unix timestamp in ms) |
body | body | any | true | none |
Example responses
200 Response
null
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successful Response |
201 | Created | Successfully executed task |
401 | Unauthorized | Not valid authentication credentials |
422 | Unprocessable Entity | Validation Error |
Response Schema
Status Code 201
Response 201 Api Endpoints Tasks Post Graphs Run Api Tasks Graphs Run Post
Name | Type | Description |
---|---|---|
Response 201 Api Endpoints Tasks Post Graphs Run Api Tasks Graphs Run Post | [TaskGraphsRunResponse] | [NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). TODO: Update the class' descriptions TaskExecutionResponse - a model defined in OpenAPI data: The data of this TaskExecutionResponse [Optional].] |
» TaskGraphsRunResponse | TaskGraphsRunResponse | NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). TODO: Update the class' descriptions TaskExecutionResponse - a model defined in OpenAPI data: The data of this TaskExecutionResponse [Optional]. |
»» data | any | none |
Users
Refresh token and get token info
Code samples
GET /api/users/token HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/users/token', headers = headers)
print(r.json())
GET /api/users/token
Client reads endpoint to refresh the token.
Example responses
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully token was refreshed |
401 | Unauthorized | Not valid authentication credentials |
Response Schema
Login and get token
Code samples
POST /api/users/token HTTP/1.1
Content-Type: application/json
Accept: application/json
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Auth': 'API_KEY'
}
r = requests.post('/api/users/token', headers = headers)
print(r.json())
POST /api/users/token
Client logs in to the server with login and password. As a result, they receive a token.
Body parameter
null
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | any | false | none |
Example responses
404 Response
"string"
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | User logged in |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Weather
Get weather data by geoposition
Code samples
GET /api/weather/{lat}/{lon}/{signal_type_moid}/data?since=1577836800000&till=1580515200000 HTTP/1.1
Accept: application/json
import requests
headers = {
'Accept': 'application/json',
'X-Auth': 'API_KEY'
}
r = requests.get('/api/weather/{lat}/{lon}/{signal_type_moid}/data', params={
'since': '1577836800000', 'till': '1580515200000'
}, headers = headers)
print(r.json())
GET /api/weather/{lat}/{lon}/{signal_type_moid}/data
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
lat | path | number | true | Latitude |
lon | path | number | true | Longitude |
signal_type_moid | path | integer | true | Signal type MOID |
since | query | number | true | Start date (UTC unix timestamp) |
till | query | number | true | End date (UTC unix timestamp) |
delta_t | query | integer | false | Aggregate time (in minutes) |
raw | query | boolean | false | Fetch raw signal |
output_unit_id | query | integer | false | Output unit id |
signal_origin_id | query | integer | false | Signal origin id |
is_chart | query | boolean | false | Use expected chart output unit |
Example responses
404 Response
"string"
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Successfully read weather data |
401 | Unauthorized | Not valid authentication credentials |
404 | Not Found | Failed attempt - no resource |
422 | Unprocessable Entity | Validation Error |
Response Schema
Schemas
SensorTypeResponse
{
"description": "string",
"id": 0,
"name": "string",
"sensor_custom_fields": "string",
"sensor_state_custom_fields": "string"
}
SensorTypeResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
description | string | false | none | none |
id | integer | false | none | none |
name | string | false | none | none |
sensor_custom_fields | string | false | none | none |
sensor_state_custom_fields | string | false | none | none |
SignalResponse
{
"client_cid": 0,
"sensor_mid": 0,
"signal_type_moid": 0,
"unit": "string",
"time_tstorage": 0,
"time_other": 0
}
SignalResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
client_cid | integer | false | none | none |
sensor_mid | integer | false | none | none |
signal_type_moid | integer | false | none | none |
unit | string | false | none | none |
time_tstorage | number | false | none | none |
time_other | number | false | none | none |
SignalStatesResponse
{
"client_cid": 0,
"info": "string",
"meter_eid": "string",
"meter_type_id": 0,
"meter_type_is_ami": true,
"meter_type_is_dcu": true,
"meter_type_name": "string",
"sensor_mid": 0,
"sensor_state_id": 0,
"signal_states": [],
"since": 0,
"till": 0
}
SignalStatesResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
client_cid | integer | false | none | none |
info | string | false | none | none |
meter_eid | string | false | none | none |
meter_type_id | integer | false | none | none |
meter_type_is_ami | boolean | false | none | none |
meter_type_is_dcu | boolean | false | none | none |
meter_type_name | string | false | none | none |
sensor_mid | integer | false | none | none |
sensor_state_id | integer | false | none | none |
signal_states | [SensorsStatesSignalStates] | false | none | none |
since | integer | false | none | none |
till | integer | false | none | none |
SignalTypesResponse
{
"signal_type_moid": 0,
"symbol": "string",
"description": "string",
"is_incremental": true,
"apply_multiplier": true,
"apply_current_ratio": true,
"apply_voltage_ratio": true,
"obis_mapping": "string",
"chart_expected_unit": "string",
"keep_prefix": true,
"draw_chart": true,
"unit_id": 0,
"unit_symbol": "string",
"group_id": 0,
"group": "string",
"data_processor_type": null,
"chart_expected_summary": [],
"columns": {},
"payload_mapping": {}
}
SignalTypesResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
signal_type_moid | integer | true | none | none |
symbol | string | false | none | none |
description | string | false | none | none |
is_incremental | boolean | true | none | none |
apply_multiplier | boolean | false | none | none |
apply_current_ratio | boolean | false | none | none |
apply_voltage_ratio | boolean | false | none | none |
obis_mapping | string | false | none | none |
chart_expected_unit | string | false | none | none |
keep_prefix | boolean | false | none | none |
draw_chart | boolean | false | none | none |
unit_id | integer | false | none | none |
unit_symbol | string | false | none | none |
group_id | integer | false | none | none |
group | string | false | none | none |
data_processor_type | DataProcessorType | false | none | none |
chart_expected_summary | [ChartExpectedSummary] | false | none | none |
columns | object | false | none | none |
payload_mapping | object | false | none | none |
TaskGraphsRunResponse
{
"data": null
}
TaskGraphsRunResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
data | TasksGraphsRunData | false | none | none |