Postback Voting

Postback functionality lets you confirm that a player has voted for your server.

You have to add an additional parameter to the voting url that will be transfered to the postback script after a successfull vote.

With that parameter you can identify players and reward them for voting.

Setting up postback

Game settings

Enter a full URL to the postback script field (Postback url) in the game settings.(Account -> My Games -> Edit)

Query variables are allowed in the url, just ip and param variables will be overridden if defined.

Voting link

Postback only works if an additional parameter is added to the voting url.

This additional parameter will be sent to the postback script as query variable.

Original voting url, [ID] represents game ID
https://privategameservers.com/game/[ID]/vote
Voting url with postback parameter, parameter = -my_test_param-
https://privategameservers.com/game/[ID]/vote/-my_test_param-

Parameter has to match with the following regex:

Letters lower and uppercase (no accents), numbers, charactes - and _, at least 1 character, but no more than 32.
[a-zA-Z0-9_-]{1,32}

Postback call

If a successful vote has been made and the postback script url is set, then a request will be made to that url with a couple of additional query variables.

These variables will be ip and param.

Param query variable contains the parameter value defined in the voting link.

Example request
https://game.example.com/postback.php?ip=127.0.0.1&param=-my_test_param-

Make sure that the name of your postback script is unknown to anyone, otherwise they can call it illegally.

Voting IP check

You can also check if an IP has voted within 12 hours.

Make a GET request to the url shown below and replace [ID] with your server ID and the [IP] with and actual IP address to check against.

https://privategameservers.com/check?game=[ID]&ip=[IP]

If an IP has voted within 12 hours, then true is returned if not then false.

If the server ID isn't an integer or the IP is not a valid IPv4, then the response is empty.