Forum Discussion
misterwalrus
5 years agoRegular Visitor
401 error code only when trying to Export a report
Hi, I can get an access token using oauth, with my client_id and my master user/password. Using that token I can use it to get a list of all my respots using the entrypoint groups ("https://ap...
- 5 years ago
Soution: I was using the endpoint: https://api.powerbi.com/v1.0/myorg/reports/<report_id>/Export
That endpoint works perfectly with the master password, becuase it refers to my workspace.
But when using a service principal, you don't have a "My workspace" to export from.
If the endpoint used change to 'https://api.powerbi.com/v1.0/myorg/groups/<group_id>/reports' then there is no 401 error anymore.
v-lionel-msft
5 years agoCommunity Support
Hi misterwalrus ,
The 401 error means that there is no access permission. I guess it should be a permission problem.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.