Handling List Responses

All “query” endpoints return a list response format that implements pagination.

{
    "data": [],
    "pagination": {
        "count": paginator.count,
        "currentPage": current_page,
        "perPage": per_page,
        "prevPage": prev_page,
        "nextPage": next_page,
        "lastPage": paginator.num_pages
    }
}

The following optional parameters are supported for all list response requests:

  • page: A cursor for use in pagination (default is 1).
  • limit: A limit on the number of objects to be returned, between 1 and 100 (default is 50).
  • sortBy: Sort the list by a field name. The list of fields varies by the type of objects being paginated (default is created_at).
    • apps: name
    • ad units: name, format
    • orders: name, advertiser
    • line items: name, priority, type
  • sortDir: The sort direction, ‘desc’ or ‘asc’ (default is ‘desc’).
  • query: This is a search term for searching multiple fields by line name, description. The list of supported fields varies depending on the object (optional). See Filters section for each object

Examples

  • https://api.mopub.com/v2/line-items?page=3
  • https://api.mopub.com/v2/adunits?format=banner

Last updated July 14, 2021

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2021 MoPub (a division of Twitter, Inc.)