Digiwatt API (1.0)

Download OpenAPI specification:

Token authentication

The authentication flow follow the OAuth2 specification for client credentials grant: the client must call the /auth/token endpoint to get the bearer token that will use later to autheticate api requests.
The response returns a json object containing the access token, the token lifetime and the token type.
Token type and access token must be set in Authorization header in the following manner in order to be authorized: token_type access_token.
Example: Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJiajE5UDNVT3psaEFGdVA3OXNXbl9PTE5EN1F1LUpJRV9oWU9wSlBKeENJIn0.eyJleHAiOjE2MzQwOTA5MzEsImlhdCI6MTYzNDA1NDkzMSwianRpIjoiY2JiZTc3YTEtZGM5Zi00YTU3LWI3ZjgtZmZhYTBhOTc4NGE5IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrLmFpYWFzLmxvY2FsOjgwODAvYXV0aC9yZWFsbXMvYWlhYXMiLCJzdWIiOiJmMDRlZmIxOS1iMzg1LTRlZjUtODJjYi0yMzQ3MmE1Zjg5YzIiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJjbGllbnQxIi...

Authentication

The OAuth2 client_credentials authentication flow.

Request Body schema: application/x-www-form-urlencoded
client_id
string
client_secret
string
grant_type
string
Default: "client_credentials"

Responses

Response samples

Content type
application/json
{
  • "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJiajE5UDNVT3psaEFGdVA3OXNXbl9PTE5EN1F1LUpJRV9oWU9wSlBKeENJIn0.eyJleHAiOjE2MzQwOTA5MzEsImlhdCI6MTYzNDA1NDkzMSwianRpIjoiY2JiZTc3YTEtZGM5Zi00YTU3LWI3ZjgtZmZhYTBhOTc4NGE5IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrLmFpYWFzLmxvY2FsOjgwODAvYXV0aC9yZWFsbXMvYWlhYXMiLCJzdWIiOiJmMDRlZmIxOS1iMzg1LTRlZjUtODJjYi0yMzQ3MmE1Zjg5YzIiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJjbGllbnQxIi...",
  • "expires_in": 36000,
  • "token_type": "Bearer"
}

User

The user creation endpoint.

Authorizations:
BearerAuth
Request Body schema: application/json
pod
required
string (POD) = 20 characters ^[A-Z]{2}[0-9A-Z]{3}[A-Z0-9]{14}$
account_number
required
string (AccountNumber)
company_code
required
string (CompanyCode)

Responses

Request samples

Content type
application/json
{
  • "pod": "IT001E1234567890AB",
  • "account_number": "1234567890",
  • "company_code": "string"
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user deletion endpoint.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user onboarding endpoint.

The onboarding endpoint is used to collect information about the user and their household in order to provide personalized more accurate consumption informations.
The request body should contain the user's house type, dimensions, province, number of residents (adults, children, elderlies), and a list of appliances with their quantities.
If no applicances are specified, a default set of appliances will be used.
The response will include the account number and the onboarding data that was submitted.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890
Request Body schema: application/json
object
type
string
Enum: "apartment" "townhouse" "detached" "second"
dimesion
integer
province
string = 2 characters ^[A-Z]{2}$
object or object or object
One of
adults
required
integer >= 1
children
required
integer
elderlies
required
integer
Array of objects
Array
appliance
required
string
Enum: "airConditioner" "boiler" "chargingStation" "dishwasher" "electricHeater" "electricVehicle" "fridge" "heatPump" "inductionCooktop" "microwave" "oven" "solarBattery" "solarPanel" "television" "washingMachine"
quantity
required
integer >= 1

Responses

Request samples

Content type
application/json
{
  • "house": {
    },
  • "residents": {
    },
  • "appliances": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

Consumption

The user consumption endpoint.

The consumption endpoint is used to retrieve the user's consumption data in watt for appliances for a specified period.
The period can be one of the following: yesterday, last-seven-days, this-week, last-week, this-month, last-month.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890
period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"
  • yesterday - Yesterday
  • last-seven-days - Last seven days starting from today
  • this-week - This week from monday to today
  • last-week - Last week
  • this-month - This week from the first day of month to today
  • last-month - Last month

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user consumption totals endpoint.

The consumption distribution endpoint is used to retrieve the user's consumption distribution data in watt-hour for every appliances for a specified period.
The period can be one of the following: yesterday, last-seven-days, this-week, last-week, this-month, last-month.
The response will include the total consumption compared to previous period.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890
period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"
  • yesterday - Yesterday
  • last-seven-days - Last seven days starting from today
  • this-week - This week from monday to today
  • last-week - Last week
  • this-month - This week from the first day of month to today
  • last-month - Last month

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user realtime consumption endpoint.

The realtime consumption endpoint is used to retrieve the user's total realtime consumption data in watt
The response will include the total consumption.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user latest consumption endpoint.

The latest consumption endpoint is used to retrieve the user's latest six hours global consumption data in watt.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user consumption performance endpoint.

The consumption performance endpoint is used to retrieve the user's consumption performance data in watt-hours for the pecified period compared to the consumptions of other similar users.
The response will include the minimum, maximum and user consumption values.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890
period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"
  • yesterday - Yesterday
  • last-seven-days - Last seven days starting from today
  • this-week - This week from monday to today
  • last-week - Last week
  • this-month - This week from the first day of month to today
  • last-month - Last month

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user consumption habits endpoint.

The consumption habits endpoint is used to retrieve the user's consumption habits data in watt-hour for the specified period.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890
period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"
  • yesterday - Yesterday
  • last-seven-days - Last seven days starting from today
  • this-week - This week from monday to today
  • last-week - Last week
  • this-month - This week from the first day of month to today
  • last-month - Last month

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

Analytics

The user consumption trend endpoint.

The consumption trend endpoint is used to retrieve the user's consumption trend data in watt-hour for the last 12 months segmented by tariff periods.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user consumption distribution endpoint.

The consumption distribution endpoint is used to retrieve the user's consumption distribution data in watt-hour for user's appliances for the last 12 months.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

The user consumption compound endpoint.

The consumption compound endpoint is used to retrieve the user's consumption compound data in watt-hour for user's appliances for the last 12 months.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

Saving

The consumptions information collected in the last 30 days.

Authorizations:
BearerAuth
path Parameters
account_number
required
string (AccountNumber)
Example: 1234567890

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}

Greenness

The greenness endpoint.

The greenness endpoint is used to retrieve the best windows for green energy consumption, where renewable energy production is higher.
The response will include the percentage of renewable energy produced and the start and stop time of the best windows where it is recommended to consume energy.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "data": {
    }
}