cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Error 403 when making a get command

Hello guys, I am facing a problem when I try to perform a get on the API I'm developing command. Did they could to help?

I have to get to get acesstoken, but when I make a get any (group list), the system returns me the error 403 (unauthorized access).

I have tested everything and I can not make the get, I've checked the permissions on my azzure directory and also checked the uri, what could it be? Here some pictures of my code and it returns me ...

 

btn_comando.pngpermissoes.png

I am very grateful if you help me!

7 REPLIES 7
Moderator Eric_Zhang
Moderator

Re: Error 403 when making a get command

@brunozanoelo

 

  1. Based on my test, the token is case-sensitive, try "Bearer " instead.
  2. As per the BOL Get Groups,  to get groups, the url is https://api.powerbi.com/v1.0/myorg/groups.
  3. It seems that you're trying to access the REST API via PL/SQL in Oracle, try to test the API via postman at the first.

 

Re: Error 403 when making a get command

Hello Friend @Eric_Zhang! Thank you so much for your answer. As you said, I tried to work with the postman did not work, I managed to get success with acesstoken, but when I try to run the get command, still returns me the error 403 (as printscreen attached).



What can it be? I'm desperate, I do not know what can be.

Waiting for one answer!! Thanks a lot for the help!

Screen Shot 10-19-16 at 08.44 AM.PNG

 

 

Re: Error 403 when making a get command

@Eric_Zhang, my application is in delphi programming language and is used in desktop, so the app registration must be in Native client app, correct? Whitout the secret client ID, is that correct?

See this image of all permissions granted for my app, i think is all fine.

i think is something about the configuration of my app, idk, because in the postman i got the same error (403).

 

Screen Shot 10-19-16 at 09.22 AM.PNG

  

Moderator Eric_Zhang
Moderator

Re: Error 403 when making a get command


@brunozanoelo wrote:

Hello Friend @Eric_Zhang! Thank you so much for your answer. As you said, I tried to work with the postman did not work, I managed to get success with acesstoken, but when I try to run the get command, still returns me the error 403 (as printscreen attached).



What can it be? I'm desperate, I do not know what can be.

Waiting for one answer!! Thanks a lot for the help!

Screen Shot 10-19-16 at 08.44 AM.PNG

 

 


@brunozanoelo

 

The access token in the picture looks weird. Ususally a valid token is starting with "ey",like "eyJ0eXAiOiJKV1QiLCxxxxxx", how did you get that access token?

Re: Error 403 when making a get command

HI @Eric_Zhang! Thank you for your reply...

I got this access token in the postman, in the button "Get new access token".

Apparently it seems that acesstoken is wrong?

To get the accessToken I informed these settings in the postman:

Screen Shot 10-20-16 at 08.07 AM.PNG

 

 

Re: Error 403 when making a get command

Hello my friend @Eric_Zhang, Fine?

I deleted my application and remade from scratch, as the steps that give the power of bi site, apparently everything is okay but I still can not make the get command.

One strange thing I noticed was that if I run in production mode in the apiary, I can make successfully get command, but the postman not...

Moderator Eric_Zhang
Moderator

Re: Error 403 when making a get command

@brunozanoelo

 

Well, I seem to get the global scenario.

 

  • You're developing in Delphi, while in Delphi there's no known integration API to get the token as in C#.
  • You're trying to get the token via postman then apply the token in Delphi to import pbix file to Power BI Serivce.

So

  1. I don't know how postman works to get that token, that token looks wrong.
  2. Try to get the token via C# getting-started-for-dotnet-import (you're requesting token via postman, did you have any approach to integrate postman with Delphi?) and write the token somewhere, maybe in a text file. In Delphi import the pbi file with the token in text file. The token can expire, so you would have to re-run the C# to get a new one.
    Or as I sugguested before, check Call C# dll from Delphi.
  3. The registered app is a native client app, cilentid is enough to get the token.