Closed adnanafzal565 closed 4 years ago
Hi, which function are you using with this sdk?
Thanks for quick reply. I am trying to get a list of all users on my panel, below is a CURL PHP function that I am trying to execute. Let me know if I am calling it correctly:
$pterodactyl = new \HCGCloud\Pterodactyl\Pterodactyl($api_key, $server_address);
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => "api/application/users", CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => array( "Authorization: Bearer meowmeowmeow", "Content-Type: application/json", "Accept: Application/vnd.pterodactyl.v1+json" ) ));
$response = curl_exec($curl); curl_close($curl);
print_r($response);
The issue was in CURLOPT_URL, I had to give complete URL including IP address.
CURLOPT_URL => "http://45.142.115.1/api/application/users",
Thanks.
you can call the functions of this sdk, using curl to make requests directly is not necessary.
Yes, it was the problem in URL. It has been fixed.
Thank you for your qiuck and helpful reply.
Hi.
I am sending request to this address: "https://pterodactyl.app/api/application/users" and I am receiving "site not found" error. Even in browser.