Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Documenting continuationToken based pagination #12

Description

@JulienPalard

Bonjour !

I'm still experimenting with the client and the API, I think an example with a continuationToken would be helpfull. I'm using it as a cursor, and it looks to work as expected.

So a usage example may look like:

backup = []
endpoint = f"/v5/organizations/{args.org}/items"
params = {"pageSize": 100}
items = api.call(endpoint, params=params).json()
while items["data"]:
    backup.extend(items["data"])
    params["continuationToken"] = items["pagination"]["continuationToken"]
    items = api.call(endpoint, params=params).json()
Path(args.org).write_text(
    json.dumps(backup, indent=4, ensure_ascii=False), encoding="UTF-8"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions