Zone Update for Small Object
Allows you to update a small object zone.
Method | Link |
PUT |
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
user_key | string | Yes | API User Token |
user_secret | string | Yes | API User Secret Token |
zone_id | int | Yes | Zone ID |
label | string | No | Zone Description |
origin_url | string | No | Origin URL |
origin_set_header | string | No | Host header to be used when content is requested from origin. Must be string and not contain "http", "https", "//". |
origin_authentication | bool | object | No | Zone Auth Object |
username | string | Yes | Zone Auth Username for Origin |
password | string | Yes | Zone Auth Password for Origin |
edge_cache | string | No | Valid format: "{number}#{type}" Valid Types: Minute (m). It must between 5 and 59. Hour (h). It must between 1 and 23.Day (d). It must between 1 and 8.Examples: "5#m", "1#h", "3#d". |
browser_cache | string | No | Valid format: "{number}#{type}" Valid Types: Minute (m). It must between 5 and 59. Hour (h). It must between 1 and 23.Day (d). It must between 1 and 8.Examples: "5#m", "1#h", "3#d". |
query_string | bool | No | Allows HTTP Query String for the cache param. |
custom_404 | string | No | Must be string. |
custom_query_string | bool | No | Allows HTTP Custom Query String arguments for the cache params. |
custom_query_string_args | array | No | Custom Query String Arguments. |
custom_headers | array | No | Custom Header Object. It must be array and contains object. |
gzip | bool | No | Gzip compress |
image_compress | bool | No | Gzip option must be enabled for this feature to be activated. |
image_optimization | bool | No | Image optimization feature. |
secure_token | bool | No | When true the auto generated token code will be returned. |
secure_token_refresh | bool | no | This option regenerates the security token key. |
robots | string | no | Valid values; "enable", "disable", "custom" |
whitelist | array | no | Valid domain list |
shared_ssl | bool | no | When true, shared SSL feature will be activated. |
http2 | bool | no | SNI must be enabled for this feature to be active. Additionally, if shared_ssl is enable, this option is automatically activated. |
Return Values
Variable | Type |
---|---|
status | bool |
data | object |
Example PHP Code
<?php
$service_url = 'https://api.medianova.com/v1/zone/small/update;
$ch = curl_init($service_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
$data = array(
'user_key' => 'Your User Key',
'user_secret' =>'Your User Secret',
'label' => 'Zone Label',
'zone_id' =>'Zone Id'
);
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data));
$response = curl_exec($ch);
curl_close($ch);
$decoded = json_decode($response);
?>
Example Output
{
"status": true,
"data": {
"alias": [
"alias.medianova.com"
],
"origin_authentication": {
"username": "username",
"password": "pass"
},
"browser_cache": "2h",
"cdn_url": "cdn_url.mncdn.com",
"create_at": "2016-08-20 11:00:00",
"sni": false,
"edge_cache": "7#d",
"gzip": true,
"http2": false,
"zone_id": 1,
"image_compress": true,
"image_optimization": true,
"label": "cdnlabel",
"name": "cdn_url",
"origin_url": "https://www.medianova.com",
"query_string": false,
"custom_404": "",
"custom_query_string": false,
"custom_query_string_args": [],
"custom_headers": [
[
{
"type": 1,
"key": "Add-Header",
"val": "Add-Header-Value"
},
{
"type": 2,
"key": "Request-Header",
"val": "Request-Header-Value",
},
{
"type": 3,
"key": "Hide-Header"
}
]
],
"robots": "disable",
"secure_token": false,
"secure_token_code": false,
"shared_ssl": false,
"status": true,
"whitelist": [
"whitelist1.mncdn.com",
"whitelist2.mncdn.com"
],
}
}