Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I am calling "https://api.powerbi.com/v1.0/myorg/groups/{0}/reports/{1}/ExportTo" Api in my mvc application.
HttpWebRequest request = System.Net.HttpWebRequest.CreateHttp(string.Format("https://api.powerbi.com/v1.0/myorg/groups/{0}/reports/{1}/ExportTo", workspaceId,reportId1));
request.KeepAlive = true;
request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", String.Format("Bearer {0}", token));
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
string json = "{\"format\":\"PDF\"}";
streamWriter.Write(json);
}
var response = (HttpWebResponse)request.GetResponse();
Here i was getting access token like this,
string result = authContext.AcquireTokenAsync(resourceUriPowerBi, clientCredential).Result.AccessTok...
after this I got the error
{"error":{"code":"InvalidRequest","message":"Export report requires effective identity to be provided for the report's dataset"}}
then I write a code to get embed token by passing access level and identities i used at power bi Desktop to use RLS
string embedToken =
(await pbiClient.Reports.GenerateTokenInGroupAsync(workspaceId,
report.Id,
generateTokenRequestParameters)).Token;
Now I got the 403 forbidden error with no text.
Can anyone please help me to understand this why it is giving 403 error.
earlier i successfully called the refresh dataset api using access token got using client credential...
Tahnks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.