Battle API object contains both user attempts, and it is accessible for both
opponents on every step of the battle flow. To get the results, use getBattle query.
Query execution example:
Battle object will be returned.
Battle object
The object represents battle data.
| Parameter | Type | Description |
|---|---|---|
attempt | BattleAttempt | Optional. The current API user attempt (no matter if the user is the battle initiator or an opponent). |
bonusPointsEnabled | Boolean | Required. Indicator of bonus points that can be earned for the fast answer. |
created | Int | Required. The timestamp when the battle was created. |
cta | Cta | Optional. The list of the available CTA for the current API user. Find the list of available options below. |
domain | TaxonomyTerm | Required. A domain the battle relates to. The list of battle questions list depends on the domain. |
id | ID | Required. ID of the battle. |
initiator | BattleRival | Required. Represents the battle initiator data. |
initiatorAttempt | BattleAttempt | Required. The battle initiator’s attempt. |
isAnonymized | Boolean | Required. A marker indicating that the battle results were anonymized (initials will be returned). |
opponent | BattleRival | Required. Represents the battle opponent data. |
opponentAttempt | BattleAttempt | Optional. The opponent’s attempt (if it is already started). |
questionsNumber | Int | Required. The total number of questions in the battle. |
Battle CTAs
The list of available CTAs can differ depending on the battle status for the current API user.| Action ID | Description | Corresponding mutation/query |
|---|---|---|
CREATE_BATTLE_ATTEMPT | Allows to create the battle attempt. Available for the opponent if their attempt is not created yet. | createBattleAttempt |
VIEW_BATTLE_RESULTS | Allows to view the battle results. Available when the battle is completed by the current API user. | getBattle |