Forum Discussion

kfm91's avatar
kfm91
New Member
3 years ago
Solved

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.