Skip to main content
This feature is only available with paid plans. Contact us to know more.
You need to build an API endpoint for this to work: And then to receive data on the match winners, you can use either or both of the following options:

Create Match API

You will have to give us a POST API endpoint where we will send the user objects and the room_id when our servers group players into a match. Once we are able to find a match honouring the details you send in the roomDetails object, we will make a request to this endpoint, and you will have to return a match_id. Here’s the difference between a room_id and a match_id. Let’s say Alice and Bob are playing a Tic Tac Toe game in room ABC01. Alice wins. Now both Alice and Bob see an option to play again. They do so and now Bob wins. In this manner, players with the same room_id may play the game multiple times. While the room_id will remain same each time, the winners may differ across matches. That is why winners are scoped against a match_id and not against a room_id.

Your API endpoint

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

Headers

Request body

HTTP response codes

You must respond with a 200 when you return a match_id Expected response body:
Note for partners charging an entry fee to usersIf you are charging an entry fee, then in case of the MATCH_FOUND status, check buy-in validity again for all users in the request body before generating a match_id.If any player has not paid to join that match, then refund the entry fees charged to all other players and do not return a match_id. We will show a “No match found” screen to the user in this case.When we send you a NO_MATCH_FOUND status, then you should refund the entry fee charged, if any, for the users in the request body.

Receive Winners API

This will be another POST API endpoint that you create where, at the end of each match, we will send the user objects along with their ranks and scores back to your system. If you need to reward a player or take any other action on the basis of this data, you can do so upon receiving our hit on this endpoint.

Your API endpoint

POST https://api.publisher-xyz.com/games/receive-winners You must build and maintain this endpoint. Gamezop posts data on match winners to your system at the end of each multiplayer match via this endpoint.

Headers

Request body

HTTP response codes

You must respond with a 200 when you record winners successfully. Here’s the response body we expect:
At the end of each match, we show a screen where the users of that match can see the final winners. If you have a prize amount that you’re crediting the winners with, you can pass that as the prize value, along with an icon for your currency in the currency_icon value. Both of these values are optional. This is what the screen looks like: Battle Match Over Screen
We can also dispatch client-side callbacks for key events related to multiplayer matches. More on it here.In addition to us posting match winners’ data to you on your endpoint, if you also want to pull data from our system for any specific match, you can use our Get Match Result API.