This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Good morning all,
Im trying to connect an api to a link which downloads an excel file. And then i want to get all the data from the excel file. This is the error i get. Im very confused.
let
GetAuth = Web.Contents("https://CompanyURL/token",
[
Headers = [#"Accept"="application/json",
#"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"],
Content = Text.ToBinary("username=CompanyName&password=AccPass&grant_type=password")
]),
FormatAuthAsJson = Json.Document(GetAuth),
access_token = FormatAuthAsJson[access_token],
ReportData = Json.Document(Web.Contents("CompanyURL/dashboard/dashboardnumber?username=",
[
Headers=[Authorization="bearer "&access_token,
#"Content-Type"="application/json; charset=utf-8"]
,Content = Text.ToBinary("{""SearchText"":""start"",""LimitSearchResults"":10}")
])),
#"Converted Data To Table" = Table.FromList(ReportData, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
ColumnNames = List.Union( List.Transform(#"Converted Data To Table"[Column1],
each Record.ToTable(_)[Name])),
#"Expanded Report Data" = Table.ExpandRecordColumn(#"Converted Data To Table", "Column1", ColumnNames)
in
#"Expanded Report Data"
Solved! Go to Solution.
Hi @Anonymous,
Here is a solved sample post with similar issue like yours.
let
Source = Json.Document(Web.Contents("http://3.93.175.1/api/abfrage/", [Headers=[#"Content-Type"="application/json", Authorization="Token d04b033d7fa9760147aa32743284ace16de2bbd0"], Content=Json.FromValue({[number_of_requests=1, search_term="Transalb"]})]))
in
Source
Change request and work:
let
Source = Json.Document(Web.Contents("http://3.93.175.1/api/abfrage/", [Headers=[Authorization="Token 6bcc8706f68d3635f1514ce22611e83c12b1e4c1", #"Content-Type"="application/json"], Content=Json.FromValue([number_of_requests="1", search_term="Transalb"])]))
in
Source
For refernece:
PowerBI DataSource.Error: Web.Contents failed to get contents (400): Bad request
Using a REST API as a data source
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous,
Here is a solved sample post with similar issue like yours.
let
Source = Json.Document(Web.Contents("http://3.93.175.1/api/abfrage/", [Headers=[#"Content-Type"="application/json", Authorization="Token d04b033d7fa9760147aa32743284ace16de2bbd0"], Content=Json.FromValue({[number_of_requests=1, search_term="Transalb"]})]))
in
Source
Change request and work:
let
Source = Json.Document(Web.Contents("http://3.93.175.1/api/abfrage/", [Headers=[Authorization="Token 6bcc8706f68d3635f1514ce22611e83c12b1e4c1", #"Content-Type"="application/json"], Content=Json.FromValue([number_of_requests="1", search_term="Transalb"])]))
in
Source
For refernece:
PowerBI DataSource.Error: Web.Contents failed to get contents (400): Bad request
Using a REST API as a data source
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 25 | |
| 24 | |
| 24 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 27 | |
| 24 | |
| 19 |