Server API Resellers
š¤ MidnightStreamer Pro API ā Resellers Management
MidnightStreamer Pro offers a full API suite to manage resellers on your IPTV panel. You can create, update, credit, or list resellers through authenticated HTTP POST calls.
ā API Access Prerequisite
Before using the API:
- Go to General Settings ā API Settings
- Whitelist your server IP
- Generate your API Key
You can send the API key using POST
or as the 4th segment in the URL.
ā Add a New Reseller
Endpoint:
http://your-domain:8000/api/resellers/new
Required Parameter:
name
Optional Parameters:
max_allowed_connections
use_credits
credits
Example PHP Code:
$panel_url = 'http://your-domain:8000/';
$api_key = 'your_api_key';
$name = 'test_reseller';
$max_allowed_connections = 100;
$use_credits = true;
$credits = 50;
$post_data = array(
'api_key' => $api_key,
'data' => array(
'name' => $name,
'max_allowed_connections' => $max_allowed_connections,
'use_credits' => $use_credits,
'credits' => $credits
)
);
$opts = array('http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($post_data)
));
$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/resellers/new", false, $context), true);
āļø Edit a Reseller
Endpoint:
http://your-domain:8000/api/resellers/update
Required:
id
orusername
Example PHP Code:
$id = 5;
$credits = 100;
$post_data = array(
'api_key' => $api_key,
'id' => $id,
'data' => array('credits' => $credits)
);
$opts = array('http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($post_data)
));
$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/resellers/update", false, $context), true);
š³ Add Credits to a Reseller
Endpoint:
http://your-domain:8000/api/resellers/add_credits
Required:
id
orusername
credits
Example PHP Code:
$id = 5;
$credits = 25;
$post_data = array(
'api_key' => $api_key,
'id' => $id,
'credits' => $credits
);
$opts = array('http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($post_data)
));
$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/resellers/add_credits", false, $context), true);
š List All Resellers
Endpoint:
http://your-domain:8000/api/resellers/list
No parameters required.
Example PHP Code:
$post_data = array('api_key' => $api_key);
$opts = array('http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($post_data)
));
$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/resellers/list", false, $context), true);