cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
saranrajk
Helper II
Helper II

how to get list of dataset and datasources using Power BI report server rest API?

Hi,

 

I'm trying to get data from power BI report server through rest API, 

I can get list of kpi, catalog items and so on.

 

I have attached my data sources image and and slo my report server home image

But I'm not be able to get the data sets and data sources.

When I call the following url I'm getting the empty array.

{
  "@odata.context":"http://<server_name>/Reports/api/v2.0/$metadata#DataSources","value":[
    
  ]
}

Please see this image If you wanna view my power bi report server homePlease see this image If you wanna view my power bi report server home

Please see this imagePlease see this image

8 REPLIES 8
d_gosbell
Super User II
Super User II

The details of the endpoint your are calling don't seem to have pasted in correctly, but the picture you are showing looks like the data sources for a specific PBIX file.

 

To get those details you would have to use the /PowerBIReports endpoint to get the ID of your report, then you could call the /PowerBIReports({Id})/DataSources endpoint (see https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/GetPowerBIReportDataSources)

Yes, It's a data sources but even if I url the following url to get the list of data sources I'm getting empty array.

http://<server name>/Reports/api/v2.0/DataSources

Where I can find data sets,I'm seeing only data sources.

 

Yes, so like I mentioned earlier you need to use the /PowerBIReport endpoint to get the data sources for a pbix file.

 

The endpoint you are using only returns shared data sources for paginated reports.

 


@saranrajk wrote:

Where I can find data sets,I'm seeing only data sources.

 


It depends on what you mean by "data sets" in Power BI Report Server terminology "shared data sets" are created for paginated reports using the Visual Studio designers. Unlike the powerbi.com service, Power BI Report Server does not currently support the ability to connect other reports or reporting tools to the "data set" inside another pbix file if this is what you are trying to do. 

So, you are saying that data sets is not available in Power BI report server right?

If so, I have seen the API to get datasets and get data from the datasets in swagger hub.

https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/DataSets/GetDataSets

 If I'm using this API I'm getting an empty array.

And one more thing that, how can I get data from the data sources.

Please refer the below link, he is getting data through API.

https://www.c-sharpcorner.com/article/rest-apis-for-power-bi-report-server/

 

 


@saranrajk wrote:

So, you are saying that data sets is not available in Power BI report server right?

If so, I have seen the API to get datasets and get data from the datasets in swagger hub.

https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/DataSets/GetDataSets

 If I'm using this API I'm getting an empty array.

And one more thing that, how can I get data from the data sources.

Please refer the below link, he is getting data through API.

https://www.c-sharpcorner.com/article/rest-apis-for-power-bi-report-server/

 


So both that API endpoint and the article you reference require that you have created a Share Data Set object using the Visual Studio Reporting Services designer and then have deployed that to your server. Once you have done that you will be able to list any of these that you have deployed and connect to them as demonstrated in that article.

Oh, Okay thanks for the information and I also wanna know how to get data from the data sources.

Is that possible?

And If I created the shared data set, can I able acces data only from the particular data or I can access data based on data modelling.

for example I have one fact table(sales) and one dimension table(city) can I get data on sales by city through API, is that possible? 


@saranrajk wrote:

Oh, Okay thanks for the information and I also wanna know how to get data from the data sources.

Is that possible?


No this is not possible on Power BI Report Server

 


And If I created the shared data set, can I able acces data only from the particular data or I can access data based on data modelling.

for example I have one fact table(sales) and one dimension table(city) can I get data on sales by city through API, is that possible? 


The shared data sets are basically just a stored SQL SELECT statement that you can execute via the API. They are not a data model. You cannot use them for ad-hoc queries.

Thank you so much for the clarification man.

And one more thing I wanna know, Please watch the video and somehow he is getting data from Power BI service, do you have any idea about this.

How can I get data like this?

 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!