Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I've published an online report and it was getting database from an API perfectly while using desktop version.
Now I'm trying to set Schedule Refresh on app.powerbi.com to get data from the same API, but it shows the error:
Anonymous or basic authentication methods shows the same error:
On Refresh history:
What should I do to solve that error?
Hi @Anonymous
What I would suggest is to look at this solution where you need to put in your details as part of the header call
Solved: Retrieve API response headers - Microsoft Power BI Community
Hi @GilbertQ
Actually that is what I'm doing. Here is the code I'm using, and it works fine with PB Desktop.
let
username = "user@email.com",
password = "mypassword",
ChecklistGetOnePage =(
pagina) as record =>
let
txPagina = Text.From(pagina),
urlOptions = [Headers=[email=username, password=password], Query=[page=txPagina]],
Source =
Json.Document(Web.Contents("https://exampleurlapi.com",urlOptions)),
data = Source[data],
registos = [Data=data[items],Pages=data[lastPage]]
in
registos,
resFirstPage = ChecklistGetOnePage(1),
totalPaginas = resFirstPage[Pages],
GeneratedList =
List.Generate(
()=>
[i=0, res = ChecklistGetOnePage(i+1)],
each [i]<= totalPaginas,
each [i=[i]+1, res = ChecklistGetOnePage(i+1)],
each [res][Data]),
GeneratedListFinal = List.Combine(GeneratedList),
#"Converted to Table" = Table.FromList(GeneratedListFinal, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1",
{
"Observations",
}
,
{
"Observations",
}
)
in
#"Expanded Column1"
Thanks for that it looks good
What did you set the privacy setting to?
Hi @Anonymous
I think then it might have to do with the way it has been configured in the Power Query.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.