Geoblocking Add
Allows you to define Geoblock.
Method | Link |
POST |
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
user_key | string | Yes | API User Token |
user_secret | string | Yes | API User Secret Token |
zone_ids | array | Yes | Zone Ids |
label | string | Yes | Rule label |
start_date | string | Yes | It must be "Y-m-d H:i:s" |
end_date | string | Yes | It must be "Y-m-d H:i:s" |
403_url | string | No | Link should be a valid web link. |
countries | array | Yes | This field should include code of countries. If type parameter is not given, this field should be filled with country codes. |
white_ip_list | array | No | List of IPs that will bypass the geo-blocking in the countries where a stream is blocked. It must be IPv4 or empty. |
black_ip_list | array | No | A list of IPs that will be blocked in the country where streaming is allowed. It must be IPv4 or empty. |
type | string | No | "allowed" or "blocked". If none is given, the default value is "allowed". |
Example PHP Code
<?php
$curl_post_data = array(
'user_key' => 'Your User Key',
'user_secret' =>'Your User Secret',
'zone_ids' => ['zoneid1', 'zoneid2'],
'label' => 'Rule Label',
'start_date' => '2018-08-28 12:00:00',
'end_date' => '2018-08-29 00:00:00',
'countries' => ['county_code1', 'country_code2']);
$request_body = json_encode($curl_post_data);
$service_url = 'https://api.medianova.com/v1/geoblocking/stream/add';
$ch = curl_init($service_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($request_body))
);
$response = curl_exec($ch);
$decoded = json_decode($response);
var_dump($decoded); ?>
Example Output
{
"status": true,
"opid": "576UWnEydPJfXAYB"
}