Custom API
API URL = [ your admin panel base url ]/sbox_api.php
API TOKEN = /sbox_api.php?token=[ your api token key ]
ACTION = API URL + API TOKEN + &action=create
Create User Device ID
1-Stream :
ACTION + &create_type=device_id_stream&username=xxxxxx&password=xxxxxx&dns=https://abc.com&device_id=xxxxxxxxxx
Xtream Codes or XUI :
ACTION + &create_type=device_id_xtream&username=xxxxxx&password=xxxxxx&dns=https://abc.com&device_id=xxxxxxxxxx
Create User Activation Code
1-Stream :
ACTION + &create_type=activation_stream&username=xxxxxx&password=xxxxxx&dns=https://abc.com
Xtream Codes or XUI :
ACTION + &create_type=activation_xtream&username=xxxxxx&password=xxxxxx&dns=https://abc.com
PHP Code ----------------------------------------------------------------------------------------
<?php
function getAPIRequest($dataUrl){
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_URL, $dataUrl);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$result = curl_exec($curl);
curl_close($curl);
return $result;
}
function createDeviceIDStream(){
$data = 'https:abc.com/sbox_api.php?token=xxxxxxxxx&action=create&create_type=device_id_stream&username=xxxxxx&password=xxxxxx&dns=https://abc.com&device_id=xxxxxxxxxx';
$get_data = getAPIRequest($data);
$response = json_decode($get_data, true);
return $response;
}
function createDeviceIDXtream(){
$data = 'https:abc.com/sbox_api.php?token=xxxxxxxxx&action=create&create_type=device_id_xtream&username=xxxxxx&password=xxxxxx&dns=https://abc.com&device_id=xxxxxxxxxx';
$get_data = getAPIRequest($data);
$response = json_decode($get_data, true);
return $response;
}
function createActivationCodeStream(){
$data = 'https:abc.com/sbox_api.php?token=xxxxxxxxx&action=create&create_type=activation_stream&username=xxxxxx&password=xxxxxx&dns=https://abc.com';
$get_data = getAPIRequest($data);
$response = json_decode($get_data, true);
return $response;
}
function createActivationCodeXtream(){
$data = 'https:abc.com/sbox_api.php?token=xxxxxxxxx&action=create&create_type=activation_xtream&username=xxxxxx&password=xxxxxx&dns=https://abc.com';
$get_data = getAPIRequest($data);
$response = json_decode($get_data, true);
return $response;
}
Last updated