Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I am trying to call the PowerBi APIs using the PowerBI JS library.
I am successful in generating the id token and even go one step ahead and use the ADAL.acquireToken method to get an access token.
Post this, I try to access the APIs as mentioned in the documents.
However, I get a 403 with no details in the error object at all.
Stringify-ing the error shows the following:
Error{"readyState":4,"responseText":"","status":403,"statusText":"Forbidden"}
I have the correct tenant and all the permissions granted to the App that I registered in Azure.
What should I be doing/what could be wrong in this case?
Can someone please help!
Here are similat links you could refer to
How to Generate Embed Token in pure JavaScript
Best Regards
Maggie
Thanks Maggie !
I had gone through these links before posting. They do not address specifically the scenario I am facing.
I am still stuck with this problem and would appreciate any help.
Just to clarify a few more things, I am using the PowerBI JS module installed through npm.
My current code looks like the following:
function userSignedIn(err, token) { if (!err) { var cachedToken = ADAL.getCachedToken(appid); if (!cachedToken) { ADAL.acquireToken("https://analysis.windows.net/powerbi/api", function(error, token) { // Handle ADAL Error if (error || !token) { console.log('ADAL Error Occurred: ' + error); return; } else { cachedToken = token; console.log("Acquired access token..."); } }); } if (cachedToken) { console.log('Token' + cachedToken); $.ajax({ type: "GET", url: "https://api.powerbi.com/v1.0/myorg/availableFeatures",//"dashboards", headers: { 'Authorization': 'Bearer ' + cachedToken } }).done(function(data) { console.log(data); }).fail(function(err) { console.log('Error' + JSON.stringify(err) ); }).always(function() {}); }; }; }
User | Count |
---|---|
64 | |
59 | |
47 | |
33 | |
32 |
User | Count |
---|---|
84 | |
75 | |
56 | |
50 | |
44 |