CDN API v1
The LeaseWeb CDN API allows you to manage your CDN zones, files and more. JSON will be returned in all responses from the API, unless stated otherwise.
Purge
POSThttps://api.leasewebcdn.com/content/purge/12387392/12341REQUEST EXAMPLE
curl --request POST \
--url https://api.leasewebcdn.com/content/purge/12387392/12341 \
--header 'content-type: application/json' \
--data '{
"urls": ["http://thumbs.leaseweb.com/1.jpg", "http://thumbs.leaseweb.com/2.jpg"]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/content/purge/12387392/12341",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"urls\": [\"http://thumbs.leaseweb.com/1.jpg\", \"http://thumbs.leaseweb.com/2.jpg\"]}",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
payload = "{ \"urls\": [\"http://thumbs.leaseweb.com/1.jpg\", \"http://thumbs.leaseweb.com/2.jpg\"]}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/content/purge/12387392/12341", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/content/purge/12387392/12341")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"urls\": [\"http://thumbs.leaseweb.com/1.jpg\", \"http://thumbs.leaseweb.com/2.jpg\"]}"
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success": 1234
}
POSTPurge file(s) from a zone
To purge a file from a zone, send a POST request to
/content/purge/{customer_number}/{zone_id}/
.
The response will be a JSON object with the key success
that contains a jobID
e.g.: 1234
for the purge job.
Name | Type | Description |
---|---|---|
success | integer | The job ID |
The following properties should be part of the request:
Name | Type | Required | Description |
---|---|---|---|
urls | array | true | List of files that will be purged. To purge all the cached files provide the wildcard as the first element of the list, e.g., `{'urls': ['*']}`. **Be very careful with this option, because it will instantly purge all cached files!** This can have great consequences for the load on your origin servers. |
GEThttps://api.leasewebcdn.com/content/purge/12387392/12341/9238029382REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/content/purge/12387392/12341/9238029382
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/content/purge/12387392/12341/9238029382",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/content/purge/12387392/12341/9238029382")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/content/purge/12387392/12341/9238029382")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
[
{
"http://thumbs.leaseweb.com/image.jpg": "Queued"
}
]
}
GETRetrieve the status of a Purgejob
To retrieve the the Purge job information, send a GET request to
/content/purge/{customer_number}/{zone_id}/{job_id}
.
The response will be a JSON object with the key success
that contains the
files to be purged for the purge job.
Name | Type | Description |
---|---|---|
http://thumbs.leaseweb.com/images.jpg | string | Queued |
Prefetch (warm up)
POSThttps://api.leasewebcdn.com/content/warmup/23984292/12342REQUEST EXAMPLE
curl --request POST \
--url https://api.leasewebcdn.com/content/warmup/23984292/12342 \
--header 'content-type: application/json' \
--data '{
"urls": ["http://thumbs.leaseweb.com/1.jpg", "http://thumbs.leaseweb.com/2.jpg"]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/content/warmup/23984292/12342",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"urls\": [\"http://thumbs.leaseweb.com/1.jpg\", \"http://thumbs.leaseweb.com/2.jpg\"]}",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
payload = "{ \"urls\": [\"http://thumbs.leaseweb.com/1.jpg\", \"http://thumbs.leaseweb.com/2.jpg\"]}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/content/warmup/23984292/12342", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/content/warmup/23984292/12342")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"urls\": [\"http://thumbs.leaseweb.com/1.jpg\", \"http://thumbs.leaseweb.com/2.jpg\"]}"
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success": "f4b57bd0-54f3-11e7-9598-0800200c9a66"
}
POSTPrefetch file(s) from a zone
To prefetch a file from a zone, send a POST request to
/content/warmup/{customer_number}/{zone_id}/{http | https}
.
The payload of the POST request must be an object with a single element urls
,
which has a list of files that will be prefetched.
The response will be a JSON object with the key success
that contains a job
GUID e.g.: f4b57bd0-54f3-11e7-9598-0800200c9a66
for the prefetch job.
Name | Type | Description |
---|---|---|
success | integer | The job GUID |
The following properties should be part of the request:
Name | Type | Required | Description |
---|---|---|---|
urls | array | true | List of files that will be prefetched. |
GEThttps://api.leasewebcdn.com/content/warmup/23984292/12342/129872893221REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/content/warmup/23984292/12342/129872893221
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/content/warmup/23984292/12342/129872893221",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/content/warmup/23984292/12342/129872893221")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/content/warmup/23984292/12342/129872893221")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"completed": true
}
GETRetrieve the status of a prefetch job
To retrieve the the prefetch job information, send a GET request to
/content/warmup/{customer_number}/{zone_id}/{job_guid}
.
The response will be a JSON object with the key completed
that contains the
result for prefetch job.
Name | Type | Description |
---|---|---|
completed | boolean | Prefetch job status |
Customers
GEThttps://api.leasewebcdn.com/customers/193923232/10/0REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/customers/193923232/10/0
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/customers/193923232/10/0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/customers/193923232/10/0")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/customers/193923232/10/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"ftp_quota":100,
"reseller":0,
"parent":"1234567890",
"companyName":"LeaseWeb",
"api_secret":"f33f333ff33f33ff3fff333f333f33f3f3f333ff",
"created_at":1418165896,
"updated_at":1418165896,
"customer_number":"12345",
"active":1,
"id":123,
"notes":"This is a test"
}
}
GETRetrieve Customer information
To retrieve the Customers information, send a GET request to
/customers/{customer_number}/{limit}/{offset}
.
The response will be a JSON object with the key success
that contains the
customers information.
Name | Type | Description |
---|---|---|
ftp_quota | integer | The ftp quota assigned to the customer |
reseller | integer | If the customer is a reseller |
parent | string | The parent customer number |
companyName | string | The company name of the customer |
api_secret | string | The api secret of the customer |
created_at | timestamp | When the customer was created |
updated_at | timestamp | When the customer was last updated |
customer_number | string | The customer number |
id | integer | The customer ID |
active | integer | If the customer is active |
notes | string | Notes added to the customer |
GEThttps://api.leasewebcdn.com/customers/reseller/2938932/21921211REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/customers/reseller/2938932/21921211
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/customers/reseller/2938932/21921211",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/customers/reseller/2938932/21921211")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/customers/reseller/2938932/21921211")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"1407900413":
{
"0":
{
"active":1,
"api_secret":"111f111f1f1f1f1fff1f1f1f1f111f1f1f1f1ffff1f",
"ftp_quota":100,
"reseller":0,
"companyName":"LeaseWeb",
"notes":"This is a test",
"customer_number":"12345"
},
"1":
{
"active":1,
"api_secret":"111f111f1f1f1f1fff1f1f1f1f111f1f1f1f1ffff1f",
"ftp_quota":100,
"reseller":0,
"companyName":"LeaseWeb",
"notes":"This is a test",
"customer_number":"12346"
},
"2":
{
"active":1,
"api_secret":"111f111f1f1f1f1fff1f1f1f1f111f1f1f1f1ffff1f",
"ftp_quota":100,
"reseller":0,
"companyName":"LeaseWeb",
"notes":"This is a test",
"customer_number":"12347"
}
}
}
}
GETRetrieve subCustomer information
To retrieve the subCustomer information, send a GET request to
/customers/reseller/{customerNumber}/{subCustomerNumber}
.
The response will be a JSON object with the key success
and your
customer_number
key that contains the subCustomers information.
Name | Type | Description |
---|---|---|
reseller | integer | If the subCustomer is a reseller |
companyName | string | The company name of the subCustomer |
notes | string | Notes added to the subCustomer |
active | integer | If the subCustomer is active |
api_secret | string | The api secret key of the subCustomer |
ftp_quota | integer | The ftp quota set to the subCustomer |
customer_number | string | The customer number of the subCustomer |
POSThttps://api.leasewebcdn.com/customers/reseller/2938932/21921211REQUEST EXAMPLE
curl --request POST \
--url https://api.leasewebcdn.com/customers/reseller/2938932/21921211 \
--header 'content-type: application/json' \
--data '{
"active": 1,
"ftp_quota": 100
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/customers/reseller/2938932/21921211",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"active\": 1, \"ftp_quota\": 100}",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
payload = "{ \"active\": 1, \"ftp_quota\": 100}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/customers/reseller/2938932/21921211", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/customers/reseller/2938932/21921211")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"active\": 1, \"ftp_quota\": 100}"
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"1407900413":
{
"0":
{
"active":1,
"api_secret":"111f111f1f1f1f1fff1f1f1f1f111f1f1f1f1ffff1f",
"ftp_quota":100,
"reseller":0,
"companyName":"LeaseWeb",
"notes":"This is a test",
"customer_number":"12345"
}
}
}
}
POSTUpdate or create a subCustomer
To update or create a subCustomer, send a POST request to
/customers/{customer_number}/{subCustomer_number}
.
The response will be a JSON object with the key success
.
Name | Type | Description |
---|---|---|
reseller | integer | If the subCustomer is a reseller |
companyName | string | The company name of the subCustomer |
notes | string | Notes added to the subCustomer |
active | integer | If the subCustomer is active |
api_secret | string | The api secret key of the subCustomer |
ftp_quota | integer | The ftp quota set to the subCustomer |
customer_number | string | The customer number of the subCustomer |
The following properties should be part of the request:
Name | Type | Required | Description |
---|---|---|---|
active | integer | false | Sets the sub-customer as active (1) or inactive (0). (Allowed values: 0,1) |
ftp_quota | integer | false | Sets the FTP Quota for the sub-customer. |
GEThttps://api.leasewebcdn.com/customers/acl/12342992REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/customers/acl/12342992
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/customers/acl/12342992",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/customers/acl/12342992")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/customers/acl/12342992")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"12345":
{
"content":
{
"POST":true,
"GET":true,
"DELETE":true
},
"search":
{
"GET":true
},
"stats":
{
"GET":true
},
"logs":
{
"GET":true
},
"origins":
{
"PUT":false,
"POST":false,
"GET":false,
"DELETE":false
},
"customers":
{
"POST":true,
"GET":true,
"DELETE":true
},
"zones":
{
"POST":true,
"GET":true,
"DELETE":true
},
"ftplog":
{
"POST":false,
"GET":false,
"DELETE":false
}
}
}
}
GETRetrieve a customers Access Control List
To retrieve the customers Access Control List, send a GET request to
/customers/acl/{customer_number}
.
The response will be a JSON object with the key success
and customer_number
key that contains the information. The Access Control List contains settings
that can be either true
or false
Name | Type | Description |
---|---|---|
content | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
search | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
stats | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
logs | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
origins | array | |
> PUT | boolean | PUT permissions |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
customers | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
zones | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
ftplog | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
POSThttps://api.leasewebcdn.com/customers/acl/12342992REQUEST EXAMPLE
curl --request POST \
--url https://api.leasewebcdn.com/customers/acl/12342992 \
--header 'content-type: application/json' \
--data '{
"search_get": "1",
"stats_get": "1",
"logs_get": "1",
"content_get": "1",
"content_post": "1",
"content_delete": "1",
"customers_get": "1",
"customers_post": "1",
"customers_delete": "1",
"zones_get": "1",
"zones_post": "1",
"zones_delete": "1"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/customers/acl/12342992",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"search_get\": \"1\", \"stats_get\": \"1\", \"logs_get\": \"1\", \"content_get\": \"1\", \"content_post\": \"1\", \"content_delete\": \"1\", \"customers_get\": \"1\", \"customers_post\": \"1\", \"customers_delete\": \"1\", \"zones_get\": \"1\", \"zones_post\": \"1\", \"zones_delete\": \"1\"}",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
payload = "{ \"search_get\": \"1\", \"stats_get\": \"1\", \"logs_get\": \"1\", \"content_get\": \"1\", \"content_post\": \"1\", \"content_delete\": \"1\", \"customers_get\": \"1\", \"customers_post\": \"1\", \"customers_delete\": \"1\", \"zones_get\": \"1\", \"zones_post\": \"1\", \"zones_delete\": \"1\"}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/customers/acl/12342992", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/customers/acl/12342992")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"search_get\": \"1\", \"stats_get\": \"1\", \"logs_get\": \"1\", \"content_get\": \"1\", \"content_post\": \"1\", \"content_delete\": \"1\", \"customers_get\": \"1\", \"customers_post\": \"1\", \"customers_delete\": \"1\", \"zones_get\": \"1\", \"zones_post\": \"1\", \"zones_delete\": \"1\"}"
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"12345":
{
"content":
{
"POST":true,
"GET":true,
"DELETE":true
},
"search":
{
"GET":true
},
"stats":
{
"GET":true
},
"logs":
{
"GET":true
},
"origins":
{
"PUT":false,
"POST":false,
"GET":false,
"DELETE":false
},
"customers":
{
"POST":true,
"GET":true,
"DELETE":true
},
"zones":
{
"POST":true,
"GET":true,
"DELETE":true
},
"ftplog":
{
"POST":false,
"GET":false,
"DELETE":false
}
}
}
}
POSTUpdate a customers Access Control List
To update the Access Control List, send a POST request to
/customers/acl/{customer_number}/
.
The response will be a JSON object with the key success
and customer_number
key that contains the information. The Access Control List contains settings
that can be either true
or false
Name | Type | Description |
---|---|---|
content | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
search | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
stats | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
logs | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
origins | array | |
> PUT | boolean | PUT permissions |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
customers | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
zones | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
ftplog | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
DELETEhttps://api.leasewebcdn.com/customers/acl/12342992REQUEST EXAMPLE
curl --request DELETE \
--url https://api.leasewebcdn.com/customers/acl/12342992
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/customers/acl/12342992",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("DELETE", "/customers/acl/12342992")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/customers/acl/12342992")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"12345":
{
"content":
{
"POST":true,
"GET":true,
"DELETE":true
},
"search":
{
"GET":true
},
"stats":
{
"GET":true
},
"logs":
{
"GET":true
},
"origins":
{
"PUT":false,
"POST":false,
"GET":false,
"DELETE":false
},
"customers":
{
"POST":true,
"GET":true,
"DELETE":true
},
"zones":
{
"POST":true,
"GET":true,
"DELETE":true
},
"ftplog":
{
"POST":false,
"GET":false,
"DELETE":false
}
}
}
}
DELETEDelete a customers Access Control List
To delete the Access Control List, send a DELETE request to
/customers/acl/{customer_number}/
.
The response will be a JSON object with the key success
and customer_number
key that contains the information. The Access Control List contains settings
that can be either true
or false
Name | Type | Description |
---|---|---|
content | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
search | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
stats | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
logs | array | |
> GET | boolean | GET permissions |
------------------- | --------- | -------------------------------------------------------------- |
origins | array | |
> PUT | boolean | PUT permissions |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
customers | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
zones | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
------------------- | --------- | -------------------------------------------------------------- |
ftplog | array | |
> POST | boolean | POST permissions |
> GET | boolean | GET permissions |
> DELETE | boolean | DELETE permissions |
Origins
GEThttps://api.leasewebcdn.com/origins/123456789REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/origins/123456789
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/origins/123456789",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/origins/123456789")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/origins/123456789")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"succes":
{
"id": 1,
"label": "My thumbs Origin",
"origin": "http://thumbs.leaseweb.com",
"refresh_every": 86400,
"ignore_cache_control": 0,
"basic_auth_user": "Leaseweb",
"basic_auth_password" : "bewesaeL",
"headers_origin" : "User-Agent: f222222ff2f2222f2f2ff2ff2ff22222"
}
}
GETRetrieve all origins
To retrieve all origins, send a GET request to /origins/{customer_number}
.
The response will be a JSON object with the key success
that contains the
origins.
Name | Type | Description |
---|---|---|
id | integer | The ID of the Origin |
origin_type | string | Type of origin: "simple" or "s3" |
label | string | Custom name for the Origin |
origin | string | The URL (HTTP) of the customer’s source, on domain level |
s3_bucket_name | string | The name of the S3 bucket (if origin type is S3) or empty string otherwise |
refresh_every | integer | Refresh time for the Origin |
ignore_cache_control | integer | Ignore Origin Cache Control values set by the Origin and use the CDN values. (0 = Inactive, 1 = Active) |
proxy_header_host | string | The host sent in the header |
cache_key | string | The key used to define the caching |
basic_auth_user | string | The username (or access key id for s3 origin) that is used to authenticate the Origin |
basic_auth_password | string | The password (or access key secret for s3 origin) that is used to authenticate the Origin |
headers_origin | string | The HTTP headers that are added to the Origin request |
POSThttps://api.leasewebcdn.com/origins/123456789REQUEST EXAMPLE
curl --request POST \
--url https://api.leasewebcdn.com/origins/123456789 \
--header 'content-type: application/json' \
--data '{
"label": "My thumbs Origin",
"origin": "http://thumbs.leaseweb.com",
"refresh_every": 86400,
"ignore_cache_control": 0,
"basic_auth_user": "Leaseweb",
"basic_auth_password" : "bewesaeL",
"headers_origin" : "User-Agent: f222222ff2f2222f2f2ff2ff2ff22222"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/origins/123456789",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"label\": \"My thumbs Origin\", \"origin\": \"http://thumbs.leaseweb.com\", \"refresh_every\": 86400, \"ignore_cache_control\": 0, \"basic_auth_user\": \"Leaseweb\", \"basic_auth_password\" : \"bewesaeL\", \"headers_origin\" : \"User-Agent: f222222ff2f2222f2f2ff2ff2ff22222\"}",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
payload = "{ \"label\": \"My thumbs Origin\", \"origin\": \"http://thumbs.leaseweb.com\", \"refresh_every\": 86400, \"ignore_cache_control\": 0, \"basic_auth_user\": \"Leaseweb\", \"basic_auth_password\" : \"bewesaeL\", \"headers_origin\" : \"User-Agent: f222222ff2f2222f2f2ff2ff2ff22222\"}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/origins/123456789", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/origins/123456789")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"label\": \"My thumbs Origin\", \"origin\": \"http://thumbs.leaseweb.com\", \"refresh_every\": 86400, \"ignore_cache_control\": 0, \"basic_auth_user\": \"Leaseweb\", \"basic_auth_password\" : \"bewesaeL\", \"headers_origin\" : \"User-Agent: f222222ff2f2222f2f2ff2ff2ff22222\"}"
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"succes":
{
"id": 1,
"label": "My thumbs Origin",
"origin": "http://thumbs.leaseweb.com",
"refresh_every": 86400,
"ignore_cache_control": 0,
"basic_auth_user": "Leaseweb",
"basic_auth_password" : "bewesaeL",
"headers_origin" : "User-Agent: f222222ff2f2222f2f2ff2ff2ff22222"
}
}
POSTCreate a new origin
To create an new origin, send a POST request to /origins/{customer_number}
.
The response will be a JSON object with the key success
that contains the new
origin.
Name | Type | Description |
---|---|---|
label | string | Custom name for the Origin |
origin | string | The URL (HTTP) of the customer’s source, on domain level |
refresh_every | integer | Refresh time for the Origin |
ignore_cache_control | integer | Ignore Origin Cache Control values set by the Origin and use the CDN values. (0 = Inactive, 1 = Active) |
basic_auth_user | string | The username that is used to authenticate the Origin |
basic_auth_password | string | The password that is used to authenticate the Origin |
headers_origin | string | The HTTP headers that are added to the Origin request |
The following properties should be part of the request:
Name | Type | Required | Description |
---|---|---|---|
label | string | false | Custom name for the Origin. |
origin | string | false | The URL (HTTP) of the customer’s source, on domain level. |
refresh_every | integer | false | Refresh time for the Origin. Must be between 0 and 1000000. |
ignore_cache_control | boolean | false | Ignore Origin Cache Control values set by the Origin and use the CDN values. 0 = Inactive, 1 = Active |
basic_auth_user | string | false | The username that will be used to authenticate the Origin. |
basic_auth_password | string | false | The password that will be used to authenticate the Origin. |
headers_origin | string | false | HTTP headers that will be added to the Origin request. |
GEThttps://api.leasewebcdn.com/origins/123456789/123REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/origins/123456789/123
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/origins/123456789/123",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/origins/123456789/123")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/origins/123456789/123")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"succes":
{
"id": 1,
"label": "My thumbs Origin",
"origin": "http://thumbs.leaseweb.com",
"refresh_every": 86400,
"ignore_cache_control": 0,
"basic_auth_user": "Leaseweb",
"basic_auth_password" : "bewesaeL",
"headers_origin" : "User-Agent: f222222ff2f2222f2f2ff2ff2ff22222"
}
}
GETRetrieve a single Origin
To retrieve a specific Origin, send a GET request to
/origins/{customer_number}/{originID}
.
The response will be a JSON object with the key success
that contains the
specified origin.
Name | Type | Description |
---|---|---|
id | integer | The ID of the Origin |
origin_type | string | Type of origin: "simple" or "s3" |
label | string | Custom name for the Origin |
origin | string | The URL (HTTP) of the customer’s source, on domain level |
s3_bucket_name | string | The name of the S3 bucket (if origin type is S3) or empty string otherwise |
refresh_every | integer | Refresh time for the Origin |
ignore_cache_control | integer | Ignore Origin Cache Control values set by the Origin and use the CDN values. (0 = Inactive, 1 = Active) |
proxy_header_host | string | The host sent in the header |
cache_key | string | The key used to define the caching |
basic_auth_user | string | The username (or access key id for s3 origin) that is used to authenticate the Origin |
basic_auth_password | string | The password (or access key secret for s3 origin) that is used to authenticate the Origin |
headers_origin | string | The HTTP headers that are added to the Origin request |
PUThttps://api.leasewebcdn.com/origins/123456789/123REQUEST EXAMPLE
curl --request PUT \
--url https://api.leasewebcdn.com/origins/123456789/123 \
--header 'content-type: application/json' \
--data '{
"label": "My thumbs Origin",
"origin": "http://thumbs.leaseweb.com",
"refresh_every": 86400,
"ignore_cache_control": 0,
"basic_auth_user": "Leaseweb",
"basic_auth_password" : "bewesaeL",
"headers_origin" : "User-Agent: f222222ff2f2222f2f2ff2ff2ff22222"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/origins/123456789/123",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{ \"label\": \"My thumbs Origin\", \"origin\": \"http://thumbs.leaseweb.com\", \"refresh_every\": 86400, \"ignore_cache_control\": 0, \"basic_auth_user\": \"Leaseweb\", \"basic_auth_password\" : \"bewesaeL\", \"headers_origin\" : \"User-Agent: f222222ff2f2222f2f2ff2ff2ff22222\"}",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
payload = "{ \"label\": \"My thumbs Origin\", \"origin\": \"http://thumbs.leaseweb.com\", \"refresh_every\": 86400, \"ignore_cache_control\": 0, \"basic_auth_user\": \"Leaseweb\", \"basic_auth_password\" : \"bewesaeL\", \"headers_origin\" : \"User-Agent: f222222ff2f2222f2f2ff2ff2ff22222\"}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/origins/123456789/123", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/origins/123456789/123")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"label\": \"My thumbs Origin\", \"origin\": \"http://thumbs.leaseweb.com\", \"refresh_every\": 86400, \"ignore_cache_control\": 0, \"basic_auth_user\": \"Leaseweb\", \"basic_auth_password\" : \"bewesaeL\", \"headers_origin\" : \"User-Agent: f222222ff2f2222f2f2ff2ff2ff22222\"}"
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success": ""
}
PUTUpdate a single Origin
To update a specific Origin, send a PUT request to
/origins/{customer_number}/{originID}
.
The response will be a JSON object with the key success
that contains the
specified origin.
Name | Type | Description |
---|---|---|
label | string | Custom name for the Origin |
origin | string | The URL (HTTP) of the customer’s source, on domain level |
refresh_every | integer | Refresh time for the Origin |
ignore_cache_control | integer | Ignore Origin Cache Control values set by the Origin and use the CDN values. (0 = Inactive, 1 = Active) |
basic_auth_user | string | The username that is used to authenticate the Origin |
basic_auth_password | string | The password that is used to authenticate the Origin |
headers_origin | string | The HTTP headers that are added to the Origin request |
The following properties should be part of the request:
Name | Type | Required | Description |
---|---|---|---|
label | string | false | Custom name for the Origin. |
origin | string | false | The URL (HTTP) of the customer’s source, on domain level. |
refresh_every | integer | false | Refresh time for the Origin. Must be between 0 and 1000000. |
ignore_cache_control | boolean | false | Ignore Origin Cache Control values set by the Origin and use the CDN values. 0 = Inactive, 1 = Active |
basic_auth_user | string | false | The username that will be used to authenticate the Origin. |
basic_auth_password | string | false | The password that will be used to authenticate the Origin. |
headers_origin | string | false | HTTP headers that will be added to the Origin request. |
DELETEhttps://api.leasewebcdn.com/origins/123456789/123REQUEST EXAMPLE
curl --request DELETE \
--url https://api.leasewebcdn.com/origins/123456789/123
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/origins/123456789/123",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("DELETE", "/origins/123456789/123")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/origins/123456789/123")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success": ""
}
DELETEDelete a single Origin
To delete an specific origin, send a DELETE request to
/origin/{customer_number}/{originID}
.
The response will be a JSON object with the key success
.
Name | Type | Description |
---|---|---|
success | string | This string will be empty |
Search
GEThttps://api.leasewebcdn.com/search/origin/1234567890/table/10/0REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/search/origin/1234567890/table/10/0
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/search/origin/1234567890/table/10/0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/search/origin/1234567890/table/10/0")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/search/origin/1234567890/table/10/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"total":1,"success":
[
{
"origin":"http://thumbs.leaseweb.com",
"nginx_config_version":"106",
"origin_id":1,
"updated_at":1424860619,
"ignore_cache_control":1,
"max_filesize":"40m",
"use_stale":0,
"secure_manifest_only":0,
"id":1,
"global_secret":"",
"basic_auth_user":"",
"origin_label":"http://thumbs.leaseweb.com",
"secure_url_active":0,
"blocked_countries":"",
"headers_add":"",
"secure_url_ip":0,
"headers_origin":"",
"template":null,
"push_zone_id":null,
"customer_id":1,
"content_disposition":0,
"burst_size":null,
"gzip":1,
"refresh_every":10,
"expires":"-1",
"query_string":0,
"active":1,
"strip_cookies":0,
"ftp_logs":0,
"basic_auth_password":"",
"referrer":"",
"created_at":1410451694,
"transfer_rate":null,
"headers":"",
"cname":"thumbs.leasewebcdn.com",
"headers_remove":"",
"zone_type":"hls",
"origin_urlencoding":0,
"dvr":0
}
]
}
GETRetrieve search results (zones) for the given query
To search for a zone, send a GET request to
/search/{zone_type}/{customer_number}/{query}/{limit}/{offset}
.
The response will be a JSON object with the key success
that contains the
search result.
Name | Type | Description |
---|---|---|
origin | string | The URL (HTTP) of the source, on domain level |
origin_s3_bucket_name | string | The name of the origin S3 bucket (if origin type is S3) or empty string otherwise |
origin_type | string | Type of source origin: "simple" or "s3" |
expires_404 | integer | The amount of time (in seconds) the 404 reply from the origin server is kept in cache |
nginx_config_version | string | The config version of NGINX |
origin_id | integer | The zone ID |
sub_path | string | The sub path of the origin |
secure_url_mode | string | Describes which mode is active (Simple, Advanced or disabled) |
expires | string | The amount of time (in seconds) an URL will be held in the CDN's cache |
https_redirect | string | Redirects http traffic to https. Can either be disabled, temporary or permanent |
updated_at | integer | Timestamp (UTC) when the zone was last updated |
ignore_cache_control | integer | Ignore Origin Cache Control values set by the Origin and use the CDN values. (0 = Inactive, 1 = Active) |
gzip | integer | Reduces the size of web content and improves the overall speed (0 = Inactive, 1 = Active) |
whitelist | string | IPs or subnets added to the whitelist will always be allowed to access your content |
aes_key | string | 64 character long string that is used to generate the secure link in encrypted mode |
whitelisted_files | string | A list of files that are available even if secure_url_mode is enabled |
active | integer | If the zone is active. (0 = Inactive, 1 = Active) |
burst_size | integer | The initial data that can be downloaded at full speed before the specified transfer rate takes effect |
sha_key | string | 64 character long string that is used to generate the secure link in encrypted mode |
id | integer | The ID assigned to the Pull Zone |
global_secret | string | A password used to generate the Secure URL |
referrer | string | HTTP referral restrictions |
referrer_check | string | The checking can be either on or off |
vary_header | integer | If the vary header is enabled in the NGINX config. (0 = Inactive, 1 = Active) |
query_string | integer | Include the query string as part of the cache key. (0 = Inactive, 1 = Active) |
transfer_rate | integer | The bandwidth limit per connection in Kbps |
alias | string | Aliases set for the CNAME |
cname | string | Canonical Name for the Zone |
origin_label | string | The label used for the Origin |
zone_type | string | The type of the Pull Zone |
headers_origin | string | The headers that are passed through from the Origin |
created_at | integer | Timestamp (UTC) when the zone was created |
refresh_every | integer | Refresh time for the zone |
Statistics (deprecated)
GEThttps://api.leasewebcdn.com/stats/hourly/9283928329/928392839292/928392839292/test.example.com/nl/ams1REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/stats/hourly/9283928329/928392839292/928392839292/test.example.com/nl/ams1
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/stats/hourly/9283928329/928392839292/928392839292/test.example.com/nl/ams1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/stats/hourly/9283928329/928392839292/928392839292/test.example.com/nl/ams1")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/stats/hourly/9283928329/928392839292/928392839292/test.example.com/nl/ams1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"1234567890":
{
"2014_094_05_BytesCount": 5938,
"2014_094_05_DownloadTime": 234,
"2014_094_05_HitCount": 2,
"2014_094_08_HitHTTPSCount": 0
}
}
}
GETRetrieve statistics data
To retrieve statistics for the given data, send a GET request to
/stats/{granularity}/{customer_number}/{timestamp_start}/{timestamp_end}/{cname}/{county}/{pop}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
date_BytesCount | integer | The amount of bytes used |
date_DownloadTime | integer | The amount of downloads |
date_HitCount | integer | The amount of HTTP hits |
date_hitHTTPSCount | integer | The amount of HTTPS hits |
GEThttps://api.leasewebcdn.com/stats/geo/hourly/29389223211/23819829121/23819829121/test.example.comREQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/stats/geo/hourly/29389223211/23819829121/23819829121/test.example.com
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/stats/geo/hourly/29389223211/23819829121/23819829121/test.example.com",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/stats/geo/hourly/29389223211/23819829121/23819829121/test.example.com")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/stats/geo/hourly/29389223211/23819829121/23819829121/test.example.com")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success": {
"1234567890": {
"1397001600":{
"CA": 45,
"JP": 4,
"US": 383,
"AT": 2,
"BR": 18,
"PE": 19,
"MX": 46
},
"1397088000": {
"BE": 4,
"FR": 1,
"BG": 6,
"RO": 36,
"DE": 69,
"JP": 61,
"HU": 3
},
"1396310400": {}
}
}
}
GETRetrieve statistics data for the given type
To retrieve statistics for the given data, send a GET request to
/stats/{type}/{granularity}/{customer_number}/{timestamp_start}/{timestamp_end}/{cname}/{county}/{pop}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
timestamp | array | This array contains the data per country (e.g.: "CA": 45) |
GEThttps://api.leasewebcdn.com/stats/overview/98982918291/23819829121/allREQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/stats/overview/98982918291/23819829121/all
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/stats/overview/98982918291/23819829121/all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/stats/overview/98982918291/23819829121/all")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/stats/overview/98982918291/23819829121/all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":{
"total":195442538324,
"1234567890":{
"zones":{
"test1.leasewebcdn.com":1108348745,
"test2.leasewebcdn.com":84774346,
"test3.leasewebcdn.com":0,
"test4.leasewebcdn.com":3224,
"test5.leasewebcdn.com":731600100,
"test6.leasewebcdn.com":6442471415
},
"total":8367197830
},
"subcustomers":[
{
"12345":{
"zones":{
"test1.example.com":178975123124
},
"total":178975123124
}
},
{
"12346":{
"zones":{
"test2.example.com":0,
"test3.example.com":0
},
"total":0
}
},
{
"12347":{
"zones":{
"cdn.example.com":427118373,
"cdn2.example.fm":248567503,
"mycdn.example.nl":17400,
"cdn3.example.nl":0
},
"total":675703276
}
},
{
"12348":{
"zones":{
"cdn4.example.com":6307178932,
"static-cdn.example.com":99791655,
"static.example.com":1017543507
},
"total":7424514094
}
}
]
}
}
GETRetrieve overview data
To retrieve overview statistics for the given data, send a GET request to
/stats/overview/{customer_number}/{timestamp_start}/{for_who}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
total | integer | The total of all collected data |
---------------------- | --------- | -------------------------------------------------------------------------------------------------- |
customerNumber | array | |
> zones | array | This array contains all zones registered to the customer (e.g: "thumbs.leaseweb.com": 123123) |
> total | integer | The total of all the customers zones |
---------------------- | --------- | -------------------------------------------------------------------------------------------------- |
subCustomers | array | |
> subCustomerNumber | array | |
>> zones | array | This array contains all zones registered to the subCustomer (e.g: "thumbs.leaseweb.com": 123123) |
>> total | integer | The total of all the subCustomers zones |
GEThttps://api.leasewebcdn.com/stats/api/23819829121/2018/2REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/stats/api/23819829121/2018/2
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/stats/api/23819829121/2018/2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/stats/api/23819829121/2018/2")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/stats/api/23819829121/2018/2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":{
"1234567890":0
}
}
GETRetrieve the amount of api requests
To retrieve the number of API calls for the given data, send a GET request to
/stats/api/{customer_number}/{year}/{month}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
customerNumber | integer | The amount of API calls made |
GEThttps://api.leasewebcdn.com/stats/traffic/23819829121REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/stats/traffic/23819829121
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/stats/traffic/23819829121",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/stats/traffic/23819829121")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/stats/traffic/23819829121")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"1234567890":"1250"
}
}
GETRetrieve the amount of hits
To retrieve the average traffic in Mb/s for the given data, send a GET request
to /stats/traffic/{customer_number}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
customerNumber | integer | The average traffic in Mb/s |
GEThttps://api.leasewebcdn.com/stats/95thpercentilepoints/23819829121/eu/23819829121/23819829121REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/stats/95thpercentilepoints/23819829121/eu/23819829121/23819829121
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/stats/95thpercentilepoints/23819829121/eu/23819829121/23819829121",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/stats/95thpercentilepoints/23819829121/eu/23819829121/23819829121")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/stats/95thpercentilepoints/23819829121/eu/23819829121/23819829121")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"1234567890":
{
"95thpercentile":"7432",
"points":
{
"1403289600":7911,
"1404010500":3031,
"1402273800":2709,
"1402994700":5896,
"1403715600":7306,
"1401978900":1205,
"1402699800":3128,
"1403584500":4411,
"1401847800":4693,
"1402568700":4550
}
}
}
}
GETRetrieve the 95th percentile points
To retrieve the 95th percentile points for the given data, send a GET request
to
/stats/95thpercentilepoints/{customer_number}/{billing_region}/{timestamp_start}/{timestamp_end}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
customerNumber | array | |
> 95thpercentile | string | the 95th percentile |
> points | array | This array contains all the points (e.g: "1403289600": 7945) |
GEThttps://api.leasewebcdn.com/stats/95thpercentile/23819829121/eu/23819829121/23819829121REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/stats/95thpercentile/23819829121/eu/23819829121/23819829121
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/stats/95thpercentile/23819829121/eu/23819829121/23819829121",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/stats/95thpercentile/23819829121/eu/23819829121/23819829121")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/stats/95thpercentile/23819829121/eu/23819829121/23819829121")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":
{
"1234567890": 7432
}
}
GETRetrieve the 95th percentile
To retrieve the 95th percentile for the given data, send a GET request to
/stats/95thpercentile/{customer_number}/{billing_region}/{timestamp_start}/{timestamp_end}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
customerNumber | integer | The 95th percentile |
Statistics
GEThttps://api.leasewebcdn.com/statistics/percentileREQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/statistics/percentile
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/statistics/percentile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/statistics/percentile")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/statistics/percentile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"_metadata": {
"from": "2016-04-01T00:00:00+00:00",
"to": "2016-04-03T00:00:00+00:00",
"customerNumber": "0123456789",
"cname": "leasewebcdn.com",
"alias": "my.leasewebcdn.com",
"granularity": "day"
},
"metrics": {
"percentileBps": {
"unit": "bps",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
}
}
}
GET95th Percentile
GET /statistics/percentile/{customer_number}
Retrieve 95th percentile related statistics. The response can be filtered using the following query string parameters;
Query string parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
start | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the start date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
end | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the end date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
pop | string | no | all | The pop or region filter e.g.: us , eu , asia , ams1 , fra1 or wdc1 . Available regions and pops at /information/pops . |
cname | string | no | all | The cname of a zone, can not be used in combination with the alias parameter. |
alias | string | no | all | The alias of a zone, can not be used in combination with the cname parameter. |
GEThttps://api.leasewebcdn.com/statistics/bandwidthREQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/statistics/bandwidth
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/statistics/bandwidth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/statistics/bandwidth")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/statistics/bandwidth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"_metadata": {
"from": "2016-04-01T00:00:00+00:00",
"to": "2016-04-03T00:00:00+00:00",
"customerNumber": "0123456789",
"cname": "leasewebcdn.com",
"alias": "my.leasewebcdn.com",
"granularity": "day"
},
"metrics": {
"bps": {
"unit": "bps",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"sslBps": {
"unit": "bps",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
}
}
}
GETBandwidth
GET /statistics/bandwidth/{customer_number}
Retrieve bandwidth related statistics. This includes served bps and SSL bps. The bps is calculated by averaging the served bits over time. The response can be filtered using the following query string parameters;
Query string parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
start | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the start date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
end | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the end date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
fields | string | no | n/a* | Comma separated fields to filter on specific metrics. Must be one or a multiple selection of bps or sslBps . Returns all available fields by default. |
pop | string | no | all | The pop or region filter e.g.: us , eu , asia , ams1 , fra1 or wdc1 . Available regions and pops at /information/pops . |
cname | string | no | all | The cname of a zone, can not be used in combination with the alias parameter. |
alias | string | no | all | The alias of a zone, can not be used in combination with the cname parameter. |
granularity | enum | no | 5min | The granularity of data grouping. Choose from: 5min , hour , day , month or year . |
Live Bandwidth
The live bandwidth figure for your account is calculated based on 5 minutes of data, rounded to the previous 5 minute mark. Data that is newer than 5 minutes is still being processed by our platform, and thus giving different increasing values on every request.
To calculate the live bandwidth on your account, and retrieve it using this API call, you do the following:
- Round the current time to the previous 5 minute mark (thus, 15:48 becomes 15:45)
- The start time is 10 minutes prior (thus, 15:35)
You then send in a start time of 15:35 and an end time of 15:40. Any values after 15:40 up to the current time (15:48) are not counted.
GEThttps://api.leasewebcdn.com/statistics/cacheREQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/statistics/cache
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/statistics/cache",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/statistics/cache")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/statistics/cache")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"_metadata": {
"from": "2016-04-01T00:00:00+00:00",
"to": "2016-04-03T00:00:00+00:00",
"customerNumber": "0123456789",
"cname": "leasewebcdn.com",
"alias": "my.leasewebcdn.com",
"granularity": "day"
},
"metrics": {
"cacheHits": {
"unit": "hit",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"cacheBytes": {
"unit": "byte",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"edgeHits": {
"unit": "hit",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"edgeBytes": {
"unit": "byte",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"originHits": {
"unit": "hit",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"originBytes": {
"unit": "byte",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
}
}
}
GETCache Performance
GET /statistics/cache/{customer_number}
Retrieve cache performance related statistics. This includes served bytes and hits for Cache, Edge and Origin. The response can be filtered using the following query string parameters;
Query string parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
start | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the start date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
end | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the end date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
fields | string | no | n/a* | Comma separated fields to filter on specific metrics. Must be one or a multiple selection of cacheHits , cacheBytes , edgeHits , edgeBytes , originHits or originBytes . Returns all available fields by default. |
pop | string | no | all | The pop or region filter e.g.: us , eu , asia , ams1 , fra1 or wdc1 . Available regions and pops at /information/pops . |
cname | string | no | all | The cname of a zone, can not be used in combination with the alias parameter. |
alias | string | no | all | The alias of a zone, can not be used in combination with the cname parameter. |
granularity | enum | no | 5min | The granularity of data grouping. Choose from: 5min , hour , day , month or year . |
GEThttps://api.leasewebcdn.com/statistics/geoREQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/statistics/geo
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/statistics/geo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/statistics/geo")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/statistics/geo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"_metadata": {
"from": "2016-04-01T00:00:00+00:00",
"to": "2016-04-03T00:00:00+00:00",
"customerNumber": "0123456789",
"cname": "leasewebcdn.com",
"alias": "my.leasewebcdn.com",
"granularity": "day"
},
"metrics": {
"hits": {
"unit": "hit",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1,
"country": "NL"
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 2,
"country": "NL"
},
{
"timestamp": "2016-04-03T00:00:00+00:00",
"value": 3,
"country": "NL"
},
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1,
"country": "US"
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 2,
"country": "US"
},
{
"timestamp": "2016-04-03T00:00:00+00:00",
"value": 3,
"country": "US"
}
]
}
}
}
GETGeographical
GET /statistics/geo/{customer_number}
Retrieve geographical related statistics. This includes hits served per country. The response can be filtered using the following query string parameters;
Query string parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
start | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the start date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
end | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the end date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
pop | string | no | all | The pop or region filter e.g.: us , eu , asia , ams1 , fra1 or wdc1 . Available regions and pops at /information/pops . |
cname | string | no | all | The cname of a zone, can not be used in combination with the alias parameter. |
alias | string | no | all | The alias of a zone, can not be used in combination with the cname parameter. |
granularity | enum | no | 5min | The granularity of data grouping. Choose from: day , month or year . |
GEThttps://api.leasewebcdn.com/statistics/trafficREQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/statistics/traffic
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/statistics/traffic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/statistics/traffic")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/statistics/traffic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"_metadata": {
"from": "2016-04-01T00:00:00+00:00",
"to": "2016-04-03T00:00:00+00:00",
"customerNumber": "0123456789",
"cname": "leasewebcdn.com",
"alias": "my.leasewebcdn.com",
"granularity": "day"
},
"metrics": {
"sslHits": {
"unit": "hit",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"sslBytes": {
"unit": "byte",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"hits": {
"unit": "hit",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
},
"bytes": {
"unit": "byte",
"values": [
{
"timestamp": "2016-04-01T00:00:00+00:00",
"value": 1
},
{
"timestamp": "2016-04-02T00:00:00+00:00",
"value": 1
}
]
}
}
}
GETTraffic
GET /statistics/traffic/{customer_number}
Retrieve traffic related statistics. This includes served bytes, SSL bytes, hits and SSL Hits. The response can be filtered using the following query string parameters;
Query string parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
start | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the start date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
end | date | yes | n/a | Any date string accepted by dateutil.parser.parse to determine the end date of the statistics request, we recommend using a UNIX timestamp or RFC-3339. |
fields | string | no | n/a* | Comma separated fields to filter on specific metrics. Must be one or a multiple selection of sslHits , sslBytes , hits or bytes . Returns all available fields by default. |
pop | string | no | all | The pop or region filter e.g.: us , eu , asia , ams1 , fra1 or wdc1 . Available regions and pops at /information/pops . |
cname | string | no | all | The cname of a zone, can not be used in combination with the alias parameter. |
alias | string | no | all | The alias of a zone, can not be used in combination with the cname parameter. |
granularity | enum | no | 5min | The granularity of data grouping. Choose from: 5min , hour , day , month or year . |
Version
GEThttps://api.leasewebcdn.com/versionREQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/version
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/version",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/version")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/version")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"version":"1.10.0"
}
GETRetrieve the current API Version
To retrieve the current API version, send a GET request to /version
.
The response will be a JSON object with key version
containing the api
version
Name | Type | Description |
---|---|---|
version | string | The current version of the API |
Push and Pull zones
GEThttps://api.leasewebcdn.com/zones/pull/1234567890/1234REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/zones/pull/1234567890/1234
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/zones/pull/1234567890/1234",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/zones/pull/1234567890/1234")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/zones/pull/1234567890/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"total":1,"success":
[
{
"origin":"http:\/\/thumbs.leaseweb.com",
"nginx_config_version":"100",
"origin_id":616,
"cdn_cluster":"hwc002a",
"whitelist":"",
"updated_at":1418162487,
"ignore_cache_control":0,
"max_filesize":"40m",
"use_stale":0,
"secure_manifest_only":0,
"id":1,
"global_secret":"",
"basic_auth_user":"",
"alias":"",
"origin_label":"http:\/\/thumbs.leaseweb.com",
"secure_url_active":0,
"blocked_countries":"",
"headers_add":"",
"secure_url_ip":0,
"ssl_enabled":0,
"ssl_private_key":"",
"ssl_certificate":"",
"ssl_ca_bundle":"",
"headers_origin":"",
"template":null,
"push_zone_id":null,
"customer_id":1,
"content_disposition":0,
"cdn_domain":"",
"burst_size":null,
"gzip":1,
"refresh_every":86400,
"expires":"off",
"https_redirect": "disabled",
"query_string_mode":"full",
"query_string_fields":"var1,var2",
"active":1,
"strip_cookies":1,
"basic_auth_password":"",
"referrer":"",
"created_at":1418162487,
"transfer_rate":null,
"headers":"",
"cname":"img.lw.cdn.leaseweb.com",
"headers_remove":"",
"zone_type":"vod",
"origin_urlencoding":0,
"dvr":0,
"cold_hit_seeking":1
}
]
}
GETRetrieve a Pull Zone
To retrieve a pull zone for the given data, send a GET request to
/zones/pull/{customer_number}/{zone_id}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
origin | string | The URL (HTTP) of the source, on domain level |
origin_s3_bucket_name | string | The name of the origin S3 bucket (if origin type is S3) or empty string otherwise |
origin_type | string | Type of source origin: "simple" or "s3" |
expires_404 | integer | The amount of time (in seconds) the 404 reply from the origin server is kept in cache |
nginx_config_version | string | The config version of NGINX |
origin_id | integer | The zone ID |
sub_path | string | The sub path of the origin |
secure_url_mode | string | Describes which mode is active (Simple, Advanced or disabled) |
expires | string | The amount of time (in seconds) an URL will be held in the CDN's cache |
https_redirect | string | Redirects http traffic to https. Can either be disabled, temporary or permanent |
ssl_enabled | integer | Specifies whether the SSL support is enabled (1) or disabled (0) |
ssl_private_key | string | PEM-encoded private key of the domain |
ssl_certificate | string | PEM-encoded certificate (or multiple certificates concatenated together) of the domain |
ssl_ca_bundle | string | Optional PEM-encoded certificate authority (CA) bundle, empty string if it's not present |
updated_at | integer | Timestamp (UTC) when the zone was last updated |
ignore_cache_control | integer | Ignore Origin Cache Control values set by the Origin and use the CDN values. (0 = Inactive, 1 = Active) |
gzip | integer | Reduces the size of web content and improves the overall speed (0 = Inactive, 1 = Active) |
whitelist | string | IPs or subnets added to the whitelist will always be allowed to access your content |
aes_key | string | 64 character long string that is used to generate the secure link in encrypted mode |
whitelisted_files | string | A list of files that are available even if secure_url_mode is enabled |
active | integer | If the zone is active. (0 = Inactive, 1 = Active) |
burst_size | integer | The initial data that can be downloaded at full speed before the specified transfer rate takes effect |
sha_key | string | 64 character long string that is used to generate the secure link in encrypted mode |
id | integer | The ID assigned to the Pull Zone |
global_secret | string | A password used to generate the Secure URL |
referrer | string | HTTP referral restrictions |
referrer_check | string | The checking can be either on or off |
vary_header | integer | If the vary header is enabled in the NGINX config. (0 = Inactive, 1 = Active) |
query_string_mode | string | Either set to 'off', 'partial' or 'full' to define how the query string is used for the cache key |
query_string_fields | string | Comma seperated fields to use when query_string_mode is set to partial |
transfer_rate | integer | The bandwidth limit per connection in Kbps |
alias | string | Aliases set for the CNAME |
cname | string | Canonical Name for the Zone |
origin_label | string | The label used for the Origin |
zone_type | string | The type of the Pull Zone |
headers_origin | string | The headers that are passed through from the Origin |
created_at | integer | Timestamp (UTC) when the zone was created |
refresh_every | integer | Refresh time for the zone |
cold_hit_seeking | integer | Allows video files, when using a start parameter, to be partially fetched from the origin. Once the entire video has been transferred, it will then cache the file |
POSThttps://api.leasewebcdn.com/zones/pull/1234567890/1234REQUEST EXAMPLE
curl --request POST \
--url https://api.leasewebcdn.com/zones/pull/1234567890/1234 \
--header 'content-type: application/json' \
--data '{
"active": 1,
"cname": "pull",
"origin": "http://pull.example.com"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/zones/pull/1234567890/1234",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"active\": 1, \"cname\": \"pull\", \"origin\": \"http://pull.example.com\"}",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
payload = "{ \"active\": 1, \"cname\": \"pull\", \"origin\": \"http://pull.example.com\"}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/zones/pull/1234567890/1234", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/zones/pull/1234567890/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"active\": 1, \"cname\": \"pull\", \"origin\": \"http://pull.example.com\"}"
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success":"Rule Created!",
"id": 1
}
POSTCreate a Pull Zone
To create an new pull zone, send a POST request to
/zones/pull/{customer_number}/new
.
The response will be a JSON object with the key success
that contains the new
origin.
Name | Type | Description |
---|---|---|
success | string | Contains a string that notifies if the zone was successfully created |
id | integer | The id of the created zone |
The following properties should be part of the request:
Name | Type | Required | Description |
---|---|---|---|
active | integer | true | If the rule is active. |
cname | string | true | Canonical Name for the Pull Zone. |
origin | string | false | The URL (HTTP) of the source. |
referrer | string | false | Restrict direct linking to one or multiple entries |
transfer_rate | integer | false | Limits the bandwidth. Throttling is set in kbps. |
burst_size | integer | false | The initial data that can be downloaded at full speed before the set transfer_rate takes effect. |
secure_url_active | integer | false | When activated, the zone wil be protected and files will be accessible with a valid key. 0 = Inactive, 1 = Active |
secure_url_ip | integer | false | When Secure URL is activated, you can choose to restrict protected links to the visitors IP address. 0 = Inactive, 1 = Active |
global_secret | string | false | Secret used for the above secure URL feature. |
zone_type | string | false | The type of the Pull Zone. static = Large files, sobj= Small files, hls = Live Streaming, vod_hls = Video on Demand. (Allowed values: static,sobj,hls,vod_hls) |
gzip | integer | false | Reduces the size of web content and improves the overall speed. 0 = Inactive, 1 = Active |
query_string | integer | false | When activated, URL including query string are treated as a unique cacheable item. 0 = Inactive, 1 = Active |
headers_add | string | false | HTTP headers that will be added to the request. |
headers_remove | string | false | HTTP headers that will be remove from the request. |
expires | integer | false | Controls whether the response should be marked with an expiry time, and if so, what time that is. Can be: off for disabling or an integer number to specify the number of minutes. |
alias | string | false | Setup one or more alias for your CNAME. (comma seperated) |
blocked_countries | string | false | Blocked countries will block users based their IP address. We use the GeoIP database from MaxMind to match the IP to a country. |
whitelist | string | false | Add IP addresses or subnets to the whitelist. |
strip_cookies | integer | false | Ignore Cookies in requests. 0 = Inactive, 1 = Active |
use_stale | integer | false | Serve stale/expired content. 0 = Inactive, 1 = Active |
content_disposition | integer | false | Force content to download. 0 = Inactive, 1 = Active |
cold_hit_seeking | integer | false | Only available on VOD zones. Allows video files, when using a start parameter, to be partially fetched from the origin. Once the entire video has been transferred, it will then cache the file. 0 = Inactive, 1 = Active |
DELETEhttps://api.leasewebcdn.com/zones/pull/1234567890/1234REQUEST EXAMPLE
curl --request DELETE \
--url https://api.leasewebcdn.com/zones/pull/1234567890/1234
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/zones/pull/1234567890/1234",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("DELETE", "/zones/pull/1234567890/1234")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/zones/pull/1234567890/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success": "Rule deleted!"
}
DELETEDelete a Pull Zone
To delete a pull zone for the given data, send a DELETE request to
/zones/pull/{customer_number}/{zone_id}
.
The response will be a JSON object with the key success
.
Name | Type | Description |
---|---|---|
success | string | Rule deleted! |
GEThttps://api.leasewebcdn.com/zones/push/1234567890/1234REQUEST EXAMPLE
curl --request GET \
--url https://api.leasewebcdn.com/zones/push/1234567890/1234
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/zones/push/1234567890/1234",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("GET", "/zones/push/1234567890/1234")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/zones/push/1234567890/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"total":2,
"success":
[
{
"ftp_user":"1",
"name":"ftp_logs",
"quota_limit":1000000000,
"created_at":1397660535,
"quota_use":0,
"active":1,
"customer_id":1,
"id":1
},
{
"ftp_user":"2",
"name":"ftp_test",
"quota_limit":9990000,
"created_at":1397829690,
"quota_use":0,
"active":1,
"customer_id":1,
"id":2
}
]
}
GETRetrieve a Push Zone
To retrieve a pull zone for the given data, send a GET request to
/zones/pull/{customer_number}/{zone_id}
.
The response will be a JSON object with the key success
that contains the
statistics.
Name | Type | Description |
---|---|---|
ftp_user | string | The ftp username |
name | string | The name of the push zone |
quota_limit | integer | The quota limit |
quota_use | integer | The amount of quota used |
cdn_cluster | string | The cluster on the LeaseWeb CDN where the Push Zone is configured |
full_cname | string | The full CNAME |
active | integer | If the zone is active. (0 = Inactive, 1 = Active) |
created_at | integer | Timestamp (UTC) when the zone was created |
id | integer | The zone id |
POSThttps://api.leasewebcdn.com/zones/push/1234567890/1234REQUEST EXAMPLE
curl --request POST \
--url https://api.leasewebcdn.com/zones/push/1234567890/1234 \
--header 'content-type: application/json' \
--data '{
"active": 1,
"name": "push",
"quota_limit": 1000000
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/zones/push/1234567890/1234",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"active\": 1, \"name\": \"push\", \"quota_limit\": 1000000}",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
payload = "{ \"active\": 1, \"name\": \"push\", \"quota_limit\": 1000000}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/zones/push/1234567890/1234", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/zones/push/1234567890/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"active\": 1, \"name\": \"push\", \"quota_limit\": 1000000}"
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"id":239,
"username": 1234567890,
"password": "AbCdEF!@#$%"
}
POSTCreate a Push Zone
To update a push zone, send a POST request to /zones/push/{customer_number}
.
The response will be a JSON object with the key success
that contains the
push zone data.
Name | Type | Description |
---|---|---|
username | string | The username for the FTP |
id | integer | The id of the push zone |
The following properties should be part of the request:
Name | Type | Required | Description |
---|---|---|---|
active | integer | true | If the Push Zone is active. |
name | string | true | Custom name for the Push Zone. |
quota_limit | integer | true | The maximum amount of space (in bytes) this Push Zone can use. |
password | string | false | The password for the FTP user. |
DELETEhttps://api.leasewebcdn.com/zones/push/1234567890/1234REQUEST EXAMPLE
curl --request DELETE \
--url https://api.leasewebcdn.com/zones/push/1234567890/1234
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.leasewebcdn.com/zones/push/1234567890/1234",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("api.leasewebcdn.com")
conn.request("DELETE", "/zones/push/1234567890/1234")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.leasewebcdn.com/zones/push/1234567890/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
RESPONSE EXAMPLE
{
"success": "Rule deleted!"
}
DELETEDelete a Push Zone
To delete a push zone for the given data, send a DELETE request to
/zones/push/{customer_number}/{zone_id}
.
The response will be a JSON object with the key success
.
Name | Type | Description |
---|---|---|
success | string | Rule deleted! |