The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
Our organization uses Hello Customer, a tool to conduct surveys as part of measuring customer satisfaction.
Hello Customer allows data to be imported via an API into a BI application, such as Power BI.
There's documentation on how to setup the API calls on this site.
Tricky is the autorenewal for the token (I used to use a more simple API connection method, but the calls were limited to one month).
I need the "3d. Read. Answers" option.
However, I have no idea how to start setting up this connection in Power BI Desktop.
I hope someone can help me?
Setting up API calls in Power BI Desktop to fetch data from an external service like Hello Customer typically involves creating a custom function in Power Query Editor and setting up the necessary authentication and request headers. Here are the general steps to get started:
Get API Documentation: First, make sure you have access to the API documentation provided by Hello Customer. This documentation should include details on the API endpoints, authentication methods, and request parameters.
Open Power BI Desktop: Open your Power BI Desktop application.
Access Power Query Editor: In Power BI Desktop, go to the "Home" tab, and click on "Transform data." This will open the Power Query Editor.
Create a Custom Function: In the Power Query Editor, you can create a custom function to make API calls. To do this, follow these steps:
a. In the Power Query Editor, click on "Home" > "New Source" > "Blank Query."
b. In the formula bar at the top, give your query a name and start defining your custom function. For example:
let GetHelloCustomerData = (apiEndpoint as text) => let // Your code to make the API request goes here in // Your code to process the API response goes here in GetHelloCustomerData
This code defines a custom function called GetHelloCustomerData that takes an apiEndpoint parameter for the API endpoint URL.
Add Code for API Request and Authentication: Inside the custom function, you'll need to add code to make the API request. This may involve setting up authentication (such as OAuth2, API keys, or tokens) as per the Hello Customer API documentation.
You can use functions like Web.Contents to send HTTP requests, and Json.Document to parse JSON responses. Here's a simplified example:
let GetHelloCustomerData = (apiEndpoint as text) => let authToken = "YOUR_API_TOKEN", apiUrl = "https://api.hellocustomer.com" & apiEndpoint, headers = [#"Authorization" = "Bearer " & authToken], source = Json.Document(Web.Contents(apiUrl, [Headers=headers])) in source in GetHelloCustomerData
Replace "YOUR_API_TOKEN" with your actual API token, and adjust the URL and headers based on Hello Customer's API requirements.
Invoke the Custom Function: Once you've defined the custom function, you can invoke it to fetch data. You can do this by creating a new query or using the custom function in an existing query.
Load Data into Power BI: After retrieving the data using the custom function, you can transform and shape the data as needed in Power Query Editor. When you're satisfied with the data, click the "Close & Apply" button to load it into Power BI Desktop.
Remember that the exact implementation details, such as authentication method and request parameters, will depend on the specifics of Hello Customer's API documentation. Be sure to refer to their documentation for the most accurate and up-to-date information on how to connect and retrieve data from their service.
You can refer this
Rest source - Token based
https://www.advaiya.com/generate-dynamic-token-and-get-data-from-custom-api-in-power-bi/
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
78 | |
68 | |
52 | |
50 |
User | Count |
---|---|
121 | |
119 | |
77 | |
62 | |
61 |