API

This sections demonstrates the use of the API interface to communicate directly with supported devices.

Request Parameter

The REMOVE_SERVER_PROFILE parameter is used to delete a server configuration.

Request = REMOVE_SERVER_PROFILE

Parameters

Description

server_id

ID number of the profile configuration. to obtain a list of configuration profile attached to a username please use the __LIST_SERVER_PROFILE__


Example usage :

<?php 


/**
 * Zerhex Sample API Call
 *
 * @package    Zerhex Digital
 * @author     Zerhex <developer@zerhex.com>
 * @copyright  Copyright (c) Zerhex Digital 20013-2018
 * @link       http://www.zerhex.com/
 */


$API_URL = "https://www.streamerportal.com/api/api.php";

//POST VARIABLES
$postfields['key'] = '8784lahho0775a00zhj9z704a0a5'; //API KEY
$postfields['hash'] = 'dssa65sta288878221est';       //API secret hash
$postfields['Request'] = 'REMOVE_SERVER_PROFILE';
$postfields['server_id'] = '95';


// Call the API
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $API_URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
$response = curl_exec($ch);
if (curl_error($ch)) {
    die('Unable to connect: ' . curl_errno($ch) . ' - ' . curl_error($ch));
}
curl_close($ch);

// Decode response
$jsonData = json_decode($response,true);

//print return data of page.
echo '<pre>';
print_r($jsonData);
echo '</pre>';


?>

Sample Response

<?php 

Array
(
    [ret_code] => SUCCESS
    [msg] => Configuration successfully deleted [95]
    [response] => Array
        (
            [ret] => 1
            [msg] => Configuration successfully deleted [95]
        )

)

?>