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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jaryszek
Post Patron
Post Patron

[Power Q] Get CSV from web contents and use headers with authentification for azure portal tenant id

hi Guys,

 

i have url and want to get sent http request with headers with authentification. 
There is CSV document which i want to import into power query.

"f03ea527-ef1111111111111" this is tenantID from azure portal.

First Content is json but i want to get CSV from it.

Tried with:

(Web.Contents("https://local-node.something.com:9999/v1/bundles/Excel/data/something:excel-notderived/1.0.0/ListYes..."), [Headers=[#"Authorization"="Bearer f03ea527-ef1111111111111", #"Content-Type"="application/json"]],[Delimiter=","])

But what i am getting is:

jaryszek_0-1659004035341.png

 


something is missing to convert json into CSV or i am doing this entirely wrong.

Can you please help?
Best,
Jacek

 




1 ACCEPTED SOLUTION
jaryszek
Post Patron
Post Patron

Ok Guys i didnt inclue "" as and of statement:

AccessTokenVal & ""

Problem solved,
Best,
Jacek

View solution in original post

2 REPLIES 2
jaryszek
Post Patron
Post Patron

Ok Guys i didnt inclue "" as and of statement:

AccessTokenVal & ""

Problem solved,
Best,
Jacek

jaryszek
Post Patron
Post Patron

Hi Guys,

i managed to get Access token using method from here:
https://community.powerbi.com/t5/Power-Query/OAuth2-REST-API-as-data-source/td-p/414748 

working fine!

 

so i have variable AccessTokenVal which looks like: 

jaryszek_0-1659015218086.png

 


And now i tried to use Json.Document to get data:
"Json.Document(Web.Contents("https://local-node.something.com:9999/v1/bundles/Excel/data/something:excel-notderived/1.0.0/ListYes..."), [Headers=[#"Content-Type"="application/json",#"Authorization"="Bearer " & AccessTokenVal]])

but error is:

jaryszek_1-1659015247609.png
i found that when body is needed it should be like Json.ToBinary function to make this working.
But i do not have any body, just headers and url within Get method...

 

thank you very much for help,

Jacek

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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