BI Portal can generate Keys in order to access your BI Portal data. It is simple to create and you can access the API Keys generator by clicking on API Keys under Manage in the drop down menu when you click on the Settings Cog Icon.
When creating your New API Key, it is required that you give it a name so you have a readable label for your Key.
You will then have to select the Key’s Lifetime, which is a set expiry for security purposes, and once selected that will be the time in years that the Key will be valid, unless deleted.
You can then select the Scope of the API Key. A Scope is an area of the application which can be queried through the API. Each Scope relates to a part of functionality that the application has, and if you have the Key to access a particular Scope, you are able to perform available operations within that area of functionality. For example, if you have an API Key for usage, you can query usage data.
Once you click the save button the Key is created. You must copy the generated Key as once you leave this screen it will be hidden and you cannot access it again.
The Key can be viewed once and must be copied as part of this viewing. Otherwise, the user needs to generate a new key by repeating the process.
Keys can be deleted from the BI Portal once they have been created and may no longer be used once deleted.
The API Key is used by providing it as a Header called ApiKey in our request. Once added into the Header field you can extract your data from BI portal when your Key has been input correctly.
Using an application like ‘Postman’, we can easily test our newly generated API key against the entities endpoint.
Clicking ‘Open API Explorer’ from the panel on the right will open the API explorer for the external APIs. This is where you can explore available API Endpoints for your BI Portal.
You can authenticate from within the API Explorer by providing your API Key in the top right api_key section and clicking ‘Explore’.
This Explorer will then provide sample payloads and queries for interacting with BI Portal, where you can see what scopes you have access to and how you can interact with them.