getBattles to retrieve the list of all battles related to the user.
In a response it returns a list of Battle objects
that fit the applied filters.
Results will be returned with the pagination and possibility to change the order and sorting key
(default sorting is by the battle creation date, ascending).
The following arguments can be used in the query:
| Argument | Type | Description | Default |
|---|---|---|---|
after | Cursor | Returns results that come after the specified cursor. Should be used together with first parameter. Cannot be used if before is set. | — |
before | Cursor | Returns results that come before the specified cursor. Should be used together with last parameter. Cannot be used if after is set. | — |
first | Int | Returns up to the first N elements from the list. Required if after parameter is set. Cannot be used together with last. | — |
last | Int | Returns up to the first N elements from the list. Required if before parameter is set. Cannot be used together with first. | — |
reverse | Boolean | Allows to reverse the order of the underlying list (default order is ascending). | false |
sortKey | BattleSortKey | Allows to change the results sorting. Available options: CREATED (default), FINISHED | CREATED |
status | BattleStatus | Provides the possibility to filter by the battle status. Leave empty to get all available battles. | — |
userContextId | ID | The user context ID to get the list of battles for. If omitted, the results will be retrieved for the current API user context. | — |
Only user contexts associated with the
ADMINISTRATOR scope can access the list of other users’ battles.Related Features
Pagination
Learn how to efficiently navigate through large sets of items using cursor-based pagination.