How to generate the access token automatically utilizing the web connector?
Overview:
In Bold BI, access tokens can be generated by utilizing a web data source with the refresh option enabled. Once the token is obtained in the data source, the dashboard parameter can be configured to utilize the token. This allows for the invocation of the required API in another data source by utilizing the parameter in the authorization header.
Steps to generate the token through web connector:
-
Create the web API data source with the specified parameters and click on the “Preview & Connect” button.
-
The access token will be displayed in the preview grid. Now click on the “Connect” button.
-
Choose the
access_token
as a parameter in the data source under the dashboard parameter option.
-
Set up the refresh settings for this data source based on the token expiry time, ensuring that the refresh option triggers after 5 minutes to obtain a new token which will be available in a parameter called ‘Token’.
-
Use the created dashboard parameter ‘Token’ in authorization header of another Web API data source.
Syntax: Bearer @{{:DataSourceName.ParameterName}}
The access token will be generated automatically in the actual data source every 5 minutes, and the web API will utilize the token to retrieve results.