Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List Whitelist #79

Open
ampsite opened this issue May 25, 2023 · 2 comments
Open

List Whitelist #79

ampsite opened this issue May 25, 2023 · 2 comments

Comments

@ampsite
Copy link

ampsite commented May 25, 2023

can anybody help me?
I am trying to view the tags in the list using php. I don't know how to use the API.

@ItsMeStevieG
Copy link

Getting the users on the whitelist can be done like this:

require_once 'vendor/autoload.php'; // Load Composer's autoloader

use Nitrapi\Nitrapi;

$nitrapi = new Nitrapi('your_api_key', 'your_api_secret');

// Define the server ID for the game server you want to retrieve the whitelist for
$serverId = 'your_server_id';

try {
    // Get the whitelist for the specified server
    $whitelist = $nitrapi->gameservers->getServerWhitelist($serverId);

    // Print the whitelist entries
    foreach ($whitelist as $entry) {
        echo "Player: " . $entry->getUsername() . "\n";
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}

@ozonostudio
Copy link

Whitelist not longer working, now display a 501 error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants