cancel
Showing results for 
Search instead for 
Did you mean: 
0

Connecting to Web Data Source using Basic Authorization Key

Hi,

 

I'm trying to fetch data using api. In doing so, I'm selecting Get Data -> Web, and providing the URL, Authorization as Key and Basic xyzxyz(the actual key) as value of the header.  However I keep getting DataSource.Error "We are unable to retrieve the contents of the web page." 

I'm able to get the results in JSON when I use curl or Postman to make a request. Seeking some help on using Power BI to fetch the data so that I can create vizualizations.

 

Thanks,

Sandeep

Status: Delivered

Hi @sandeep_43 ,

 

This is indeed a very good workaround.I will change the status to "Delivered"

 

Best regards,

Community Support Team Selina zhu

Comments
v-mengzhu-msft
Community Support
Status changed to: Investigating

Hi @sandeep_43 ,

 

Do you necessarily need to use an API to connect to a web data source?

If you need to get data to create reports, you can connect directly from power bi to the web data source.

Data sources for Power BI - Power BI | Microsoft Learn

 

Best regards,

Community Support Team Selina zhu

sandeep_43
New Member

Hi @v-mengzhu-msft,

 

Thanks for posting the suggestion, it did help a bit. And yes, using the API would be a better solution to get the data. Here are the 3 possible solutions I could think of as a workaround:

 

1. Run any script that can use curl command (or use power Automate or any other automation technique) to download data -> save that data to Sharepoint (or any suitable location) -> Load it in Power BI

 

2. Use Python script to get the data (but you have to take care of the pre-requisites as well)

 

3. Use Power Query to get the data. This one worked like a charm. I followed example from this reference doc:

https://learn.microsoft.com/en-us/powerquery-m/web-contents?source=recommendations

I'm currently using the 3rd solution until the original method starts to work.

 

Thanks,

Sandeep

v-mengzhu-msft
Community Support
Status changed to: Delivered

Hi @sandeep_43 ,

 

This is indeed a very good workaround.I will change the status to "Delivered"

 

Best regards,

Community Support Team Selina zhu