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']);
?>
// 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']);
?>