Reputation: 223
Summary : I am working on embedding Power BI reports in a ISV application and when i try to call api endpoint to get embedding details of the report it responds with 400 Bad Request . I am directly calling Power BI APIs without use of SDK as microsoft hasn't officially released PowerBI SDK for Java based application . Also , for debugging I used another .net application which uses PowerBI SDK to make the same API call against same workspace and it works without issues.
All other API endpoints like 'list all workspaces','get workspace details',' list all dashboards' in a workspace ' and even 'list all reports in workspace' respond as requested without issues, but the API endpoint listed here :
Power BI get report embedding details using 'workspace_id' and 'report_id'
responds with 400 Bad request with seemingly right credentials and request.
Interfacing Application Context :
Issue and Debugging
Debugging :
Authorization: Bearer auth-token
User-Agent: FxVersion/4.7.2117.0 Windows_7_Enterprise/6.1.7601 Microsoft.PowerBI.Api.V2.PowerBIClient/2.0.2.17225
Host: api.powerbi.com
cache-control: no-cache
Postman-Token: some-token
Authorization: Bearer auth-token
User-Agent: PostmanRuntime/7.1.1
Accept: /
Host: api.powerbi.com
Upvotes: 2
Views: 3843
Reputation: 71
This is due to Accept
HTTP header. Microsoft`s REST Method does not support it.
Try:
curl -XGET
"https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}" -i -H
"Authorization: Bearer {token}" -H "Accept:"
-H "Accept:"
will disable this HTTP header. (By default curl sends Accept: * / *
)
Upvotes: 3