Skip to main content
Licensed
This feature is only available with the licensed model. Contact us to know more.
To track Battle results on your server, you build one or both of these endpoints, and Gamezop’s server calls them: You can also call Gamezop’s Get Match Result API at any time to fetch the result of a specific match.

How Battle outcome tracking works

If you haven’t built the Create Match API, Gamezop skips that call and generates the match_id itself.

Secure your endpoints

Gamezop can send a bearer token with every call to your endpoints, so you can reject calls that don’t come from Gamezop. If you want this, create a token and share it with your Gamezop Account Manager. Gamezop then includes it in each request:

Create Match API

An optional endpoint that Gamezop calls when players are matched, or when no match is found in time. If you return a match_id, Gamezop uses it for the rest of the match. The room_id identifies the overall Battle room, while the match_id identifies one match played in that room. For example, Alice and Bob may play multiple matches in room ABC01. The room_id remains the same, but the winner can differ in each match. Winners are therefore associated with the match_id, not the room_id.

Your API endpoint

For example: POST https://api.publisher-xyz.com/games/create-match

Request body

Example request body:

HTTP response codes

Respond with a 200 when you return a match_id. Expected response body:
When the status is NO_MATCH_FOUND, return match_id as an empty string.
If you charge an entry fee
  • MATCH_FOUND: before you return a match_id, check that every player in the request has paid. If any player hasn’t, refund the others and respond with HTTP 200 and an empty match_id. The players then see the “No match found” screen.
  • NO_MATCH_FOUND: refund the entry fee for every player in the request.

Receive Winners API

An endpoint that Gamezop calls when each match ends, with every player’s final rank and score. Use it to save results or reward winners.

Your API endpoint

For example: POST https://api.publisher-xyz.com/games/receive-winners

Request body

Battles always use a game’s single default mode, so scores here have no leaderboardId, unlike Individual Games scores. Example request body:

HTTP response codes

Respond with HTTP 200 and send back every player’s rank, puid and score; all three fields are required. To show a prize on the result screen, add prize and currency_icon to any player. Both are optional. Example response body:
The result screen shows the final ranking, along with any prize you sent: Battle result screen showing the winner's prize next to their score Next steps

Get Match Result API

Fetch the result of a specific match at any time.

Client-side callbacks

Respond to Battle events in your app or website.