Forum Discussion
ShaunBuchan
5 years agoFrequent Visitor
Pagination Sophos API
Hi, I have working code for retrieving data from Sophos Central. I have added pagination for other data sources before but can't get it working with Sophos. Here is my code: SophosBearer...
PhilipTreacy
5 years agoSuper User
Hi ShaunBuchan
How does the API specify that pagination works? Are you accessing pages by number, by using a text string in the URL, by cursor?
Let's say that you are accessing different pages specified by a list called pages
You can use a query like this that uses List.Transform to make a Web.Contents request for each item in the list
pages = {"sales", "marketing","hr"},
url="https://api-us03.central.sophos.com/endpoint/v1/endpoints/",
Header=[
#"Authorization"=#"SophosBearerToken",
#"x-tenant-id"= tenantID
],
PartnerIDQuery = List.Transform(pages, each Json.Document(Web.Contents(url & _ , [Headers=Header])))
I'm using strings here as I don't actually know how the API works. If you can supply details I can modify this for you.
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.