The access token is by default valid for 30 minutes, or 1800 seconds. This is also indicated when you make the API call to the token endpoint. When the token expires, you can either request a new one, or use the refresh token to receive a new access token.

The possible values for this parameter are: HOURS, DAYS, WEEKS, MONTHS, YEARS. For instance, if you make a GET call to the /consumption/gas/data endpoint you need to use this parameter. 

These fields should be timestamps (in milliseconds). You can use to convert a date to a timestamp and add three zeros at the end (the milliseconds). An example call could be:

curl -X GET -H "Authorization: Bearer <oauth bearer token>"{agreement}/consumption/electricity/data?fromTime=1447974000000&toTime=1449152840000

This error indicates the Content-Type is not provided or is incorrect. This is a header that needs to be set on a request. For this request, the parameters are given in the x-www-form- urlencoded  format. This means the provided headers will be ‘Content-Type: application/x-www-form- urlencoded ’.

The Toon Open API makes use of OAuth2 authentication. This means that every API call should include an authorization header with your specific access token. To get this token you need to make a call to the token endpoint which will give your access token as a response. Learn more on calling and using the access token on the Authentication page.