What you’ll need:
- A user account at Energimolnet (with facilities)
- A developer account for Energimolnet. i.e., Client ID and Client Secret
- [optional] A refresh token from Energimolnet.
If you want to test how to use the Energimolnet API you should find your user account (the one with facilities) and then:
- Log in to Energimolnet with that user account https://app.energimolnet.se (remain logged in)
- Open a new tab and go to https://app.energimolnet.se/api/1.1/users/me/meters?opt_pretty=1
- Open http://app.energimolnet.se/api/1.1/Documentation in another tab
- Click the link in the List Meter Points section that says something like (note: the access token will be different): http://app.energimolnet.se/api/1.1/users/me/meters?access_token=0e639611a263e61141893b9cbc4c5365b3402114&opt_pretty=1
- You should see same response in both tabs. It should look like this and list all of the facilities in the account you are logged in as:
The access token in the second request is simply a token that makes sure the developer is allowed to look at that specific user’s data. We’ve made it so that you can test any request when you are logged in without worrying about implementing the OAuth security protocol. Of course you can only ever access your own data with this technique but it makes it easy to see what the request should be when you’re implementing in your own software.
If you’ve been given a refresh token by Playback Energy then you can get started by following the instructions that begin with Access Token request (using a Refresh Token). You simply send a POST request to the URL listed and include your client id, your client secret and the refresh token we gave you. You will get back an access token that will work for 3600 seconds.
After that token is expired you will receive a 401 error whenever you try and request and you will need to POST for a new Access Token.