Postback

Our postback system notifies your listener every time a player votes for your server, so you can reward them in game automatically.

What is sent

As soon as the vote is counted we send an HTTP POST request (application/x-www-form-urlencoded) with these fields:

FieldDescription
postback_passwordThe password you configured for this server
ip_addrIP address of the voter
uidOur user id of the voter (empty for guests)
vote_counted1 if the vote was counted, otherwise 0
server_idYour server id on MMTop 50
votes_totalYour new all time vote count
votes_24hYour votes in the last 24 hours

Timeout: your listener has 5 seconds to respond. If no connection can be established, the postback is dropped (it will not be retried).

Configuration

Open your dashboard, edit your server and set the Postback URL and optional Postback password. Keep the password secret and verify it on every request.

Vote links

LinkPurpose
https://mmtop50.com/vote/[SERVER_ID]Standard vote link - send players here from your website
https://mmtop50.com/vote/[SERVER_ID]/[USER_ID]Same, but includes your own user/player id in the callback so you can match the voter

After a successful vote the player is redirected back to your listing page.

Sample listener (PHP)

<?php
if ($_SERVER["REQUEST_METHOD"] !== "POST") exit();

$postback_password = "CHANGE_ME"; // the password set in your listing

if (!hash_equals($postback_password, $_POST["postback_password"] ?? "")) exit();

$vote_counted = ($_POST["vote_counted"] ?? "0") === "1";
$ip           = $_POST["ip_addr"] ?? "";
$uid          = $_POST["uid"] ?? "";

if ($vote_counted) {
    // TODO: find the player by $ip / $uid and grant the vote reward
}
?>

Tip: also accept requests only from your own validator IP if you want maximum safety.