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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply

Rest API get call in power bi with headers and token

Hi experts.

I need step by step guide for REST API Get call.

I got an azure app id.

I got a token via postman.

And how can I get data in power bi?

Most difficult thing is headers of API call and token refresh in power bi for refresh data set.

I can't even query data set in power bi yet.

Could any please help me with this...

1 ACCEPTED SOLUTION

Hi  @CrouchingTiger 

Thank you for using Microsoft Community Forum. thanks @rohit1991 @bhanu_gautam for your inputs. in addition am adding below points.

 

You don’t need to include all headers—only those required for the API call to succeed. Typically, this includes the Authorization header (e.g., Bearer YOUR_ACCESS_TOKEN), Content-Type (usually application/json), and any custom headers specified by the API documentation. In Power Query, headers are added in the Advanced Editor using M code, where you define them within a Headers record passed to the Web.Contents function. Power Query doesn't offer a separate UI for adding multiple headers, so you'll need to input them directly in the script. If you’re unsure which headers are necessary, start with the essentials and add others only if the API response indicates missing or invalid headers.

 

If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

View solution in original post

8 REPLIES 8

Thank you for reply.

I already saw that video. And others but what kind of headers have to put in?

rohit1991
Super User
Super User

Hi @CrouchingTiger ,

 

Step-by-step to call a REST API with headers and token in Power BI:

  1. Start a Blank Query: In Power BI Desktop, go to Get Data > Blank Query, then open the Advanced Editor.

  2. Write your API call using Web.Contents.

     

     3.Load and transform: Power BI will load the JSON, and you can shape or expand it as needed.

Power BI Desktop will work with a manually generated token, but scheduled refresh in the Power BI Service doesn’t natively handle dynamic token refresh. If you need to automate token renewal, you might need to create a custom connector, or use an Azure Function/Logic App as an intermediate step. Make sure your token is valid and hasn’t expired.  Double-check endpoint and headers if you get errors. 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Thank you for reply.

I have many headers.

And do I have to put in all headers in advanced option? In power query?

Hi  @CrouchingTiger 

Thank you for using Microsoft Community Forum. thanks @rohit1991 @bhanu_gautam for your inputs. in addition am adding below points.

 

You don’t need to include all headers—only those required for the API call to succeed. Typically, this includes the Authorization header (e.g., Bearer YOUR_ACCESS_TOKEN), Content-Type (usually application/json), and any custom headers specified by the API documentation. In Power Query, headers are added in the Advanced Editor using M code, where you define them within a Headers record passed to the Web.Contents function. Power Query doesn't offer a separate UI for adding multiple headers, so you'll need to input them directly in the script. If you’re unsure which headers are necessary, start with the essentials and add others only if the API response indicates missing or invalid headers.

 

If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

Hi @CrouchingTiger 
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

Hi @CrouchingTiger 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

Hi @CrouchingTiger 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

bhanu_gautam
Super User
Super User

@CrouchingTiger , Go through this

 

https://www.youtube.com/watch?v=lJFKdLFFR1g




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.