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.
Hi Team,
I am getting below error while trying to fetch data from sonar cloud API using basic authentication. where as same API is working fine in postman. can someone help me on how to resolve this for all repository.
I tried different forums where it's mentioned to used datasource connection as anonymous. but there also i am getting issue
Then i tried with with basic authentication but getting the Authorization header error for all repositories.
Tried this query
= Json.Document(Web.Contents("https://sonarcloud.io/api/measures/component?component=imonline_accountmanagement.webapi.reseller&me...", [Headers=[Authorization="Basic NGZhNmFkZDFhNmMyNDRkMjdlNjI0MDVjYTQ3YWJmNjhmNzdiYjI0Njo="]]))
can you please help me here how to solve this issue.
Thanks
Nihar Arisal
Solved! Go to Solution.
HI @Daryl-Lynch-Bzy ,
Its now working. i just removed authorization from power query as token is used for data source connection.
let
Source = Json.Document(Web.Contents("https://sonarcloud.io/api/measures/component?component=imonline_accountmanagement.webapi.reseller&me...")),
#"Converted to Table" = Table.FromRecords({Source}),
#"Expanded component" = Table.ExpandRecordColumn(#"Converted to Table", "component", {"id", "key", "name", "qualifier", "measures"}, {"component.id", "component.key", "component.name", "component.qualifier", "component.measures"}),
#"Expanded component.measures" = Table.ExpandListColumn(#"Expanded component", "component.measures"),
#"Expanded component.measures1" = Table.ExpandRecordColumn(#"Expanded component.measures", "component.measures", {"metric", "value", "bestValue"}, {"component.measures.metric", "component.measures.value", "component.measures.bestValue"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded component.measures1",{{"component.id", type text}, {"component.key", type text}, {"component.name", type text}, {"component.qualifier", type text}, {"component.measures.metric", type text}, {"component.measures.value", Int64.Type}, {"component.measures.bestValue", type logical}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"component.id", "component.key", "component.qualifier","component.measures.bestValue"})
in
#"Removed Columns"
Thanks
Nihar
Hi all,
i have the same issue with fetching EHS insights data from API. the refresh in powerbi service wont work and gives the same message.
I tried removing the header and then swithing to basic authentication by using my username and the API key for te key after that i published the file. i also changed the data source credentials to same what i did in the desktop file but when i then refresh, i still seem to get the error.
Any help?
Hi @NiharTestIngram - I am having a similar issue with a different API. Would you mind demonstrating where and how exactly you removed the authorization bit from the query? I know it's been awhile. Thank you in advance
HI @Daryl-Lynch-Bzy ,
Its now working. i just removed authorization from power query as token is used for data source connection.
let
Source = Json.Document(Web.Contents("https://sonarcloud.io/api/measures/component?component=imonline_accountmanagement.webapi.reseller&me...")),
#"Converted to Table" = Table.FromRecords({Source}),
#"Expanded component" = Table.ExpandRecordColumn(#"Converted to Table", "component", {"id", "key", "name", "qualifier", "measures"}, {"component.id", "component.key", "component.name", "component.qualifier", "component.measures"}),
#"Expanded component.measures" = Table.ExpandListColumn(#"Expanded component", "component.measures"),
#"Expanded component.measures1" = Table.ExpandRecordColumn(#"Expanded component.measures", "component.measures", {"metric", "value", "bestValue"}, {"component.measures.metric", "component.measures.value", "component.measures.bestValue"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded component.measures1",{{"component.id", type text}, {"component.key", type text}, {"component.name", type text}, {"component.qualifier", type text}, {"component.measures.metric", type text}, {"component.measures.value", Int64.Type}, {"component.measures.bestValue", type logical}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"component.id", "component.key", "component.qualifier","component.measures.bestValue"})
in
#"Removed Columns"
Thanks
Nihar
Hi @NiharTestIngram - can you please try wraping Authorization with #"" so it appears as #"Authorization"?
HI @Daryl-Lynch-Bzy ,
I tried with that option also but same result.
let
Source = Json.Document(Web.Contents("https://sonarcloud.io/api/measures/component?component=imonline_accountmanagement.webapi.reseller&me...", [Headers=[#"Authorization"="Basic NGZhNmFkZDFhNmMyNDRkMjdlNjI0MDVjYTQ3YWJmNjhmNzdiYjI0Njo="]])),
#"Converted to Table" = Table.FromRecords({Source}),
#"Expanded component" = Table.ExpandRecordColumn(#"Converted to Table", "component", {"id", "key", "name", "qualifier", "measures"}, {"component.id", "component.key", "component.name", "component.qualifier", "component.measures"}),
#"Expanded component.measures" = Table.ExpandListColumn(#"Expanded component", "component.measures"),
#"Expanded component.measures1" = Table.ExpandRecordColumn(#"Expanded component.measures", "component.measures", {"metric", "value", "bestValue"}, {"component.measures.metric", "component.measures.value", "component.measures.bestValue"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded component.measures1",{{"component.id", type text}, {"component.key", type text}, {"component.name", type text}, {"component.qualifier", type text}, {"component.measures.metric", type text}, {"component.measures.value", Int64.Type}, {"component.measures.bestValue", type logical}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"component.id", "component.key", "component.qualifier","component.measures.bestValue"})
in
#"Removed Columns"
Getting same issue for all the. and using same basic auth, it is working fine in postman. but not in power BI.
for that error it did not allow me to apply the changes as well.
Thanks
Nihar
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
13 | |
8 | |
8 |