Connect an app
Apps, such as your community’s website, an energy app or a home battery, read your community’s data from its API. Each app gets its own API token: a key that proves it may.
Creating a token
Section titled “Creating a token”- On the API tokens tab, click New token.
- Give it a name, such as
website, and a description of which app uses it. - Optionally, choose a date from which it expires.
- Click Create.
- Copy the key and give it to the app’s developer, or paste it into the app.
Once your community has a token, every request to its API needs one.
What the app needs
Section titled “What the app needs”Give the app’s developer:
- the API address, from the top of your community’s page;
- the key;
- the addresses of the modules it should use, such as
/tariff/day-ahead/v1; - a link to these docs.
An app sends the key in a header, Authorization: Bearer <key>, or, where it can’t set headers, in the address: ?token=<key>.
Trying it in your browser
Section titled “Trying it in your browser”Every community’s API describes itself. Open your API address followed by /docs?token=<key>: you see every module, and can try each one with Try it out.
Stopping an app
Section titled “Stopping an app”Delete its token on the API tokens tab: from then on, the app can no longer reach your API. The other apps keep working, since each has its own token.