Documentation API
English
The player votes on our platform, then goes to your website to trigger the call to our API and receive their reward.
Verification by IP addressIPv4 and IPv6Requests can be forged
Voting URL
Link to place on your website
Your player's voting link must contain the ID of your game server:
https://beta.top-metin2.org/in/{id}-{name}/
- {id} ID of your game server, for example
42 - {name} server name in the address of its page, for example
my-server
API
Vote verification
GEThttps://beta.top-metin2.org/api/verify/{id}/{ip}/
| Field | Type | Description |
|---|---|---|
| id | integer | ID of your game server |
| ip | string | IP address of your player |
Responses
1 - Vote verified0 - Already verified or no vote
PHP example
Adapt it with your reward
You need to install our API script on one of your pages on your website. It must be installed on a secure area, that is to say, a page where your player must be connected to your website to consult and access said page. Our API allows you to reward your player for having voted for your game server within our platform, for this you must adapt and add the script of your reward.
<?php
$id = XXX;
// ID of your game server
$ip = isset($_SERVER["HTTP_CF_CONNECTING_IP"]) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER['REMOTE_ADDR'];
// Get your player's IP address
$api = "https://beta.top-metin2.org/api/verify/{$id}/{$ip}/";
// Route
$response = @file_get_contents($api);
// API Call
if ($response && ($response != 0)){
// Vote OK
// You can donate virtual currencies
} else {
// [OR] The vote has already been verified
// [OR] No votes were found
// [OR] An error has occurred
}
?>