- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

The 'Authorization' header is only supported when connecting anonymously from sonar cloud API
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @NiharTestIngram - can you please try wraping Authorization with #"" so it appears as #"Authorization"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
05-09-2023 07:36 AM | |||
12-20-2024 01:08 AM | |||
04-11-2024 10:26 PM | |||
01-03-2025 08:06 AM | |||
07-04-2024 01:56 AM |
User | Count |
---|---|
30 | |
26 | |
24 | |
13 | |
10 |
User | Count |
---|---|
24 | |
23 | |
18 | |
12 | |
9 |