Power BI - Access LMS API Endpoints
The following document describes how to access the secured LMS API Endpoints (example is for a CSMART API) using the Power BI Desktop application. In this process, authentication will be completed in the background and is not needed to provide an access token every time while calling APIs.
Instructions
Open the provided Power BI file in desktop application (File → Open → Browse this Device → select the .pbix file from disk → click Open) and click on Transform data under the Home tab
That will open a new window similar to the following. Now you need to setup the API configuration. For that, select the Home tab and open Manage Parameters → Edit Parameters
Change the parameter values according to your environment where you also need to provide the login credentials (user name and password). You only might need to change the parameters marked in the red box.
After making the changes, click on OK button to confirm. Then select the function
GetConsolidatedReportingData
in the left Queries menu. Provide the ConReportFromDate (i.e. 2023-11-01T00:00Z ) and ConReportToDate (i.e. 2023-12-01T00:00Z ) and click the Invoke button. The function will authenticate and call the API in the background to fetch the data.
You may get a popup like below for the first time you connect to a new domain (parameter
AppDomain
). Click on Edit Credentials and select Anonymous and confirm with Connect.
Click on Close & Apply (top-left of the window).
This will import the data into Power BI and will display the imported data at the right panel where you can select columns for preview. You can later use the data for further processing.
Troubleshoot:
If you get any kind of connection error then follow the following steps.
Clear all the permissions. Data source settings → Global Permissions → Clear Permissions
Follow Step 4 from previous section (only Step 4)
Open this window and change permission to Anonymous connect for each URL listed here.
Again follow from Step 4 from previous section to fetch the data from the API.