Please provide a valid credit card using the credit card form on the billing page. Update Card Details
This API creates a SEVU ticket. This ticket allows a user to view a protected video. This system allows you to restrict access to a specific video or subset of videos, to a specific IP address, timeframe and usage count.
$request = array( 'command' => 'sevu.request', 'api_key' => 'ZGQWNWVKOGQZYJAXNTIYMTCXOTAWMWVK', 'timestamp' => time(), 'cdn' => 28, 'app' => 'stef-chorigin', 'video' => 'mystream', 'pass' => 'unique_random_string_per_request', 'ip' => '192.168.0.0/24', 'uses' => 5, 'expire' => '2021-08-25 01:16:39', ); //Create request signature $json_request = json_encode($request); $sig = base64_encode(hash_hmac('sha256', $json_request, '479e4b01ebfb61bc015cf4b3145f139d97cf43c7340965feb24082da45dd60f3', true)); $request['signature'] = $sig; $json_request = json_encode($request); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.scaleengine.net/stable/'); // Set the URL curl_setopt($ch, CURLOPT_POST, true); // Perform a POST curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // If not set, curl prints output to the browser curl_setopt($ch, CURLOPT_HEADER, false); // If set, curl returns headers as part of the data stream curl_setopt($ch, CURLOPT_POSTFIELDS, array('json' => $json_request)); //'Json' string or 'PHP' serialized return $response = curl_exec($ch); //Execute the API Call if (!$response) { die('Failed to connect to ScaleEngine API'); } //Decode the response as an associative array $arrResponse = json_decode($response, true); if ($arrResponse) { //Operation completed successfully //TODO Add work here print_r($arrResponse); } else { //Operation failed echo 'An error occured processing your request:'; print_r($response); }
command | [REQUIRED] [string] - API command to execute |
cdn | [REQUIRED] [int] - The ScaleEngine CDN ID of your account |
api_key | [REQUIRED] [string] - The API key provided as part of your account |
timestamp | [REQUIRED] [int] - The unix timestamp of your request, used to prevent authenticated API requests from being replayed |
app | [REQUIRED]
|
video | [REQUIRED]
|
pass | [REQUIRED] [string] - A randomly generated password. Should be unique for each request. Recommended length atleast 10 characters. |
ip | [REQUIRED]
|
uses | [REQUIRED] [int] - The number of times the video will be allowed to start. This can be used to restrict how many times a ticket may be used, and helps further protect against account sharing |
expire | [REQUIRED] [datetime] - The expiration date of the ticket. After
this time, access will no longer be allowed, the user will
require a new ticket.
Example: 2023-09-26 18:54:56 |
{ "code": 2002, "message": "ScaleEngine Virtual Usher Ticket Granted", "status": "success", "ticket": { "key": "mystream.53ffc996dd39d5.39102367", "pass": "g63clVAI5wFPxY9vwVOJvw6L", "ip": "0.0.0.0/0", "video": "mystream", "app": "myapp-sevu", "created_date": "2014-08-29 00:30:14", "used_date": "0000-00-00 00:00:00", "uses": "5", "active": "1" }, "handle_time":"0.3795 seconds" }
code | [int] - API Response Code | ||||||||||||||||||
message | [string] - Debugging message | ||||||||||||||||||
status | [string] - "success" or "failure" | ||||||||||||||||||
ticket |
|
||||||||||||||||||
handle_time | [float] - The amount of time spent processing your request |