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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kfm91
New Member

Power BI Report Server Data source Web.Contents failed to get contents from api (404): Not Found

Hi, 

 

I have a Power BI project working 100% in power bi desktop. But when I publish it in Power BI Server and I try to configure the below Data Source, I got the error  "Web.Contents failed to get contents from api (404): Not Found".

Any ideia how can I solve it? 

 

 

 

let
    url = "https://xxxxx.com.br/yyyyy/api/Acesso/Logon",
    headers = [#"Content-Type" = "application/json-patch+json", #"accept" = "application/json"],
    postData = Json.FromValue([userID = "user01", password = "key", aplName = "xpto"]),
    response = Web.Contents(
        url,
        [
            Headers = headers,
            Content = postData
        ]
    ),
    jsonResponse = Json.Document(response),
    objeto = jsonResponse[objeto],
    #"Converted to Table" = Record.ToTable(objeto),
    #"Filtered Rows" = Table.SelectRows(#"Converted to Table", each [Name] = "accessToken"),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Name"})
in
    #"Removed Columns"

 

 

 

I tried to use the url "https://xxxxx.com.br/yyyyy/api/Acesso/Logon" in my chrome and got the same error 404 (because i don't pass the body parametrs). If I try "https://xxxxx.com.br/yyyyy/swagger/index.html", it works with swagger page. 

1 ACCEPTED SOLUTION
kfm91
New Member

1 REPLY 1
kfm91
New Member

the solution was change the token capture to function as https://www.advaiya.com/generate-dynamic-token-and-get-data-from-custom-api-in-power-bi/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.