I try get account list on WHM. But my access code doesn't work. Request url return;
{"cpanelresult":{"apiversion":"2","error":"Token denied","data":{"reason":"Token denied","result":"0"},"type":"text"}}
My code is;
$url="https://raxxun.net:2087/cpsess421xxx09/json-api/listaccts?api.version=1&search=albxxros&searchtype=user";
$cek=file_get_contents($url);
echo $cek;
I get as token code cpsess421xxx09 in WHM. Where are my wrong?
You will need following server details to get all accounts –
WHM login URL
WHM usernmae
WHM accesshash key
Below is the API you can use if you have upper details :-
NOTE:- For Accesshash key , New or already generated Access key can get from here:- WHM > Remote Access Key area and the Access Key located there. or it should be at this path “/usr/local/cpanel/bin/realmkaccesshash