Right, so i have been banging my head for awhile and thought i could ask for some help here.
I am trying to do some simple user creation through the reseller api which is located at the "http://panelurl:25500/reseller/reseller_api.php" endpoint.
Now i am trying to create users using this php script:
This seems to do half of the job, it creates users and assigns them a package and reseller notes, but for some reason it generates random username and password and doesn't use the provided ones, so the answer to this api request looks something like this:
My question is how can i pass the username and password params into the api request so that it creates users with those parameters?
Thanks for any help.
I am trying to do some simple user creation through the reseller api which is located at the "http://panelurl:25500/reseller/reseller_api.php" endpoint.
Now i am trying to create users using this php script:
PHP:
$key = 'wrGE2GmHzsOK7Kq'; //apikey reseller
$url= "http://panelurl:25500/reseller/reseller_api.php";
$cURL = curl_init();
curl_setopt($cURL,CURLOPT_URL, $url);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$post = array(
'api_key' => $key, // Enter the API key
'action' => 'usercreate',
'package' => '2', //Package id here;
'username' => 'Test',
'password' => 'Test',
'trial' => '0', //For trial use 1 and for official 0
'reseller_notes' => 'TEST TEST TEST'
) ;
curl_setopt($cURL, CURLOPT_POST, true);
curl_setopt($cURL, CURLOPT_POSTFIELDS, $post);
$result = curl_exec($cURL);
curl_close($cURL);
echo $result;
This seems to do half of the job, it creates users and assigns them a package and reseller notes, but for some reason it generates random username and password and doesn't use the provided ones, so the answer to this api request looks something like this:
PHP:
{"result":"success","username":"ziaGThck9W","password":"8GKwMCBR0y","message":"User operation was completed successfully."}
My question is how can i pass the username and password params into the api request so that it creates users with those parameters?
Thanks for any help.