MediaCP API Testing Utility

Input

Custom Params
Reset

Output


It is possible to connect to and perform various functions remotely with the control panel using PHP.

You will be required to download and include the XML-RPC Library for PHP:
https://code.google.com/archive/p/php-ixr/

Table of Contents

  1. Admin Functions
  2. Service Functions
  3. Source Functions

Admin Functions

admin.service_create

Create a new media streaming service attached to a specific customer account.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
username * The user account to create service upon.
userid ALTERNATIVE to specifying username, specify the customers userid instead.
plugin * NoService
shoutcast198
shoutcast2
icecast
windowsMediaServices
wowzaMedia
Flussonic
sourceplugin liquidsoap
ices04
ices20
sctransv1
sctransv2
streamtranscoderv3
Specify a source (autodj) to use with the service if supported.
unique_id * Alphanumeric String (no special characters allowed) The Publish Name to identify the service, for example myShoutcastServer1
portbase INTEGER Specify a port for the service to run on, will otherwise will determined automatically.
servicetype STRING Flussonic - Live Streaming, Ondemand Streaming, TV Station
Wowza - Live Streaming, Ondemand Streaming, TV Station, Live Streaming Low Latency.
rpc_extra BOOL (true/false) If set to true will return an array of the entire service configuration that is created.
maxuser INT (0-99999) Maximum connections to the service.
bitrate 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 400, 480, 560, 640, 720, 800, 920, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584, 4096, 99999 Enter only one of the values in the options column. This may also contain "Kbps" at the end of the option value.
bandwidth INT Maximum Data Transfer per month in MB, specify 0 for no limit.
quota Maximum disk space allocation for service (defaults to 30). Set to 0 for no limit.
customfields ARRAY Specify an array of additional service specific configuration options. You can identify the available parameters by querying an existing service using service.overview. See below PHP Example for more information.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "admin.service_create"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "username" => "admin",
 "unique_id" => "MyNewService",
 "plugin" => "shoutcast198", 
 "sourceplugin" => "",
 "password" => "mypassword", 
 "maxuser" => "25", 
 "bitrate" => "48", 
 "bandwidth" => "10240", 
 "quota" => "1024", 
 "customfields" => array(
 "rtmpenabled" => "yes"
 )
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

admin.service_remove

Permanently removes a media service from the control panel.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
serverid INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "admin.service_remove"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "serverid" => 10
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

admin.service_suspend

Suspends and immediately stops a specific media service.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.
Reason STRING The reason for suspension
Days INT Number of days to suspend service for, or specify "indefinite" for permanent suspension.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "admin.service_suspend"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10, 
 "Reason" => "Failed to complete payment", 
 "Days" => 30
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

admin.service_unsuspend

Unsuspends the service and attempts to restart the media service.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.
<?php
 require_once("../IXR_Library.php");

 $url = "http://localhost/mediacp/";
 $command = "admin.service_unsuspend";
 $arguments = array(
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==",
 "ServerID" => 10,
 );

 $client = new IXR_Client($url. '/system/rpc.php');
 $client->debug = true; /** Set to true if you have difficulties **/

 if ( !$client->query( $command, $arguments) ) {
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage());
 }

 $return = $client->getResponse();

 if ( $return['status'] == 'success' ){
 echo $command. ' executed successfully.';
 }else{
 echo 'failed executing '. $command;
 }

 /** Output debugging information **/
 print_r( $return );

?>

admin.service_update

Updates the configuration of a specific media service.

The below table provides a minimal list of available configurations, you can specify and update any parameter that is returned by service.overview for the specific service, noting that each Media Service (Shoutcast, Icecast, Wowza etc) have different configurations available.

