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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |