Forum Discussion
HeetParkhiya
7 months agoFrequent Visitor
Fabric Create report API
Hello Team, I am trying to create report using the fabric rest api and it throws me the "Content provider provided invalid package content stream". Here is my report.json schema : { ...
- 7 months ago
Hello HeetParkhiya
Have you been able to run the Python script to create the payload and test it? I have provided the Python script in my earlier messages.
Here's the contents of my report.json, definition.pbir and .platform, modified slightly because I don't want to expose anything pertaining to my tenant.
report.json
{ "config": "{\"version\":\"5.68\",\"themeCollection\":{\"baseTheme\":{\"name\":\"CY25SU11\",\"version\":{\"visual\":\"2.4.0\",\"report\":\"3.0.0\",\"page\":\"2.3.0\"},\"type\":2}},\"activeSectionIndex\":0,\"defaultDrillFilterOtherVisuals\":true,\"settings\":{\"useNewFilterPaneExperience\":true,\"allowChangeFilterTypes\":true,\"useStylableVisualContainerHeader\":true,\"queryLimitOption\":6,\"exportDataMode\":1,\"useDefaultAggregateDisplayName\":true,\"useEnhancedTooltips\":true},\"objects\":{\"section\":[{\"properties\":{\"verticalAlignment\":{\"expr\":{\"Literal\":{\"Value\":\"'Top'\"}}}}}]}}", "layoutOptimization": 0, "resourcePackages": [ { "resourcePackage": { "disabled": false, "items": [ { "name": "CY25SU11", "path": "BaseThemes/CY25SU11.json", "type": 202 } ], "name": "SharedResources", "type": 2 } } ], "sections": [ { "config": "{}", "displayName": "Page 1", "displayOption": 1, "filters": "[]", "height": 720.00, "name": "7a9c9127a761dab1a1bb", "visualContainers": [], "width": 1280.00 } ] }definition.pbir
{ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definitionProperties/2.0.0/schema.json", "version": "4.0", "datasetReference": { "byConnection": { "connectionString": "Data Source=\"powerbi://api.powerbi.com/v1.0/myorg/Fabric Workspace\";initial catalog=testCatalog;access mode=readonly;integrated security=ClaimsToken;semanticmodelid=838c6f17-025d-47cb-9dd5-11ce4b95db6d" } } }.platform
{ "$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json", "metadata": { "type": "Report", "displayName": "legacy_report" }, "config": { "version": "2.0", "logicalId": "8b4d6212-7372-4427-bec7-78855f7a4cab" } }
deborshi_nag
7 months agoSuper User
Hello HeetParkhiya
I have been able to use the Fabric REST endpoint to create a sample report. I have used the modern PBIR format.
Here is the payload for the endpoint -
{
"definition": {
"parts": [
{
"path": "definition.pbir",
"payload": "<base64>",
"payloadType": "InlineBase64"
},
{
"path": "definition/report.json",
"payload": "<base64>",
"payloadType": "InlineBase64"
},
{
"path": "definition/version.json",
"payload": "<base64>",
"payloadType": "InlineBase64"
},
{
"path": "definition/pages/pages.json",
"payload": "<base64>",
"payloadType": "InlineBase64"
},
{
"path": ".platform",
"payload": "<base64>",
"payloadType": "InlineBase64"
},
{
"path": "definition/pages/d20e46cf39e616b15188/page.json",
"payload": "<base64>",
"payloadType": "InlineBase64"
}
]
}
}
I have used Power BI Desktop to create the template report.json and definition.pbir files.
Hope this helps - please appreciate leaving a Kudos or accepting as a Solution!