We advise that you do not change the following values as they may cause issues with your service: plugin, sourceplugin, servicetype, portbase.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
serverid * INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.
username The user account to create service upon.
userid ALTERNATIVE to specifying username, specify the customers userid instead.
maxuser INT (0-99999) Maximum connections to the service.
bitrate 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 400, 480, 560, 640, 720, 800, 920, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584, 4096, 99999 Enter only one of the values in the options column. This may also contain "Kbps" at the end of the option value.
bandwidth INT Maximum Data Transfer per month in MB, specify 0 for no limit.
quota Maximum disk space allocation for service (defaults to 30). Set to 0 for no limit.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "admin.service_update"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "serverid" => 10, 
 
 "password" => "mypassword", 
 "maxuser" => "25", 
 "bitrate" => "48", 
 "bandwidth" => "10240", 
 "quota" => "1024"
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

admin.user_create

Create a new customer account within the control panel.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
username ALPHANUMERIC Some special characters are also allowed such as a period, underscore and at symbol.
hash A SHA1 hash combination of the username and password. For example: SHA1( �username� . �password� )
user_level 0 Customer
2 Super Administrator
name ALPHANUMERIC Customers Full name
reseller_plan INTEGER Specify the reseller plan ID if you want to assign the account as a reseller
activated 0 or 1
theme Specify a theme to use for this account, otherwise the default will be used.
language Specify a language to use for this account, otherwise the default will be used.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "admin.user_create"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "username" => "[email protected]", 
 "hash" => SHA1("[email protected]" . "mypassword"), 
 "user_level" => 0,
 "name" => "My Customer", 
 "activated" => 1, 
 "reseller_plan" => 1,
 "theme" => "Experience", 
 "language" => "english"
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

admin.user_update

Update a specific customer account.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
username * Specify the user account that you wish to update
userid ALTERNATIVE to the username, specify the customer id.
hash A SHA1 hash combination of the username and password. For example: SHA1( �username� . �password� )
user_level 0 Customer
2 Super Administrator
name ALPHANUMERIC Customers Full name
activated 0 or 1
theme Specify a theme to use for this account, otherwise the default will be used.
language Specify a language to use for this account, otherwise the default will be used.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "admin.user_update"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "username" => "[email protected]", 
 "hash" => SHA1("[email protected]" . "mynewpassword"), 
 "user_level" => 0,
 "name" => "My Customer", 
 "activated" => 1, 
 "reseller_plan" => 1,
 "theme" => "Experience", 
 "language" => "english"
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

admin.user_remove

Removes a specific customer account.

NOTE: All media services under the account MUST be removed before customer account can be removed.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
username * Specify the user account that you wish to update
userid ALTERNATIVE to the username, specify the customer id.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "admin.user_remove"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "username" => "[email protected]", 
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

Service Functions

service.overview

Outputs an array of the entire service configuration.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID * INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.overview"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.status

Returns the status of the service with one of the following responses.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
serverid INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.status"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "serverid" => 10
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.start

Starts a specific media service.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.start"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.stop

Stops a specific media service.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.stop"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.restart

Restarts a specific media service.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.restart"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.updatetitle

Updates the Now Playing title of a live stream.

Only compatible with Shoutcast 198, Shoutcast 2, Icecast 2 & Icecast KH.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.
unique_id INT ALTERNATIVE to serverid, specify the unique_id of the service to be removed.
NewTitle STRING (250 chars) Text to replace the current Now Playing title of a live stream.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.updatetitle"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10,
 "NewTitle" => "This control panel is the greatest"
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.kicksource

Kicks the active source on a live stream.

Only compatible with Shoutcast 198, Shoutcast 2, Icecast 2 & Icecast KH.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.kicksource"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.wowza_alias

Manage the Stream Alias' of a Wowza Streaming Engine Service.

Only compatible with Wowza Streaming Engine services.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.
action create
remove
The action to perform with the specified alias
alias STRING (50 char) The alias stream name that can be viewed. rtmp://myserver/myapplication/myalias
name STRING (50 char) The actual origin stream that will be viewed. Default ${Stream.Name}

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.wowza_alias"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10,
 "alias" => "myalias",
 "name" => "${Stream.Name}"
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.wowza_tvschedule

