This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi !
I need to take data with several parameters present in the API response.
I write this code but he didn't work :
let
BaseUrl = "https://ecofac.nicoka.com/api/jobs/&hr__=1&limit=1000",
Token = "token",
EntitiesPerPage = 100,
GetJson = (Url) =>
let Options = [Headers=[ #"Authorization" = "Bearer " & Token ]],
RawData = Web.Contents(Url, [Headers=[Authorization="Bearer token"]]),
Json = Json.Document(RawData)
in Json,
GetTotalEntities = () =>
let Json = GetJson(BaseUrl),
Total = Json[total]
in Total,
GetUid = () =>
let Json = GetJson(BaseUrl),
Uid = Json[queryUid]
in Uid,
GetPage = (Index) =>
let Skip = "queryUid=" & Text.From(Uid) & "&" & "queryPage=" & Text.From(Index),
Url = BaseUrl & "&" & Skip,
Json = GetJson(Url),
Value = Json[data]
in Value,
GetUrl = (Index) =>
let Skip = "queryUid=" & Text.From(Uid) & "&" & "queryPage=" & Text.From(Index),
Url = BaseUrl & "&" & Skip
in Url,
EntityCount = List.Max({ EntitiesPerPage, GetTotalEntities() }),
PageCount = Number.RoundUp(EntityCount / EntitiesPerPage),
PageIndices = { 0 .. PageCount + 1 },
Uid = GetUid(),
URLs = List.Transform(PageIndices, each GetUrl(_)),
Pages = List.Transform(PageIndices, each GetPage(_)),
Entities = List.Union(Pages)
in
Entities
He return me that : "we were unable to authenticate with the information provided. Try again"
But when i just take data with simple code it's work like that code :
let
Source = Json.Document(Web.Contents("https://ecofac.nicoka.com/api/jobs/&hr__=1&limit=1000", [Headers=[Authorization="Bearer token"]]))
in
Source
I need your's helps
Thanks you for read and tried to help me 🙂
Solved! Go to Solution.
This part of the code is incorrect
GetJson = (Url) =>
let Options = [Headers=[ #"Authorization" = "Bearer " & Token ]],
RawData = Web.Contents(Url, [Headers=[Authorization="Bearer token"]]),
Json = Json.Document(RawData)
in Json,
Should be
GetJson = (Url) =>
let Options = [Headers=[ #"Authorization" = "Bearer " & Token ]],
RawData = Web.Contents(Url, Options),
Json = Json.Document(RawData)
in Json,
Hi !
Thanks it work perfectly now !
See you soon 😉
This part of the code is incorrect
GetJson = (Url) =>
let Options = [Headers=[ #"Authorization" = "Bearer " & Token ]],
RawData = Web.Contents(Url, [Headers=[Authorization="Bearer token"]]),
Json = Json.Document(RawData)
in Json,
Should be
GetJson = (Url) =>
let Options = [Headers=[ #"Authorization" = "Bearer " & Token ]],
RawData = Web.Contents(Url, Options),
Json = Json.Document(RawData)
in Json,
Check out the April 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.