Not Monitored
Tag not monitored by Microsoft.
43,274 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
While attempting to retrieve the report ID from the URL api.powerbi.com/v1.0/myorg/reports/ using my Java API, I encountered an HTTP 401 error in the response.
Despite granting all necessary permissions (DashBoard,DataSet,report,tenant, workspace)in the App Registrations menu in Azure AD, I am unable to resolve the issue. I will be very glad to help solve the issue!
// Construct the URL to query the workspace reports
String url1 = "https://api.powerbi.com/v1.0/myorg/admin/groups/";
String url2 = "/reports";
String url = url1 + workspaceID + url2;
// Prepare the HTTP request
HttpClient httpClient = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer " + token)
.header("Content-Type", "application/json")
.GET() // Since we're performing a GET request
.build();
// Send the request and handle the response
HttpResponse