Skip to main content

Get asset actuals

Base URL: https://api.tensorenergy.jp/v1

Path: /actuals/{ASSET_ID}

Method: GET

Query parameters​

FieldTypeDescriptionRequired
fromstringStarting time for the interval to retrieve actuals from, expressed in the following format: 2006-01-02T15:04:05Ztrue
tostringEnding time for the interval to retrieve actuals to, expressed in the following format: 2006-01-02T15:04:05Ztrue
sourcemetering | iot | monitoringDesired source of actuals. If the parameter is not provided, the query will default to meter data, if meter data does not exist, will fallback to monitoring data.false

Response​

The response is an non-nullable JSON object with the following fields:

FieldTypeDescription
data[AssetActualSet] | nullReturned data from the query. If error is non-null, then this value will be null.
errorError | nullAny error returned from the query. If data is non-null, then this value will be null.

AssetActualSet Object​

FieldTypeDescription
datetimestringTimestamp of the actuals, expressed as an ISO 8601 compliant UTC timestamp.
valuefloatAmount of energy generation, expressed in kilowatt hour (kWh).

Error object​

FieldTypeDescription
messagestringMessage that explains what went wrong.
codeinternal_server_error | not_authorized | invalid_query_parameter | resource_not_foundError code that occurred.

Example request​

curl --request GET \
--url https://api.tensorenergy.jp/v1/actuals/51d5ffcf-1347-4277-93e8-dfca140fe8b3?from=2006-01-02T15:04:05Z&to=2006-01-02T15:04:05Z \
--header "authorization: Bearer ${API_TOKEN}"

Example responses​

Asset exists and no error occurs​

{
"data": [
{
"datetime": "2024-01-01T00:00:00Z",
"value": 9.812
},
{
"datetime": "2024-01-01T00:30:00Z",
"value": 10.1
},
{
"datetime": "2024-01-01T01:00:00Z",
"value": 10.891
}
],
"error": null
}

Error occurs during operation​

{
"data": null,
"error": {
"message": "something went wrong during the process",
"code": "internal_server_error"
}
}

No actuals exists for the asset​

{
"data": [],
"error": null
}