Forum Discussion
Unable to export Paginated report to PDF
- 4 years ago
Hi keegan ,
_apiUrl = new Uri("https://api.powerbi.com/");
I think that either the report ID you're using doesn't exist, or the user/service principal which is used when calling the API doesn't have access to the workspace of the report.
You should add the user/service principal as a member to the workspace.
Hi keegan ,
Did you see the solution here: https://community.powerbi.com/t5/Developer/REST-API-Get-Access-Token/m-p/1895937#:~:text=The%20resource%20url%20for%20Power,or%20your%20account%20and%20password.
I'm not sure what is the cause for the error you get, but I think your authority URL is different. the API URL you're using seems correct.
If you still can't get it to work please see in the error response you get has request ID in the header, I might be able to help if you give me the request ID.
Hi AmosHersch ,
Thanks so much for your assistance I really appreciate it. Sorry I have no idea what I'm doing, so I've taken a while to try more things out and try and grasp what is happenning.
I've updated my authority url and still have the same problems. You mentioned above;
If you still can't get it to work please see in the error response you get has request ID in the header
When I set _apiUrl = new Uri("https://api.powerbi.com/");
I get the following error:
{"error":{"code":"PowerBIEntityNotFound","pbi.error":{"code":"PowerBIEntityNotFound","parameters":{},"details":[],"exceptionCulprit":1}}}
request id = 'a1efd032-385d-4c02-99aa-0522a15a410e'
If I set set _apiUrl = new Uri("https://app.powerbi.com/groups/<groupId>/reports/<reportId>/ExportTo");
//note this was from a sample online??? no idea if its correct...
error response is empty....The process hangs for about 10 seconds and returns internal server error.
Am I correct in assuming my app has authenticated ok in AzureAd via the client-id, client-secret and app id? authenticationResult is populated with a jwt token and expiration date. I assume this came from azuread authentication process.
The process falls over when i try to then export the report via power BI api.
I'm so confused 😂
- AmosHersch4 years agoMicrosoft Employee
Hi keegan ,
_apiUrl = new Uri("https://api.powerbi.com/");
I think that either the report ID you're using doesn't exist, or the user/service principal which is used when calling the API doesn't have access to the workspace of the report.
You should add the user/service principal as a member to the workspace.