Skip to main content

Get analytics

Description#

This endpoint is used to retrieve some analytics data related to a given chargebox.

Request format#

Method: GET

Endpoint: https://api.thor.tools/latest/integration/analytics/{chargebox_id}

Response format#

The response is a JSON containing the information related to the requested chargebox with the following fields:

Field nameTypeDescription
active_sinceStringThe ISO 8601 formatted date since the chargebox is online.
chargesObject
charges.last_7IntegerThe number of charges performed by the chargebox in the last 7 days.
charges.last_30IntegerThe number of charges performed by the chargebox in the last 30 days.
charges.last_60IntegerThe number of charges performed by the chargebox in the last 60 days.
disconnectionsObject
disconnections.last_7IntegerThe number of disconnections the chargebox suffered in the last 7 days.
disconnections.last_30IntegerThe number of disconnections the chargebox suffered in the last 30 days.
disconnections.last_60IntegerThe number of disconnections the chargebox suffered in the last 60 days.
energyObject
energy.last_7IntegerThe total energy (in Wh) delivered by the chargebox in the last 7 days.
energy.last_30IntegerThe total energy (in Wh) delivered by the chargebox in the last 30 days.
energy.last_60IntegerThe total energy (in Wh) delivered by the chargebox in the last 60 days.
usersObject
users.last_7IntegerThe number of unique users that charged their vehicles on this chargebox in the last 7 days.
users.last_30IntegerThe number of unique users that charged their vehicles on this chargebox in the last 30 days.
users.last_60IntegerThe number of unique users that charged their vehicles on this chargebox in the last 60 days.

A succesful response is returned with an HTTP status code 200 - OK

caution

The energy fields might be equal to 0 if the chargebox does not provide metering data related to the charges.

Example response#

{
"active_since": "2020-09-03T13:41:35.029Z",
"charges": {
"last_7": 4,
"last_30": 21,
"last_60": 24
},
"disconnections": {
"last_7": 0,
"last_30": 2,
"last_60": 2
},
"energy": {
"last_7": 423,
"last_30": 2378,
"last_60": 5496
},
"users": {
"last_7": 12,
"last_30": 14,
"last_60": 19
}
}

Error response#

The following errors are returned if something went wrong while processing the request:

HTTP status codeMessageDescription
403APIKeyNotFoundAn invalid API key was given in the header of the request.
403RestAPINotEnabledREST API integration is set as disabled in the administration dashboard.
403InvalidSourceIPAddrThe request comes from an IP address that is different from the one given in the REST API integration configuration.
404ChargeboxNotFoundNo chargebox with the give identifier was found.
500InternalServerErrorSomething unexpected went wrong while executing the request.