Digiwatt Services API documentation (1.0)

Download OpenAPI specification:Download

Authentication

BearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer

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 calls.
The response returns a json object containing the access token, the token lifetime and the token type.
Token type and access token must set in Authorization header in the following manner in order to be authorized: token_type access_token.
Example: Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJiajE5UDNVT3psaEFGdVA3OXNXbl9PTE5EN1F1LUpJRV9oWU9wSlBKeENJIn0.eyJleHAiOjE2MzQwOTA5MzEsImlhdCI6MTYzNDA1NDkzMSwianRpIjoiY2JiZTc3YTEtZGM5Zi00YTU3LWI3ZjgtZmZhYTBhOTc4NGE5IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrLmFpYWFzLmxvY2FsOjgwODAvYXV0aC9yZWFsbXMvYWlhYXMiLCJzdWIiOiJmMDRlZmIxOS1iMzg1LTRlZjUtODJjYi0yMzQ3MmE1Zjg5YzIiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJjbGllbnQxIi...

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"
}

Estimated Costs

The costs in the specified period and the trend compared to previous period.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"

One of the allowed values that represent the requested period.

Responses

Response samples

Content type
application/json
{
  • "value": 29.63,
  • "previousPeriodValueTrend": 20
}

Consumption

The consumptions in the specified period and the trend compared to previous period.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"

One of the allowed values that represent the requested period.

Responses

Response samples

Content type
application/json
{
  • "value": 73.61,
  • "previousPeriodValueTrend": 19
}

Consumption Distribution

The total consumptions for each appliance in the specified period.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"

One of the allowed values that represent the requested period.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Performance

The user's performance in the specified period compared to similar users.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"

One of the allowed values that represent the requested period.

Responses

Response samples

Content type
application/json
{
  • "minConsumption": 10,
  • "maxConsumption": 130,
  • "userConsumption": 73.61
}

Savings

The consumptions information collected in the last 30 days.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

Responses

Response samples

Content type
application/json
{
  • "estimatedConsumption": 253900,
  • "estimatedCost": 101.9,
  • "performance": {
    },
  • "washingMachine": {
    },
  • "dishwasher": {
    },
  • "fridge": {
    },
  • "standby": {
    }
}

Consumption History

The consumptions history of the last 12 months.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Costs History

The costs history of the last 12 months.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

Responses

Response samples

Content type
application/json
{
  • "forecast": {
    },
  • "costs": [
    ]
}

Yearly Consumption Distribution

The consumptions history for each appliance of the last 12 months.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Yearly Compound Consumption

The compound consumptions of the last 12 months.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Disaggregation

The disaggregated consumptions for each appliance in the specified period.

Authorizations:
path Parameters
smartmeterId
required
string (SmartmeterId)
Example: 125fd56

ID of the smartmeter. It must be any non-empty string without whitespaces.

period
required
string (Period)
Enum: "yesterday" "last-seven-days" "this-week" "last-week" "this-month" "last-month"

One of the allowed values that represent the requested period.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]