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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.