Forum Discussion
Connect to API. Bearer Token
Did anyone figure out how to set up automatic refreshes on this data source? I have been able to pull the data from Samsara (thank you all for the above support), but when I publish online, I can't set up refreshes due to missing web credentials?
This is my M-Script call:
Json.Document(Web.Contents("https://api.samsara.com/fleet/vehicles", [Headers=[Authorization="Bearer myapiKey"]]))
and off of the vehicle id columns i call:
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each Json.Document(Web.Contents("https://api.samsara.com/",[RelativePath = "v1/fleet/trips" & "?startMs=" & Text.From(Duration.TotalSeconds(startMs - #datetime(1970, 1, 1, 0, 0, 0))) & "000" & "&endMs=" & Text.From(Duration.TotalSeconds(Date.From(DateTimeZone.LocalNow())-#date(1970, 1, 1))) & "000" & "&vehicleId=" & [data.id], Headers = [Authorization = "Bearer " & "myapiKey"]]))),
Did you resolve this? I'm stuck with the same issue
- KHC05873 years agoFrequent Visitor
Unfortunately, no I never solved it, ended up just abandoning the project as leadership lost interest in it.