Return a list of scheduled playlists from a Wowza TV Station service.

Only compatible with Wowza Streaming Engine services.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID * INT The Service ID to be stopped and removed from the control panel.
date_start MySQL datetime field format YYYY-MM-DD HH:MM:DD
date_end MySQL datetime field format YYYY-MM-DD HH:MM:DD

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.wowza_alias"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10,
 "date_start" => "2015-01-01 00:00:00",
 "date_end" => "2015-01-01 23:00:00"
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

service.wowza_tvschedule_playlist

Returns an array of scheduled files in a specific TV Station playlist.

Only compatible with Wowza Streaming Engine services.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID * INT The Service ID to be stopped and removed from the control panel.
playlist_id INT The playlist id that you wish to retrieve.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "service.wowza_alias"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10,
 "playlist_id" => "1"
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

Source Functions

source.list_playlists

Returns an array of available playlists that have been created under the customer account.

Only compatible with Shoutcast 198, Shoutcast 2, Icecast 2 & Icecast KH.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "source.list_playlists"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

source.status

Returns the status of the source (AutoDJ).

Only compatible with Shoutcast 198, Shoutcast 2, Icecast 2 & Icecast KH.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "source.status"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10 
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

source.restart

Restarts the source plugin associated with a specific service using the last played playlist.

Only compatible with Shoutcast 198, Shoutcast 2, Icecast 2 & Icecast KH.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "source.restart"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10 
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

source.start

Starts the source plugin associated with a specific service using the last played playlist.

Only compatible with Shoutcast 198, Shoutcast 2, Icecast 2 & Icecast KH.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "source.start"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10 
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

source.stop

Stops the source plugin associated with a specific service.

Only compatible with Shoutcast 198, Shoutcast 2, Icecast 2 & Icecast KH.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INT The Service ID to be stopped and removed from the control panel.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "source.stop"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10 
 );  
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>
 

source.schedule

Schedule to switch to a specified playlist at the designated time.

Only compatible with Shoutcast 198, Shoutcast 2, Icecast 2 & Icecast KH.

Limited to 50 schedules per media service.

Parameters

Parameter Options Description
auth * API Key to authenticate to control panel.
ServerID INTEGER The Service ID to be stopped and removed from the control panel.
playlist TEXT Specify a playlist to schedule.
year INTEGER Specify full year, for example 2015 or specify 0 for recurring value.
month INTEGER Specify numeric value of month, for example 01 would be January or specify 0 for recurring value.
day INTEGER Specify numeric value of day, for example 01 would be the 1st of the month or specify 0 for recurring value.
hour Specify numeric value of hour in 24 hours format, for example 16 would be equivalent to 4PM or specify 0 for recurring value.
minute Specify numeric value of minute.

PHP Sample

<?php
 require_once("../IXR_Library.php"); 
 
 $url = "http://localhost/mediacp/";
 $command = "source.schedule"; 
 $arguments = array( 
 "auth" => "VJhZdqjUWpigishesXamoVSp33WZmoxWoZ-7XJysWs6coKyd0K2Glw==", 
 "ServerID" => 10,
 "playlist" => "myplaylist",
 "year" => "2015",
 "month" => "0",
 "day" => "1",
 "hour" => "09",
 "minute" => "00"
 ); 
 
 $client = new IXR_Client($url. '/system/rpc.php'); 
 $client->debug = true; /** Set to true if you have difficulties **/ 
 
 if ( !$client->query( $command, $arguments) ) { 
 die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage()); 
 } 
 
 $return = $client->getResponse(); 
 
 if ( $return['status'] == 'success' ){ 
 echo $command. ' executed successfully.'; 
 }else{ 
 echo 'failed executing '. $command; 
 } 
 
 /** Output debugging information **/ 
 print_r( $return ); 
 
?>