Forum Discussion
trwatts
4 years agoHelper I
Issue with returning a table.
Hi Everyone New to M query and having issues get a table of records. I am calling through API. Bearer Token needs to be called. The URL has a dynamic ID at the end of the url which returns a se...
- 4 years ago
Have you seen this post?
This and a few other posts of Chris' on the topic may offer some guidance.
Syndicate_Admin
4 years agoAdministrator
I had a type in my code so updated. Was just the line which had "Query=10"
Followed the gif and got this
Notepad copy of the error.
I think its closer
where the end of the url reads rooms/summary?postid=11169 it should read
rooms/summary/11169
And i really appreciate you helping me to trouble shoot this.
let
Centreid = Centreids,
ids = List.Generate(() => 100000, each _ > 0, each _ - 1),
url = "https://auth.xxxxxxxxxxx.com/api/v1/auth",
body = "{ ""user"": ""xxxxxx"", ""password"": ""xxxxxx""}",
tokenResponse = Json.Document(
Web.Contents(
url,
[Headers = [#"Content-Type" = "application/json"], Content = Text.ToBinary(body)]
)
),
data1 = tokenResponse[data],
token = "Bearer " & data1[token],
source = (Centreid as text) =>
Json.Document(
Web.Contents(
"https://office.xxxxxxxx.com/api/enterprise/booking/center/rooms/summary",
[
Query =[
postid = Centreid],
Headers = [
#"x-api-key" = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
Authorization = token,
#"Content-Type" = "application/json"
]
]
)
)
in
source
trwatts
4 years agoHelper I
Hi,
Can you please delete the code in yor post. It includes passwords which I accidentally included.