ErrorCode | 101 : | API Key or API Password is Invalid. |
ErrorCode | 5 : | JSON Error |
{ "api_key":"YOUR_API_KEY", "api_password":"YOUR_API_PASSWORD", "process":"useradd", "detail":{ "username":"USERNAME", "password":"PASSWORD", "usergroupid":"USER_GROUP_ID", "downloadspeed":"DOWNLOAD_SPEED", "uploadspeed":"UPLOAD_SPEED", "simuleconn":"SIMULATE_CONNECTION", "enddate":"END_DATE" } }
$url = 'YOUR_LOGIN_URL/api.php'; $data = array("api_key" => "YOUR_API_KEY", "api_password" => "12345", "process" => "useradd", "detail" => array( "username"=>"test", "password"=>"test12345", "usergroupid"=>"1", "downloadspeed"=>"2048", "uploadspeed"=>"1024", "simuleconn"=>"2", "enddate"=>"02-04-2024")); $postdata = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $result = curl_exec($ch); curl_close($ch); print_r ($result);
ResponseCode | 101 : | User added successfully |
ErrorCode | 102 : | User available |
{ "api_key":"YOUR_API_KEY", "api_password":"YOUR_API_PASSWORD", "process":"userdelete", "detail":{ "username":"USERNAME" } }
$url = 'YOUR_LOGIN_URL/api.php'; $data = array("api_key" => "YOUR_API_KEY", "api_password" => "12345", "process" => "userdelete", "detail" => array( "username"=>"test")); $postdata = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $result = curl_exec($ch); curl_close($ch); print_r ($result);
ResponseCode | 103 : | User deleted successfully |
ErrorCode | 104 : | System Error |
{ "api_key":"YOUR_API_KEY", "api_password":"YOUR_API_PASSWORD", "process":"userlist" }
$url = 'YOUR_LOGIN_URL/api.php'; $data = array("api_key" => "YOUR_API_KEY", "api_password" => "123", "process" => "userlist"); $postdata = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $result = curl_exec($ch); curl_close($ch); print_r (json_decode($result, true));
Array ( [0] => Array ( [username] => test1 [detail] => Array ( [password] => 123 [usergroupid] => 1 [downloadspeed] => 5192 [uploadspeed] => 2048 [simuleconn] => 1 [enddate] => 28 Mar 2024 00:00:00 ) ) [1] => Array ( [username] => test2 [detail] => Array ( [password] => 456 [usergroupid] => 2 [downloadspeed] => 2048 [uploadspeed] => 1024 [simuleconn] => 1 [enddate] => 31 May 2024 00:00:00 ) ) )
ErrorCode | 104 : | System Error |
{ "api_key":"YOUR_API_KEY", "api_password":"YOUR_API_PASSWORD", "process":"userlistgroupid", "detail":{"groupid":"GROUP_ID"} }
$url = 'YOUR_LOGIN_URL/api.php'; $data = array("api_key" => "YOUR_API_KEY", "api_password" => "123", "process" => "userlistgroupid", "detail" => array("groupid"=>"GROUP_ID")); $postdata = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $result = curl_exec($ch); curl_close($ch); print_r (json_decode($result, true));
Array ( [0] => Array ( [username] => test1 [password] => 123 [usergroupid] => 1 [downloadspeed] => 5192 [uploadspeed] => 2048 [simuleconn] => 1 [enddate] => 28 Mar 2024 00:00:00 ) [1] => Array ( [username] => test2 [password] => 456 [usergroupid] => 2 [downloadspeed] => 2048 [uploadspeed] => 1024 [simuleconn] => 1 [enddate] => 31 May 2024 00:00:00 ) )
ErrorCode | 104 : | System Error |
{ "api_key":"YOUR_API_KEY", "api_password":"YOUR_API_PASSWORD", "process":"userdetail", "detail":{"username":"test2"} }
$url = 'YOUR_LOGIN_URL/api.php'; $data = array("api_key" => "YOUR_API_KEY", "api_password" => "123", "process" => "userdetail", "detail" => array("username"=>"test2")); $postdata = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $result = curl_exec($ch); curl_close($ch); print_r (json_decode($result, true));
Array ( [0] => Array ( [username] => test2 [detail] => Array ( [password] => 456 [usergroupid] => 2 [downloadspeed] => 2048 [uploadspeed] => 1024 [simuleconn] => 1 [enddate] => 31 May 2024 00:00:00 ) ) )
ErrorCode | 104 : | System Error |