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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Create a function to get postmen access token automatically

Hi everyone

 

I am currently building a report including data from all of your social media, Google Analytics and Google Search Console accounts. Since Power BI desktop has no built-in connector to get data from the Google Search Console, I have created an access token with postmen. I have been successful in creating a connection and getting the respecive data. However, the access token expires all the time. Preferably, I would like to write a function to automate the process of extracting the access token. 

 

Therefore, I would like to know if any of you have ever been able to automate this process? I have found a helpful video online, but I could not perform the exact steps with my account:

Building a Power BI Admin View [Part 2]: Obtaining a Refreshable Access Token - YouTube

 

Any help would be highly appreciated. 

Thanks!

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

1.As you mentioned, you could call the POST API in POSTMAN to get the access token

POST /common/oauth2/token HTTP/1.1
Host: login.windows.net
Cache-Control: no-cache 
Content-Type: application/x-www-form-urlencoded

client_id={client id}&grant_type=password&resource=https%3A%2F%2Fanalysis.windows.net%2Fpowerbi%2Fapi&username={your power bi account}&password={your Power BI password}

2.With the above access_token, you can call the GenerateToken API.

 

 

For dynamically get the access token, please refer to:Call Power BI Rest API with Dynamic Access Token

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

1.As you mentioned, you could call the POST API in POSTMAN to get the access token

POST /common/oauth2/token HTTP/1.1
Host: login.windows.net
Cache-Control: no-cache 
Content-Type: application/x-www-form-urlencoded

client_id={client id}&grant_type=password&resource=https%3A%2F%2Fanalysis.windows.net%2Fpowerbi%2Fapi&username={your power bi account}&password={your Power BI password}

2.With the above access_token, you can call the GenerateToken API.

 

 

For dynamically get the access token, please refer to:Call Power BI Rest API with Dynamic Access Token

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors