Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
pbiembed
Frequent Visitor

Need help in connecting to REST API

Hi,

 

I was trying to Get Data from REST API which is working properly in Postman but unable to connect in power bi desktop.

 

Please find the error message below. Even if i use Anonymous its not connecting.

Details: "The 'Authorization' header is only supported when connecting anonymously. These headers can be used with all authentication types: Accept, Accept-Charset, Accept-Encoding, Accept-Language, Cache-Control, Content-Type, If-Modified-Since, Prefer, Referer"

Please help me out in resolving this issue.

 

Thanks,

Suma

9 REPLIES 9
blopez11
Resident Rockstar
Resident Rockstar

I would be helpful to see your postman example and the M code for the query you are using on Power BI

Hi,

 

Please find the sample postman config.

GET http://serve:port/path
Authorization:"Basic <encoded String>"
Content-Type:text/plain
X-SECURITY_TOKEN:some codevalue
X-USER_TOKEN:email

 

And in power bi below is the power query

let
Source = "http://sample:700/path/",
Options= [
Headers=
[
#"Content-Type"="text/plain",
#"X-SECURITY_TOKEN"="token ",
#"X-USER_TOKEN"= "email@.com",
#"Authorization"="Basic encoded code"
]
],
result = Web.Contents(Source, Options),
toTable=Table.FromRecords({result})
in
Source

 

Please help me in resolving the issue.

 

Thanks,

Suma

Remove #"Authorization"="Basic encoded code" from the Headers in your M code, then in the Data source settings, change the permissions type from Anonymous to Basic, then you should be prompted for a user name and password.

Give that a shot

2019-07-31_17-50-14.jpg

 

Hi 

 

i have tried your solution but its not connecting.

 

Whereas its connecting in Postman with same credentials.Please find the screen belowBasicerr.png

 

 

 

 

 

 

 

 

Thanks,

Suma

Without seeing the full URL, it is kind of hard, but normally you authenticate against the base URL, so maybe change your M code to the following, by moving the portion after the base URL to the RelativePath option.  Additionally, if you are passing parameters as well in the URL, then those should move to the Query option

 

let
Source = "http://sample:700",
Options= [
RelativePath="PUT YOUR STATIC PATH, AFTER BASE URL HERE",
Headers=
[
#"Content-Type"="text/plain",
#"X-SECURITY_TOKEN"="token ",
#"X-USER_TOKEN"= "email@.com",
]
],
result = Web.Contents(Source, Options),
toTable=Table.FromRecords({result})
in
Source

Hi,

 

I am trying to connect to Amazon Web services.

 

So the url is an ec2 instance Ex:http://ec2-servername:port.

 

I have tied connecting by passing Relative path in options but i got below issue.

 

With_Relative_path.JPG

 

Thanks,

Suma

Unfortunately without being able to troubleshoot it myself, I probably can't help any further

Maybe someone else on the community has more experience with your particular use case

Good luck,

Ok Thank You for your assistance.

 

Thanks,

Suma

Hi 

 

Can anyone please assist me on this issue.

 

Thanks,

Suma

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.