1. Go to this page and download the library: Download trackbasenet/dev-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
/*
* Available options, specifically for this method:
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'order' => 'asc',
'limit' => 10,
'start' => 1
];
$api->ranklist($options);
/*
* Available options, specifically for this method:
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'order' => 'asc',
'limit' => 10,
'start' => 1
];
$api->toplist($options);
/*
* Available options, specifically for this method:
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'order' => 'asc',
'limit' => 10,
'start' => 1
];
$api->clanRanklist($options);
/*
* Available options, specifically for this method:
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'order' => 'asc',
'limit' => 10,
'start' => 1
];
$api->clanToplist($options);
/*
* Available options, specifically for this method:
* pid: any integer greater than 0 that corresponds to a player's ID
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'pid' => 1,
'order' => 'asc',
'limit' => 10,
'start' => 1
];
$api->playerInfo($options);
/*
* Available options, specifically for this method:
* pid: any integer greater than 0 that corresponds to a player's ID
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'pid' => 1,
'order' => 'asc',
'limit' => 10,
'start' => 1
];
$api->playerServers($options);
/*
* Available options, specifically for this method:
* pid: any integer greater than 0 that corresponds to a player's ID
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'pid' => 1,
'order' => 'asc',
'limit' => 10,
'start' => 1
];
$api->playerSessions($options);
/*
* Available options, specifically for this method:
* cid: any integer greater than 0 that corresponds to a clan's ID
* order: 'asc' or 'desc'
*/
// Following options are default and do not need to be supplied by default
$options = [
'cid' => 1,
'order' => 'asc',
];
$api->clanInfo($options);
/*
* Available options, specifically for this method:
* sid: any integer greater than 0 that corresponds to a server's ID
* order-by: one of the following: ['xp', 'rate', 'rating', 'ping', 'class', 'kills', 'deaths', 'playername']
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'sid' => 1,
'order-by' => 'rate',
'order' => 'desc',
'limit' => 10,
'start' => 1
];
$api->serverInfo($options);
/*
* Available options, specifically for this method:
* sid: any integer greater than 0 that corresponds to a server's ID
* order-by: 'time'
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'sid' => 1,
'order-by' => 'time',
'order' => 'desc',
'limit' => 10,
'start' => 1
];
$api->serverSessions($options);
/*
* Available options, specifically for this method:
* sid: any integer greater than 0 that corresponds to a server's ID
* order-by: one of the following: ['playername', 'rate', 'rating', 'time', 'ratetime', 'lastseen']
* order: 'asc' or 'desc'
* limit: any integer between 1 and 50
* start: any integer greater than 0, useful for pagination
*/
// Following options are default and do not need to be supplied by default
$options = [
'sid' => 1,
'order-by' => 'rate',
'order' => 'desc',
'limit' => 10,
'start' => 1
];
$api->serverUsage($options);
/*
* Available options, specifically for this method:
* uid: any integer greater than 0 that corresponds to a user's ID
* request: binary request number that translates to the information that should be received. For more information, please check the documentation / your app on our developers platform
*/
// Following options are default and do not need to be supplied by default
$options = [
'uid' => 0,
'request' => 0
];
$api->userInfo($options);
// This method is a shortcut for the ->userInfo() method and receives the $user_id and $request integers as its arguments
$api->getUser($user_id, $request);
// This method can be called when you want to connect a user to your app. It returns a redirection header to our developers platform.
$api->connectUser();
// This method needs to be called on the URI that has been submitted as your "Server URL" in your app settings. It holds the logic for fetching a user in the correct way. It // or return the user ID itself. If so, you might want to catch this methods return inside a new variable ($possible_new_user_id)
});