Halloween Sale

We currently have a 25% sale on ALL items at https://store.thexyznetwork.xyz

Players (Users)

GET
   /api/users/?id={id}

Description

When given a SteamID64, this will return the user and a handful fo basic data. This is useful for verifying a user when letting them access specific things.

Parameters

Name Type Description Required
id Integer The SteamID64 of the user you'd like the information from. Yes

Return

Name Type Description
uid Integer The users SteamID64 (Will be the one given as the id parameter).
rpname String The users current in-game name.
salary Integer The users salary. Currently always gives 45, rendering it useless.
wallet Integer The users money, this will consist of everything inside their wallet.
playtime Integer The total amount of time in seconds the user has palyed on the server.
lastjoin Integer The unix timestamp for the last time the user joined.
usergroup String The usergroup of the user.
ban Array/Bool The banning admin and their ID, the ban reason and the experation date of the ban.
roles Array A list of all jobs they are whitelisted for. This may include jobs that no longer exist.

To note

If you give it an invalid ID or the ID has no logged data, it will return a JSON table with 1 entry, this entry will be called "error" and it will be the error message.

Example URL

https://thexyznetwork.xyz/api/users/?id=76561198058562944

Example Code

<?php

// Small php example

$id = "76561198058562944";
$url = "https://thexyznetwork.xyz/api/users/?id=" . $id;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "The XYZ Network API");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

if(!$response = curl_exec($ch)) {
echo curl_error($ch);
}
curl_close($ch);

$data = json_decode($response, true);

echo "User's name: " . $data['rpname'];
echo "<br>";
echo "User's wallet: $" . number_format($data['wallet']);
echo "<br>";
echo "Users's whitelist count: " . count($data['roles']);

?>

Jobs (Teams)

GET
   /api/whitelist/?team={team}

Description

When given a valid in-game job, it will give you a list of all SteamID64s that are whitelsited to it.

Parameters

Name Type Description Required
team String The in-game job that you want to see all whitelists for. Replace all spaces with + signs when inputting the url. Yes

Return

Name Type Description
team String The team you are searching up (Will be the one given as the team parameter).
count Integer The total amount of found users with that whitelist (It counts the given users array).
users Array A list of all the SteamID64s that are whitelisted to this job.

Example URL

https://thexyznetwork.xyz/api/whitelist/?team=Police+Officer

Example Code

<?php

// Small php example
$team = "Police+Officer";
$url = "https://thexyznetwork.xyz/api/whitelist/?team=" . $team;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "The XYZ Network API");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

if(!$response = curl_exec($ch)) {
echo curl_error($ch);
}
curl_close($ch);

$data = json_decode($response, true);

echo "Team name: " . $data['team'];
echo "<br>";
echo "Team count: " . number_format($data['count']);

?>

Discord (Users)

GET
   /api/discord/?s_id={steamid}&d_id={discordid}

Description

When given a SteamID64 OR a DiscordID, it will return the linked IDs that have been processed with the verification bot on our discord.

Parameters

Name Type Description Required
s_id Integer The SteamID64 of the user you want the DiscordID of. Conditioned
d_id Integer The DiscordID of the user you want the SteamID of. Conditioned

Return

Name Type Description
steamid32 String The SteamID32 of the provided ID.
steamid64 Integer Either the provided SteamID or the linked ID to the provided DiscordID.
discord Integer Either the provided DiscordID or the linked ID to the provided SteamID.

Example URLs

https://thexyznetwork.xyz/api/discord/?s_id=76561198058562944
https://thexyznetwork.xyz/api/discord/?d_id=109795034194251776

Example Code

<?php

// Small php example
$discordID = "109795034194251776";
$url = "https://thexyznetwork.xyz/api/discord/?d_id=$discordID";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "The XYZ Network API");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

if(!$response = curl_exec($ch)) {
echo curl_error($ch);
}
curl_close($ch);

$data = json_decode($response, true);

echo "SteamID32: " . $data['steam32'];
echo "<br>";
echo "SteamID63: " . $data['steam64'];
echo "<br>";
echo "Discord: " . $data['discord'];

?>