Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
wdvro
Frequent Visitor

Setting up API calls

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? 

2 REPLIES 2
123abc
Community Champion
Community Champion

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:

  1. 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.

  2. Open Power BI Desktop: Open your Power BI Desktop application.

  3. 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.

  4. 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

 

  1. This code defines a custom function called GetHelloCustomerData that takes an apiEndpoint parameter for the API endpoint URL.

  2. 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

 

  1. Replace "YOUR_API_TOKEN" with your actual API token, and adjust the URL and headers based on Hello Customer's API requirements.

  2. 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.

  3. 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.

nirali_arora
Resolver II
Resolver II

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.