Ledger Enterprise
API Documentation V1
API Documentation V1
  • GETTING STARTED
    • Welcome
    • Getting Started
    • Authentication
    • Rate Limits
    • Pagination
  • tutorials
    • Register a new API User
    • First Steps as an API User
    • Generate Reporting API Keys
    • Manage Reporting API Keys
    • TradeLink Integration Guide for Liquidity Providers
  • REFERENCE
    • API reference
      • Accounts
        • Search Accounts
        • Get an Account by ID
        • Addresses
          • [Decprecated] Get Receiving Addresses of an Account
          • Get Receiving Addresses of an Account
          • [Decprecated] Get an address by index for an account
        • Balances
        • Currency
        • History
        • Labels
        • NFT Collections
        • NFT Portfolio
        • NFTs
        • Sync
        • Tokens
        • ERC20 Child Accounts
      • API users
        • Get List of API Users
        • Create an API User
        • Get an API User
        • Register
      • Currencies and Tokens
        • List Currencies
        • List Tokens
        • Get Currency by Name
        • Get a Token by Network and Address
        • Currency Name and Address Pair
      • Digests
        • Search Digests
        • Get Digests by ID
        • Digest History
      • Entities
        • Search Entity
        • Get an Entity by ID
        • Entity History
        • Get the Users of an Entity
      • Groups
        • Search Group
        • Get Group by ID
        • Group History
      • Labels
      • Messages
        • Search Message
        • Get a Message by ID
        • Message History
      • Organization
      • Pledges
        • Search Pledge
        • Get a Pledge by ID
      • Requests
        • Search Request
        • Create Request
        • Get Request by ID
        • Get Request Challenge (Approve)
        • Get Request Challenge (Reject)
        • Approve Request
        • Reject Request
        • Get the Request's Governance Status
      • Settlements
        • Search Settlements
        • Create Settlement
        • Get a Settlement by ID
      • Transactions
        • Search Transaction
        • Create a Transaction
        • Get a Transaction by ID
        • Estimate Transaction Fees
        • Estimate Transaction Fees
        • Approve Transaction
        • Reject Transaction
        • Transaction History
        • Transaction Labels
      • Users
        • Search Users
        • Search User by ID
        • User History
      • Whitelists
        • Search Whitelist
        • Get Whitelist by ID
        • Whitelist History
      • Auth
        • Get JWT Token
        • Refresh JWT Token
      • Compliance
        • Get an Address' Risk Assessment
        • Get an Address' Sanctions
      • Notifications
        • Get Notification Configuration
        • Set Notification Configuration
    • Specification
Powered by GitBook
On this page
  1. GETTING STARTED

Pagination

When necessary we use a pagination mechanism to fetch big volumes of data when the dataset is too large. For example, let's take a look at a call on the \ /transactions endpoint:

GET /transactions?page=2&page_size=5

Here, the API is queried to return the second page of our queryset, each page containing 5 elements Here is the resulting json:

{
  "edges": [
    {
      "cursor": 0,
      "node": {...}
    },
    {
      "cursor": 1,
      "node": {...}
    },
    {
      "cursor": 2,
      "node": {...}
    },
    {
      "cursor": 3,
      "node": {...}
    },
    {
      "cursor": 4,
      "node": {...}
    }
  ],
    "page_info": {
    "count": 73,
    "has_next_page": True
    }
}

There are two properties, edges and page_info, at the root level, explained in the following sections.

The edges Property

This property contains the relevant data as a JSON array. Each element of this array is an object with two properties:

  • a cursor property which is an integer equivalent to the index of the element in the current view.

  • a node property which represents the actual object being queried, in this case a Transaction type (whose schema is described in our openAPI specification).

The page_infoProperty

This property gives you the total number of objects contained in this particular queryset (count property), and allows you to know if the page you have queried is the last of a given view (has_next_page parameter).

About ordering

By default, results are sorted by creation date in descending order,newest objects being first.

We believe this makes search results more useful, but it can also be an issue when new objects are regularly added, as this could affect pagination, creating what looks like duplicates in two successive pages.

This is particularly relevant for transactions. If you were to successively fetch the first two pages of your transactions, and 20 new transactions were created between the two GET calls, then both responses would contain the exact\nsame results.

This issue can be avoided by making further use of filters (on accounts, creation date, etc.). We also recommend that you always de-duplicate by\nusing the object ids.

PreviousRate LimitsNextRegister a new API User

Last updated 2 months ago