The chat responses are generated using Generative AI technology for intuitive search and may not be entirely accurate. They are not intended as professional advice. For full details, including our use rights, privacy practices and potential export control restrictions, please refer to our Generative AI Service Terms of Use and Generative AI Service Privacy Information. As this is a test version, please let us know if something irritating comes up. Like you get recommended a chocolate fudge ice cream instead of an energy managing application. If that occurs, please use the feedback button in our contact form!
Getting started with using Accounts APIs involves the following steps:
Create an account and a machine user.
Create a JSON Web Token (JWT) by using the machine user credentials.
Make API requests using the JWT.
Note
In the following examples we are:
making use of a Linux/MacOS shell in which environmental variables are set using the export-command. In other environments it may be different, e.g. Windows uses the set-command instead.
using the curl as a client. But the API can be used in any programming language with an HTTP Client, e.g. Go, Python, NodeJS, Javascript and Java.
The token, or JWT (JSON Web Token), is the value of the access_token-property in the response. You can now use it by passing it in the Authorization-header of any subsequent API requests. The expires_in-property represents the number of seconds your token is valid, usually, the value corresponds to 24 hours. When this time has elapsed you will need to create a new token.
Store the token in your TOKEN-environmental variable
The first step to perform is to list the UserGroups you have access to. This you can do by performing the Get the usergroups of the caller operation i.e. GET me/usergroups.
The response contains all information about all UserGroups you (the machine user) has access to. If you have a large number of UserGroups you may need to retrieve multiple pages, see Pagination.
The most important information given for each UserGroup is the following:
Property
Description
relationships.authorizedAs
A list of Roles that the UserGroup has
relationships.hasAccessTo
A list of Partitions that the UserGroups has access to
relationships.ownedBy
A reference to the owning Customer
You have access to each partition mentioned above and are now able to use any other API e.g. Building Operations API with these partitions. To learn how to get then names of each Partition and Company please proceed to the next section.
Before you continue, store one of the Customer IDs for which you have access in an environmental variable, you can get the using the Get the usergroups of the caller operation as described above.
To get more information about each of your Partitions you can use the List Partitions for customer operation. Below we specify the include-parameter to include the Company name of each Partition in the included section of the response.