Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello,
We finally managed to embed a report with Direct Query thanks to a colleague.
The steps was :
* first the login api to get the access_token
* then a GET on the report to get the embedUrl value AND the datasetId. (url : https://api.powerbi.com/v1.0/myorg/groups/<GroupId>/reports/<ReportID>)
* finally a POST on GenerateToken to get the token, tokenID and expiration date (url: https://api.powerbi.com/v1.0/myorg/GenerateToken, and NOT https://api.powerbi.com/v1.0/myorg/groups/<GroupId>/reports/<ReportID>/GenerateToken)
In this last API, you have to provide a json like this :
{
"datasets": [
{
"id":"<your dataset ID>",
"xmlaPermissions": "ReadOnly"
},
{
"id":"<the datasetId you get from the Report Api>",
"xmlaPermissions": "ReadOnly"
}
],
"reports": [{
"id": "<your report ID>",
"allowEdit": false
}],
"targetWorkspaces": [
{
"id": "<your group/workspace ID>"
}
]
}
Thanks for your help !
HI @BertrandK,
if you not familiar about the IdentityBlobs structure usage, you can take a look at official document sample about generating an embed token for a Power BI report with a dataset which is connected with DirectQuery to another Power BI dataset :
Embed Token - Generate Token - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Regards,
Xiaoxin Sheng
HI @BertrandK,
I'd like to suggest you take a look at dataset related API to get the detail datasource informations:
Datasets - Get Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Regards,
Xiaoxin Sheng
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.