Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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