Skip to main content

Add asset actuals

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

Path: /actuals/{ASSET_ID}

Method: POST

Query parameters

This API does not require any query parameters.

Body

The request body is expected to provide the following fields:

FieldTypeDescription
sourcemeter_confirmed | meter_preliminary | meter_preliminary_high_voltage | meter_preliminary_low_voltage | monitoring_generic | monitoring_laplaceThe source of the asset actual data.
unitkw | kwhThe unit the asset actual data is in.
data[AssetActualSet]The asset actual data.

Response

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

FieldTypeDescription
successbooleanFlag that indicates if the mutation succeeded or not.
data[AssetActualSet] | nullThe Asset actuals that were added. If success = false, this value will be null.
errorError | nullAny error returned from the query. If success = true, this value will be null.

AssetActualSet Object

FieldTypeDescription
datetimestringTimestamp of the actuals, expressed as an ISO 8601 compliant UTC timestamp. This is expected to be half hour intervals. Ex. 2021-01-01T00:30:00Z or 2021-01-01T01:00:00.
valuefloatAmount of energy generation, expressed in kilowatt hour (kWh).

Error object

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

Example request

curl --request POST \
--url https://api.tensorenergy.jp/v1/actuals/51d5ffcf-1347-4277-93e8-dfca140fe8b3 \
--header "authorization: Bearer ${API_TOKEN}"
--header 'Content-Type: application/json'
--data '{"source": "meter_confirmed", "unit": "kwh", "data":[{"datetime": "2022-01-01T00:00:00Z, "value": 9.12}, {"datetime": "2022-01-01T00:30:00Z, "value": 15.12},{"datetime": "2022-01-01T01:00:00Z, "value": 19.123}]}'

Example responses

Added asset actuals

{
"success": true,
"data": [
{
"datetime": "2022-01-01T00:00:00Z",
"value": 9.12
},
{
"datetime": "2022-01-01T00:30:00Z",
"value": 15.12
},
{
"datetime": "2022-01-01T01:00:00Z",
"value": 19.123
},
],
"error": null
}

Error occurs during operation

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