Forum Discussion
How to get data from ASP.NET API into power BI
Hi kaym ,
Based on the details you have provided, it appears that you need guidance on building URLs with filter parameters, adding basic authentication, and setting up queries in Power BI. Let us address each of these in turn.
1. To include filter parameters in an API call, you typically need to append them to the URL as query parameters. Since the API is a GET endpoint, you can format the URL this way:
https://operations.example.com/rest/Help/Api/GET-api-zero-equipmentdowntime-reportrawdata_workCenter?WorkCenter=1&WorkCenterCode=sample%20string%201&StartDate=2024-01-30T12:39:44.6483715-05:00&EndDate=2024-01-30T12:39:44.6483715-05:00
For more information on building URLs with filters in Power BI, see the following:
Filter a report using query string parameters in the URL - Power BI | Microsoft Learn
2. To perform basic authentication using encoded user credentials, you can follow these steps in Power BI:
- When connecting to the API, select the Web source from the Get Data option.
- Enter the API URL and select the Advanced option.
- Add a new header under "HTTP Request Header Parameters". The key should be 'Authorisation' and the value should be 'Basic <your_encoded_credentials>'.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.