Forum Discussion
Get data in a dataset
- 1 year ago
Hi Christ-M ,
As you are facing a 404 error while retrieving tables please check these troubleshooting steps:1) The Service principal is still active in AAD and Access token is getting generated via the Service principle.
2) Double-check that all the variable IDs you have entered, such as tenant_id, dataset_id are accurate and correctly formatted.3) Try your API call from third party tool such as postman once to confirm everything works correctly.
Thanks and Regards
Hey there!
Please try these steps to get your solution:
1. Use the Power BI API to Retrieve Tables in a Dataset
API Endpoint: GET https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/tables
(This returns the list of tables in the dataset.)
2. Retrieve Table Rows (Dataset Contents)
Once you have the table names, you can fetch the rows using:
API Endpoint:GET https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/tables/{table_name}/rows
(This returns all rows in a specific table of the dataset.)
3.
Make sure your API call includes an authorization token. You need:
Power BI API Permissions: Dataset.Read.All , Dataset.ReadWrite.All
You must authenticate using OAuth 2.0 via Azure Active Directory (AAD).
How to Authenticate:
- Register an Azure AD App for Power BI.
- Get an OAuth token.
- Use the token in your API request headers: Authorization: Bearer {access_token}
Hope this helps!
😁😁