MaxCDN / netdna.github.com

API Docs

Home Page:http://docs.netdna.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NetDNA API Docs

NetDNA is a content delivery network ("CDN") provider.

Index

Overview

  1. Sign up for a free NetDNA developer account.

  2. Create a new application.

  3. Integrate with our RESTful API using your language wrapper:

Follow the documentation for our API below!

Support

Changelog

  • 2013-07-22 Added JSON responses to SSL
  • 2013-07-09 Added Authentication section
  • 2013-06-03 Fixed formatting and display issues
  • 2013-06-02 Added Ruby Code examples
  • 2013-05-31 Added Python Code examples
  • 2013-05-29 Added Node Code examples
  • 2013-05-28 Added response examples
  • 2013-05-25 Added PHP Code examples
  • 2013-03-29 Added "Bad Request" for Purges without file(s) parameter in body
  • 2013-03-14 Added .ie to the TLD Validation
  • 2013-03-12 Added single file Purge to use cURL multi
  • 2013-03-12 Fixed SSL Update Bug
  • 2013-03-08 cURL Multi Purge Files
  • 2013-03-07 Fix 3-legged OAuth Restriction
  • 2013-01-16 Fixed SSL Bug
  • 2012-12-05 Added 2xx_hit calculation to all statuscodebyfilename Reports
  • 2012-02-27 Released Alpha Version of RWS API.

Authentication

Overview

The first thing to do in order to use the NetDNA REST Web Service is to register your application. Upon registration, your application will be issued a consumer key and secret which is similar to public and private keys used in ssh protocol. You will need to use this in conjunction with an OAuth library in the programming language of your choice.

OAuth defines three roles: client, server, and resource owner (nicknamed the OAuth Love Triangle by Leah Culver).

The NetDNA RWS supports both 2-legged and 3-legged authentication.

3-legged OAuth is best used to allow a 3rd party apps/services (e.g. Leftronic) access to a users profile - the user just needs to grant access to the app.

2-legged OAuth is more limited in that it only allows a consumer access to resources that belong to it (this is also useful for building a 3rd party app or a control panel where the consumer is a reseller or an account with sub-accounts - this means the reseller/main account also has access to sub-account resources). This does not require any user intervention in the process.

3-legged OAuth

3-legged OAuth describes the scenario for which OAuth was originally developed: a resource owner wants to give a client access to a server without sharing his credentials (i.e. username/password). On a conceptual level it works in the following way:

  • Client has signed up to the server and got his client credentials (also known as "consumer key and secret") ahead of time
  • User wants to give the client access to his protected resources on the server
  • Client retrieves the temporary credentials (also known as "request token") from the server
  • Client redirects the resource owner to the server
  • Resource owner grants the client access to his protected resources on the server
  • Server redirects the user back to the client
  • Client uses the temporary credentials to retrieve the token credentials (also known as "access token") from the server
  • Client uses the token credentials to access the protected resources on the server

2-legged OAuth

2-legged OAuth describes a typical client-server scenario, without any user involvement.

On a conceptual level 2-legged OAuth simply consists of the first and last steps of 3-legged OAuth:

  • Client has signed up to the server and got his client credentials (also known as "consumer key and secret"
  • Client uses his client credentials (and empty token credentials) to access the protected resources on the server

Registering Your Application

Login and go to https://developer.netdna.com/api/apps/create

Signing Requests

All OAuth 1.0a requests use the same basic algorithm for creating a signature base string and a signature.

Request Tokens

The first step to authenticating a user is to obtain a request token from NetDNA.

The end point for requesting a token is https://rws.netdna.com/oauth/request_token.

User Authorization

The authorize step is where you send the user to the NetDNA RWS authorization page that will allow them to grant your application privileges to use their account with the API. You will need the oauth_token from the previous step to complete this.

The endpoint for the authorization url is https://rws.netdna.com/oauth/authorize

Key: Path Parameters

Parameter Description
{companyalias} The alias you used when creating your account
{zone_type} The type of zone you are making a request on - one of push,pull, vod, or live
{report_type} The format you want the reports summarized by - one of hourly,daily, or monthly. This value can be left blank to receive thetotals ungrouped.

Account API

Get Account

Gets account information

Response Parameters

Parameter | Description | --- | --- | --- id | Account ID | name | The name of your account | address_id | Address ID | alias | Company Alias | ssl_credits | SSL Credits | flex_credits | Flex Location Credits | date_created | Date Created | date_updated | Date Updated |

Code Samples

api.get("/account.json")
api.get("/account.json")
$api->get('/account.json');
api.get('/account.json', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 200,
    "data": {
        "account": {
            "alias": "aliasname",
            "date_created": "2013-05-15 17:32:30",
            "date_updated": "2013-05-15 19:43:36",
            "edgerules_credits": "0",
            "flex_credits": "-1",
            "id": "#####",
            "name": "NetDNA sampleCode",
            "secure_token_pull_credits": "0",
            "server_id": "18",
            "ssl_credits": "1",
            "status": "2",
            "storage_quota": "107374182400",
            "storage_server_id": "11",
            "zone_credits": "-1"
        }
    }
}

Update Account

Updates account information

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- name | - | required
length: 1-30 chars | The name of your account |

Response Parameters

Parameter | Description | --- | --- | --- id | Account ID | name | The name of your account | address_id | Address ID | alias | Company Alias | ssl_credits | SSL Credits | flex_credits | Flex Location Credits | date_created | Date Created | date_updated | Date Updated |

Code Samples

params={"name"=> "UserName"}
api.put('/account.json',params)
params={"name": "Monty"}
api.put('/account.json',params=params)
$params = array("name"=>"newName");
$api->put('/account.json',$params);
api.put('/account.json', { name: 'newName' }, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 200,
    "data": {
        "account": {
            "alias": "aliasname",
            "date_created": "2013-05-15 17:32:30",
            "date_updated": "2013-05-23 17:58:27",
            "edgerules_credits": "0",
            "flex_credits": "-1",
            "id": "#####",
            "name": "newName",
            "secure_token_pull_credits": "0",
            "server_id": "18",
            "ssl_credits": "-1",
            "status": "2",
            "storage_quota": "107374182400",
            "storage_server_id": "11",
            "zone_credits": "-1"
        }
    }
}

Get Account Address

Gets account address information

Response Parameters

Parameter | Description | --- | --- | --- id | Address ID | street1 | Street Address Line 1 | street2 | Street Address Line 2 | city | City | state | State | zip | ZIP | country | Country Code | date_created | Date Created | date_updated | Date Updated |

Code Samples

api.get('/account.json/address')
api.get('/account.json/address')
$api->get('/account.json/address')
api.get('/account.json/address', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 200,
    "data": {
        "address": {
            "city": "los angeles",
            "country": "US",
            "date_created": "0000-00-00 00:00:00",
            "date_updated": "2013-05-15 19:54:40",
            "id": "#####",
            "state": "CA",
            "street1": "123 Main Street",
            "street2": "apt 42",
            "zip": "90068"
        }
    }
}

Update Account Address

Updates account address information

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- street1 | - | length: 1-200 chars | Street Address Line 1 | street2 | - | length: 1-200 chars | Street Address Line 2 | city | - | length: 1-50 chars | City | state | - | length: 1-50 chars | State | zip | - | length: 3-5 chars; only digits accepted | ZIP | country | - | length: 2 chars | Country Code |

Response Parameters

Parameter | Description | --- | --- | --- id | Address ID | street1 | Street Address Line 1 | street2 | Street Address Line 2 | city | City | state | State | zip | ZIP | country | Country Code | date_created | Date Created | date_updated | Date Updated |

Code Samples

params = {"street1"=> "1234 Main Street", "street2"=> "apt 42", "state"=> "CA"}
api.put('/account.json/address',params)
params = {"street1": "1234 Main Street", "street2": "apt 42", "state": "CA"}
api.put('/account.json/address',params=params)
$params = array("street1"=>"123 Main Street", "street2"=>"apt 42", "state"=>"CA");
$api->put('/account.json/address',$params);
api.put('/account.json/address', { street1: '123 Main Street', street2: 'apt 42', state: 'CA' }, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 200,
    "data": {
        "address": {
            "city": "los angeles",
            "country": "US",
            "date_created": "0000-00-00 00:00:00",
            "date_updated": "2013-05-23 18:01:29",
            "id": "#####",
            "state": "CA",
            "street1": "1234 Main Street",
            "street2": "apt 42",
            "zip": "90068"
        }
    }
}

Users API

List Users

Returns a list of all users on the specified account

Response Parameters

Parameter | Description | --- | --- | --- id | User ID | email | Email Address | firstname | First Name | lastname | Last Name | phone | Phone Number | timezone | User's Timezone | date_last_login | The date and time the user last logged into the system | ip_last_login | The IP for the user at the last login | date_created | Date Created | date_updated | Date Updated | roles | An array of roles for the given user |

Code Samples

api.get('/users.json')
api.get('/users.json')
$api->get('/users.json');
api.get('/users.json', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 200,
    "data": {
        "current_page_size": 4,
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "total": 4,
        "users": [
            {
                "brand_id": "1",
                "date_created": "2013-05-15 17:32:30",
                "date_last_login": "2013-05-23 17:54:18",
                "date_updated": "2013-05-15 17:33:09",
                "default_company_id": "#####",
                "email": "name@domain.com",
                "firstname": "Given",
                "id": "33706",
                "ip_last_login": "12.13.90.183",
                "isadmin": "0",
                "isdisabled": "0",
                "lastname": "Family",
                "phone": "3235551400",
                "roles": [
                    "User",
                    "Account Owner"
                ],
                "timezone": "Europe/London"
            },
            {
                "brand_id": "1",
                "date_created": "2013-05-15 20:16:34",
                "date_last_login": null,
                "date_updated": "0000-00-00 00:00:00",
                "default_company_id": "19538",
                "email": "caphammer1@hamcave.com",
                "firstname": "Captain",
                "id": "33714",
                "ip_last_login": null,
                "isadmin": "0",
                "isdisabled": "0",
                "lastname": "Hammer",
                "phone": null,
                "roles": [
                    "User"
                ],
                "timezone": "Europe/London"
            },
            {
                "brand_id": "1",
                "date_created": "2013-05-15 20:20:03",
                "date_last_login": null,
                "date_updated": "2013-05-15 20:31:05",
                "default_company_id": "19538",
                "email": "drhorrible3@ele.net",
                "firstname": "Billy",
                "id": "33716",
                "ip_last_login": null,
                "isadmin": "0",
                "isdisabled": "0",
                "lastname": "Horrible",
                "phone": null,
                "roles": [
                    "User"
                ],
                "timezone": "Europe/London"
            }
        ]
    }
}

Create User

Creates a new user on the specified account

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- email | - | required
length: 6-200 chars; valid email address | Email Address | password | - | required
length: 5-30 chars | Password | firstname | - | required
length: 1-32 chars | First Name | lastname | - | required
length: 1-32 chars | Last Name | phone | - | length: 7, 10, 11, or 14 chars; only digits considered | Phone Number | timezone | - | valid::timezone | Valid timezone (see List ofSupported Timezones) |

Response Parameters

Parameter | Description | --- | --- | --- id | User ID | email | Email Address | firstname | First Name | lastname | Last Name | phone | Phone Number | timezone | User's Timezone | date_last_login | The date and time the user last logged into the system | ip_last_login | The IP for the user at the last login | date_created | Date Created | date_updated | Date Updated | roles | An array of roles for the given user |

Code Samples

params={"email"=>"name44@domain.com","password"=>"password","firstname"=>"Given","lastname"=>"Family"}
api.post('/users.json',params )
params={'email':'name43@domain.com','password':'password','firstname':'Given','lastname':'Family'}
api.post('/users.json',data=params )
$params = array("email"=>"name@domain.com","password"=>"password","firstname"=>"Given","lastname"=>"Family");
$api->post('/users.json',$params );
api.post('/users.json', { email: 'name@domain.com', password: 'password', firstname: 'Given', lastname: 'Family' }, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 201,
    "data": {
        "user": {
            "brand_id": null,
            "date_created": "2013-05-23 18:22:11",
            "date_last_login": null,
            "date_updated": null,
            "default_company_id": "19538",
            "email": "name@domain.com",
            "firstname": "Given",
            "id": 33941,
            "ip_last_login": null,
            "isadmin": 0,
            "isdisabled": 0,
            "lastname": "Family",
            "phone": null,
            "roles": [
                "User"
            ],
            "timezone": "America/Los_Angeles"
        }
    }
}

Get User

Gets a user specified by the {user_id} parameter

Response Parameters

Parameter | Description | --- | --- | --- id | User ID | email | Email Address | firstname | First Name | lastname | Last Name | phone | Phone Number | timezone | User's Timezone |

Code Samples

id = '33706'
api.get('/users.json/'+id)
id = '33706'
api.get('/users.json/'+id)
$id = '33941';
$api->get('/users.json/'.$id);
var id = '33941'
api.get('/users.json/' + id, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 200,
    "data": {
        "user": {
            "brand_id": "1",
            "date_created": "2013-05-23 18:22:11",
            "date_last_login": null,
            "date_updated": "0000-00-00 00:00:00",
            "default_company_id": "19538",
            "email": "name@domain.com",
            "firstname": "Given",
            "id": "33941",
            "ip_last_login": null,
            "isadmin": "0",
            "isdisabled": "0",
            "lastname": "Family",
            "phone": null,
            "roles": [
                "User"
            ],
            "timezone": "Europe/London"
        }
    }
}

Update User

Updates a user specified by the {user_id} parameter

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- email | - | length: 6-200 chars; valid email address | Email Address | firstname | - | length: 1-32 chars | First Name | lastname | - | length: 1-32 chars | Last Name | phone | - | length: 7, 10, 11, or 14 chars; only digits considered | Phone Number | timezone | - | valid::timezone | Valid timezone (see List ofSupported Timezones) |

Response Parameters

Parameter | Description | --- | --- | --- id | User ID | email | Email Address | firstname | First Name | lastname | Last Name | phone | Phone Number | timezone | User's Timezone |

Code Samples

id = '33706'
params={'firstname'=> 'name'}
api.put('/users.json/'+id,params)
api.put('/users.json/'+id,params={'firstname': 'name'})
$id = '33941';
$params =  array("firstname"=>"Billy");
$api->put('/users.json/'.$id,$params);
var id = '33941'
api.put('/users.json/' + id, { firstname: 'Billy' }, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 200,
    "data": {
        "user": {
            "brand_id": "1",
            "date_created": "2013-05-23 18:22:11",
            "date_last_login": null,
            "date_updated": "2013-05-23 19:10:09",
            "default_company_id": "19538",
            "email": "name@domain.com",
            "firstname": "Billy",
            "id": "33941",
            "ip_last_login": null,
            "isadmin": "0",
            "isdisabled": "0",
            "lastname": "Family",
            "phone": null,
            "roles": [
                "User"
            ],
            "timezone": "Europe/London"
        }
    }
}

Delete User

Deletes a user specified by the {user_id} parameter

Code Samples

id = '33706'
api.delete('/users.json/'+id)
id = '33706'
api.delete('/users.json/'+id)
$id = '33715';
$api->delete('/users.json/'.$id);
var id = '33715'
api.del('/users.json/' + id, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
	"code":200
}

Zones API

List Zones

Returns a list of all zones on the specified account

Code Samples @

api.get('/zones.json')
api.get('/zones.json')
$api->get('/zones.json');
api.get('/zones.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 2,
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "total": 2,
        "zones": [
            {
                "cdn_url": "cdn.somedomain.com",
                "creation_date": "2013-05-15 20:45:44",
                "id": "#####",
                "inactive": "0",
                "label": "personal",
                "locked": "0",
                "name": "zoneName",
                "suspend": "0",
                "tmp_url": "zone.alias.netdna-cdn.com",
                "type": "2"
            },
            {
                "cdn_url": "newlivezone.somedomain.netdna-cdn.com",
                "creation_date": "2013-05-16 16:23:49",
                "id": "#####",
                "inactive": "0",
                "label": null,
                "locked": "0",
                "name": "newlivezone",
                "suspend": "0",
                "tmp_url": "newlivezone.alias.netdna-cdn.com",
                "type": "5"
            }
        ]
    }
}

Get Zone Summary

Gets a summarized count of all zone types on the specified account

Response Parameters

Parameter | Description | --- | --- | --- pull | The number of pull zones for your account | push | The number of push zones for your account | vod | The number of vod zones for your account | live | The number of live zones for your account |

Code Samples

api.get('/zones.json/summary')
api.get('/zones.json/summary')
$api->get('/zones.json/summary');
api.get('/zones.json/summary', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "summary": {
            "live": 1,
            "pull": 1,
            "push": 1,
            "vod": 1
        }
    }
}

Get Zone Count

Counts all zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- count | The total number of content zones for your account |

Code Samples

api.get('/zones.json/count')
api.get('/zones.json/count')
$api->get('/zones.json/count');
api.get('/zones.json/count', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200,"data":
		{
			"count":"4"
		}
}

Pull Zone API

List Pull Zones

Returns a list of all pull zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- id | Pull Zone ID | name | Pull Zone name | url | Origin URL | port | Port | ip | IP address of the Origin URL | compress | On the fly compression of your files served from our edges.GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | backend_compress | Allow us to cache compressed versions of your files from theorigin. GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | queries | Treat Query Strings as a separate cacheable item | set_host_header | The URL sent as the Host in all HTTP Response Headers | cache_valid | Ignore the origin Cache-Control Header and set every request tohave a Max-Age of 1d, 7d, 1M or 12M | ignore_setcookie_header | Ignore any cookies set by the origin in order to make thecontent consistently cacheable | ignore_cache_control | Ignore any max age values set by the origin and use the CDN setvalue instead | use_stale | Serve expired content while fetching new content. This willalso cause the CDN to serve expired content in cases where theorigin is down or the file is not found | proxy_cache_lock | When multiple requests for an uncached file are received, theywill wait until the first response is received rather than sendingeach request back to the origin | label | Something that describes your zone | valid_referers | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | expires | Set any request with a no "Cache-Control header" from theorigin to stay on the server. Possible values are 1d, 7d, 1M,12M | disallow_robots | Enable robots.txt | disallow_robots_txt | Use custom robots.txt | canonical_link_headers | Pass the canonical URL in the Link HTTP Header | content_disposition | Force files to download | pseudo_streaming | Enable the zone for pseudo streaming content | sslshared | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

api.get('/zones/pull.json')
api.get('/zones/pull.json')
$api->get('/zones/pull.json');
api.get('/zones/pull.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 3,
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "pullzones": [
            {
                "backend_compress": "0",
                "cache_valid": "1d",
                "canonical_link_headers": "0",
                "cdn_url": "cdn.somedomain.com",
                "compress": "1",
                "content_disposition": "0",
                "creation_date": "2013-05-15 20:45:44",
                "disallow_robots": "0",
                "disallow_robots_txt": null,
                "dns_check": "1",
                "expires": null,
                "hide_setcookie_header": "0",
                "id": "96061",
                "ignore_cache_control": "0",
                "ignore_setcookie_header": "0",
                "inactive": "0",
                "ip": "205.134.255.49",
                "label": "personal",
                "locked": "0",
                "name": "somedomain",
                "port": "80",
                "proxy_cache_lock": "0",
                "pseudo_streaming": "0",
                "queries": "1",
                "server_id": "18",
                "set_host_header": null,
                "sslshared": "0",
                "suspend": "0",
                "tmp_url": "somedomain.alias.netdna-cdn.com",
                "type": "2",
                "upstream_enabled": "0",
                "url": "http://somedomain.net",
                "use_stale": "0",
                "valid_referers": null
            },
            <...>,
            {
                "backend_compress": "0",
                "cache_valid": "1d",
                "canonical_link_headers": "0",
                "cdn_url": "newpullzone3.alias.netdna-cdn.com",
                "compress": "0",
                "content_disposition": "0",
                "creation_date": "2013-05-24 16:18:19",
                "disallow_robots": "0",
                "disallow_robots_txt": null,
                "dns_check": "1",
                "expires": null,
                "hide_setcookie_header": "0",
                "id": "97312",
                "ignore_cache_control": "0",
                "ignore_setcookie_header": "0",
                "inactive": "0",
                "ip": "205.134.255.49",
                "label": null,
                "locked": "0",
                "name": "newpullzone3",
                "port": "80",
                "proxy_cache_lock": "0",
                "pseudo_streaming": "0",
                "queries": "1",
                "server_id": "18",
                "set_host_header": null,
                "sslshared": "0",
                "suspend": "0",
                "tmp_url": "newpullzone3.alias.netdna-cdn.com",
                "type": "2",
                "upstream_enabled": "0",
                "url": "http://somedomain.net",
                "use_stale": "0",
                "valid_referers": null
            }
        ],
        "total": 3
    }
}

Create Pull Zone

Creates a new pull zone

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- name | - | required
length: 3-32 chars; only letters, digits, and dash (-)accepted | Pull Zone Name | url | - | required
length: 4-100 chars; only valid URLs accepted | Origin URL | port | 80 | length: 1-5 chars; only digits accepted | Port | ip | - | length: 1-10 chars, only digits accepted | Valid IP address of the Origin URL. If omitted, the servicewill try to lookup the IP automatically. | compress | 0 | only 0 or 1 accepted | On the fly compression of your files served from our edges.Enable GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | backend_compress | 0 | only 0 or 1 accepted | Allow us to cache compressed versions of your files from theorigin. Enable GZip compression for the following file types:text/plain, text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | queries | 0 | only 0 or 1 accepted | Treat Query Strings as a separate cacheable item | set_host_header | - | length: 4-100 chars; only valid URLs accepted | The URL to send as the Host in all HTTP Response Headers | cache_valid | 1d | length: 1-30 chars; must be a number followed by one of s, m,h, d, M, or Y | Ignore the origin Cache-Control Header and set every request tohave a Max-Age of 1d, 7d, 1M or 12M | ignore_setcookie_header | 0 | only 0 or 1 accepted | Ignore any cookies set by the origin in order to make thecontent consistently cacheable | ignore_cache_control | 0 | only 0 or 1 accepted | Ignore any max age values set by the origin and use the CDN setvalue instead | use_stale | 0 | only 0 or 1 accepted | Serve expired content while fetching new content. This willalso cause the CDN to serve expired content in cases where theorigin is down or the file is not found | proxy_cache_lock | 0 | only 0 or 1 accepted | When multiple requests for an uncached file are received, theywill wait until the first response is received rather than sendingeach request back to the origin | label | - | length: 1-255 chars | Something that describes your zone | valid_referers | - | length: 1-100 chars | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | expires | 1d | length: 1-32 chars | Set any request with a no "Cache-Control header" from theorigin to stay on the server. Possible values are 1d, 7d, 1M,12M | disallow_robots | 0 | only 0 or 1 accepted | Enable robots.txt | disallow_robots_txt | - | length 1-255 chars | Use custom robots.txt | canonical_link_headers | 1 | only 0 or 1 accepted | Pass the canonical URL in the Link HTTP Header | content_disposition | 0 | only 0 or 1 accepted | Force files to download | pseudo_streaming | 0 | only 0 or 1 accepted | Enable the zone for pseudo streaming content | secret | - | length: 1 - 32 chars | Use a secret to protect your files from unwanted visitors | sslshared | 0 | only 0 or 1 accepted | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. |

Response Parameters

Parameter | Description | --- | --- | --- id | Pull Zone ID | name | Pull Zone name | url | Origin URL | port | Port | ip | IP address of the Origin URL | compress | On the fly compression of your files served from our edges.GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | backend_compress | Allow us to cache compressed versions of your files from theorigin. GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | queries | Treat Query Strings as a separate cacheable item | set_host_header | The URL sent as the Host in all HTTP Response Headers | cache_valid | Ignore the origin Cache-Control Header and set every request tohave a Max-Age of 1d, 7d, 1M or 12M | ignore_setcookie_header | Ignore any cookies set by the origin in order to make thecontent consistently cacheable | ignore_cache_control | Ignore any max age values set by the origin and use the CDN setvalue instead | use_stale | Serve expired content while fetching new content. This willalso cause the CDN to serve expired content in cases where theorigin is down or the file is not found | proxy_cache_lock | When multiple requests for an uncached file are received, theywill wait until the first response is received rather than sendingeach request back to the origin | label | Something that describes your zone | valid_referers | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | expires | Set any request with a no "Cache-Control header" from theorigin to stay on the server. Possible values are 1d, 7d, 1M,12M | disallow_robots | Enable robots.txt | disallow_robots_txt | Use custom robots.txt | canonical_link_headers | Pass the canonical URL in the Link HTTP Header | content_disposition | Force files to download | pseudo_streaming | Enable the zone for pseudo streaming content | sslshared | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

params = {"name"=>"newPullZone6","url"=>"http://somedomain.com"}
api.post('/zones/pull.json',params)
params = {"name":"newPullZone5","url":"http://somedomain.net"}
api.post('/zones/pull.json',data=params)
$params =  array("name"=>"newPullZone2","url"=>"http://somedomain.net");
$api->post('/zones/pull.json',$params);
api.post('/zones/pull.json', { name: 'newPullZone2', url: 'http://somedomain.net' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 201,
    "data": {
        "pullzone": {
            "backend_compress": 0,
            "cache_valid": "1d",
            "canonical_link_headers": 1,
            "cdn_url": "newpullzone3.alias.netdna-cdn.com",
            "compress": 0,
            "content_disposition": 0,
            "creation_date": "2013-05-24 16:18:19",
            "disallow_robots": 0,
            "disallow_robots_txt": null,
            "dns_check": 0,
            "expires": null,
            "hide_setcookie_header": 0,
            "id": 97312,
            "ignore_cache_control": 0,
            "ignore_setcookie_header": 0,
            "inactive": 0,
            "ip": "205.134.255.49",
            "label": null,
            "locked": 0,
            "name": "newpullzone3",
            "port": 80,
            "proxy_cache_lock": 0,
            "pseudo_streaming": 0,
            "queries": "1",
            "server_id": "18",
            "set_host_header": 1,
            "sslshared": null,
            "suspend": 0,
            "tmp_url": "newpullzone3.alias.netdna-cdn.com",
            "type": 2,
            "upstream_enabled": 0,
            "url": "http://somedomain.net",
            "use_stale": 0,
            "valid_referers": null
        }
    }
}

Get Pull Zones Count

Counts all pull zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- count | The number of pull zones on the specified account |

Code Samples

api.get('/zones/pull.json/count')
api.get('/zones/pull.json/count')
$api->get('/zones/pull.json/count');
api.get('/zones/pull.json/count', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200,"data":
		{
			"count": "3"
		}
}

Get Pull Zone

Gets a pull zone specified by the {zone_id} parameter

Response Parameters

Parameter | Description | --- | --- | --- id | The Pull Zone ID | name | Pull Zone name | url | Origin URL | port | Port | ip | Valid IP address of the Origin URL. If omitted, the servicewill try to lookup the IP automatically. | compress | On the fly compression of your files served from our edges.GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | backend_compress | Allow us to cache compressed versions of your files from theorigin. GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | queries | Treat Query Strings as a separate cacheable item | set_host_header | The URL sent as the Host in all HTTP Response Headers | cache_valid | Ignore the origin Cache-Control Header and set every request tohave a Max-Age of 1d, 7d, 1M or 12M | ignore_setcookie_header | Ignore any cookies set by the origin in order to make thecontent consistently cacheable | ignore_cache_control | Ignore any max age values set by the origin and use the CDN setvalue instead | use_stale | Serve expired content while fetching new content. This willalso cause the CDN to serve expired content in cases where theorigin is down or the file is not found | proxy_cache_lock | When multiple requests for an uncached file are received, theywill wait until the first response is received rather than sendingeach request back to the origin | label | Something that describes your zone | valid_referers | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | expires | Set any request with a no "Cache-Control header" from theorigin to stay on the server. Possible values are 1d, 7d, 1M,12M | disallow_robots | Enable robots.txt | disallow_robots_txt | Use custom robots.txt | canonical_link_headers | Pass the canonical URL in the Link HTTP Header | content_disposition | Force files to download | pseudo_streaming | Enable the zone for pseudo streaming content | sslshared | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

id = '97167'
api.get('/zones/pull.json/'+id)
id = '97167'
api.get('/zones/pull.json/'+id)
$id = '96076';
$api->get('/zones/pull.json/'.$id);
var id = '96076'
api.get('/zones/pull.json' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "pullzone": {
            "backend_compress": "0",
            "cache_valid": "1d",
            "canonical_link_headers": "0",
            "cdn_url": "cdn.somenewdomain.com",
            "compress": "0",
            "content_disposition": "0",
            "creation_date": "2013-05-23 19:38:30",
            "disallow_robots": "0",
            "disallow_robots_txt": null,
            "dns_check": "1",
            "expires": null,
            "hide_setcookie_header": "0",
            "id": "97167",
            "ignore_cache_control": "0",
            "ignore_setcookie_header": "0",
            "inactive": "0",
            "ip": "205.134.255.49",
            "label": "Some other description",
            "locked": "0",
            "name": "newpullzone2",
            "port": "80",
            "proxy_cache_lock": "0",
            "pseudo_streaming": "0",
            "queries": "1",
            "server_id": "18",
            "set_host_header": null,
            "sslshared": "0",
            "suspend": "0",
            "tmp_url": "newpullzone2.alias.netdna-cdn.com",
            "type": "2",
            "upstream_enabled": "0",
            "url": "http://somedomain.net",
            "use_stale": "0",
            "valid_referers": null
        }
    }
}

Update Pull Zone

Updates a pull zone specified by the {zone_id} parameter

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- url | - | length: 4-100 chars; only valid URLs accepted | Origin URL | port | 80 | length: 1-5 chars; only digits accepted | Port | compress | 0 | only 0 or 1 accepted | On the fly compression of your files served from our edges.Enable GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | backend_compress | 0 | only 0 or 1 accepted | Allow us to cache compressed versions of your files from theorigin. Enable GZip compression for the following file types:text/plain, text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | queries | 0 | only 0 or 1 accepted | Treat Query Strings as a separate cacheable item | set_host_header | - | length: 4-100 chars; only valid URLs accepted | The URL to send as the Host in all HTTP Response Headers | cache_valid | - | length: 1-30 chars; must be a number followed by one of s, m,h, d, M, or Y | Ignore the origin Cache-Control Header and set every request tohave a Max-Age of 1d, 7d, 1M or 12M | ignore_setcookie_header | 0 | only 0 or 1 accepted | Ignore any cookies set by the origin in order to make thecontent consistently cacheable | ignore_cache_control | 0 | only 0 or 1 accepted | Ignore any max age values set by the origin and use the CDN setvalue instead | use_stale | 0 | only 0 or 1 accepted | Serve expired content while fetching new content. This willalso cause the CDN to serve expired content in cases where theorigin is down or the file is not found | proxy_cache_lock | 0 | only 0 or 1 accepted | When multiple requests for an uncached file are received, theywill wait until the first response is received rather than sendingeach request back to the origin | label | - | length: 1-255 chars | Something that describes your zone | valid_referers | - | length: 1-100 chars | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | expires | 1d | length: 1-32 chars | Set any request with a no "Cache-Control header" from theorigin to stay on the server. Possible values are 1d, 7d, 1M,12M | disallow_robots | 0 | only 0 or 1 accepted | Enable robots.txt | disallow_robots_txt | - | length: 1-255 chars | Use custom robots.txt | canonical_link_headers | 1 | only 0 or 1 accepted | Pass the canonical URL in the Link HTTP Header | content_disposition | 0 | only 0 or 1 accepted | Force files to download | pseudo_streaming | 0 | only 0 or 1 accepted | Enable the zone for pseudo streaming content | secret | - | length: 1 - 32 chars | Use a secret to protect your files from unwanted visitors | sslshared | 0 | only 0 or 1 accepted | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. |

Response Parameters

Parameter | Description | --- | --- | --- id | Pull Zone ID | name | Pull Zone name | url | Origin URL | port | Port | ip | Valid IP address of the Origin URL. If omitted, the servicewill try to lookup the IP automatically. | compress | On the fly compression of your files served from our edges.GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | backend_compress | Allow us to cache compressed versions of your files from theorigin. GZip compression for the following file types: text/plain,text/html, text/javascript, text/css, text/xml,application/javascript, application/x-javascript, application/xml,text/x-component, application/json, application/xhtml+xml,application/rss+xml, application/atom+xml, app/vnd.ms-fontobject,image/svg+xml, application/x-font-ttf, font/opentype | queries | Treat Query Strings as a separate cacheable item | set_host_header | The URL sent as the Host in all HTTP Response Headers | cache_valid | Ignore the origin Cache-Control Header and set every request tohave a Max-Age of 1d, 7d, 1M or 12M | ignore_setcookie_header | Ignore any cookies set by the origin in order to make thecontent consistently cacheable | ignore_cache_control | Ignore any max age values set by the origin and use the CDN setvalue instead | use_stale | Serve expired content while fetching new content. This willalso cause the CDN to serve expired content in cases where theorigin is down or the file is not found | proxy_cache_lock | When multiple requests for an uncached file are received, theywill wait until the first response is received rather than sendingeach request back to the origin | label | Something that describes your zone | valid_referers | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | expires | Set any request with a no "Cache-Control header" from theorigin to stay on the server. Possible values are 1d, 7d, 1M,12M | disallow_robots | Enable robots.txt | disallow_robots_txt | Use custom robots.txt | canonical_link_headers | Pass the canonical URL in the Link HTTP Header | content_disposition | Force files to download | pseudo_streaming | Enable the zone for pseudo streaming content | sslshared | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

id = '97167'
params = {"label"=>"Some other description"}
api.put('/zones/pull.json/'+id,params)
id = '97167'
params = {"label":"Some other description"}
api.put('/zones/pull.json/'+id,params=params)
$id = '96167';
$params = array("label"=>"Some other description");
$api->put('/zones/pull.json/'.$id, $params);
var id = '96167'
api.put('/zones/pull.json' + id, { label: 'Some other description' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "pullzone": {
            "backend_compress": "0",
            "cache_valid": "1d",
            "canonical_link_headers": "0",
            "cdn_url": "cdn.somenewdomain.com",
            "compress": "0",
            "content_disposition": "0",
            "creation_date": "2013-05-23 19:38:30",
            "disallow_robots": "0",
            "disallow_robots_txt": null,
            "dns_check": "1",
            "expires": null,
            "hide_setcookie_header": "0",
            "id": "97167",
            "ignore_cache_control": "0",
            "ignore_setcookie_header": "0",
            "inactive": "0",
            "ip": "205.134.255.49",
            "label": "Some other description",
            "locked": "0",
            "name": "newpullzone2",
            "port": "80",
            "proxy_cache_lock": "0",
            "pseudo_streaming": "0",
            "queries": "1",
            "server_id": "18",
            "set_host_header": null,
            "sslshared": "0",
            "suspend": "0",
            "tmp_url": "newpullzone2.alias.netdna-cdn.com",
            "type": "2",
            "upstream_enabled": "0",
            "url": "http://somedomain.net",
            "use_stale": "0",
            "valid_referers": null
        }
    }
}

Delete Pull Zone

Deletes a pull zone specified by the {zone_id} parameter

Code Samples

id = '97167'
api.delete('/zones/pull.json/'+id)
id = '97167'
api.delete('/zones/pull.json/'+id)
$id = '97167';
$api->delete('/zones/pull.json/'.$id);
var id = '97167'
api.del('/zones/pull.json' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Enable Pull Zone

Enables a pull zone specified by the {zone_id} parameter

Code Samples

id = '97167'
api.put('/zones/pull/'+id+'/enable.json')
id = '97167'
api.put('/zones/pull/'+id+'/enable.json')
$id = '97167';
$api->put('/zones/pull/'.$id.'/enable.json');
var id = '97167'
api.put('/zones/pull/' + id + '/enable.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Disable Pull Zone

Disables a pull zone specified by the {zone_id} parameter

Code Samples

id = '97167'
api.put('/zones/pull/'+id+'/disable.json')
id = '97167'
api.put('/zones/pull/'+id+'/disable.json')
$id = '97167';
$api->put('/zones/pull'.$id.'disable.json);
var id = '97167'
api.put('/zones/pull' + id + 'disable.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Purge Cache

Purges pull zone cache

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- files | - | An array containing relative paths of the files to purge (i.e./favicon.ico) |

Code Samples

#Purge Zone
id = '97167'
api.purge(id)

#Purge File id = '97167' api.purge(id,'/file1.txt')

#Purge Files id = '97167' api.purge(id, ['/file1.txt','/file2.txt'])

#Purge Zone
id = '97167'
api.purge(id)

#Purge File id = '97167' api.purge(id,'/file1.txt')

#Purge Files id = '97167' api.purge(id, ['/file1.txt','/file2.txt'])

//Purge Zone
$id = '97792';
$api->delete('/zones/pull.json/'.$id.'/cache');

//Purge File $id = '97792'; $params = array('file'=>'/index.html'); $api->delete('/zones/pull.json/'.$id.'/cache',$params);

//Purge Files $id = '97792'; $params = array('file'=>'/index.html','file2'=>'/robots.txt'); $api->delete('/zones/pull.json/'.$id.'/cache',$params);

var id = '96167'
api.del('/zones/pull.json/' + id + '/cache', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
{
    "code": 200
}

Pull Zone Custom Domains API

List Custom Domains

Returns a list of all custom domains on the zone specified by {zone_id}

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | A valid custom domain |

Code Samples

id = '97167'
api.get('/zones/pull/'+id+'/customdomains.json')
id = '97167'
api.get('/zones/pull/'+id+'/customdomains.json')
$id = '96061';
$api->get('/zones/pull/'.$id.'/customdomains.json');
var id = '96061'
api.get('/zones/pull/' + id + '/customdomains.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomains": [
            {
                "bucket_id": "97167",
                "custom_domain": "cdn.somenewdomain.com",
                "id": "79182",
                "type": null
            }
        ],
        "total": 1
    }
}

Create Custom Domain

Adds a new custom domain to {zone_id}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- custom_domain | - | required
length: 1-255 chars, valid::custom_domain, !valid::full_domain | A valid custom domain | type | - | Applies only to Vod Zones and must be either 'vod-rtmp','vod-pseudo', 'vod-direct', or 'vod-ftp' | The type of custom domain being created |

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The valid custom domain |

Code Samples

id = '97167'
params = {"custom_domain"=>"cdn.somedomain14.com"}
api.post('/zones/pull/'+id+'/customdomains.json', params)
id = '97167'
params = {"custom_domain":"cdn.somedomain13.com"}
api.post('/zones/pull/'+id+'/customdomains.json', params)
$id = '97167';
$params = array("custom_domain"=>"cdn.somedomain3.com");
$api->post('/zones/pull/'.$id.'/customdomains.json', $params);
var id = '96167'
api.post('/zones/pull/' + id + '/customdomains.json', { custom_domain: 'cdn.somedomain3.com' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 201,
    "data": {
        "customdomain": {
            "bucket_id": "97167",
            "custom_domain": "cdn.somedomain3.com",
            "id": 79282,
            "type": null
        }
    }
}

Get Custom Domain

Gets a custom domain specified by the {zone_id} and {customdomain_id} parameters

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The valid custom domain |

Code Samples

zoneId = '97167'
domainId = '79182'
api.get('/zones/pull/'+zoneId+'/customdomains.json/'+domainId)
zoneId = '97167'
domainId = '79182'
api.get('/zones/pull/'+zoneId+'/customdomains.json/'+domainId)
$zoneId = '97167';
$domainId = '79182';
$api->get('/zones/pull/'.$zoneId.'/customdomains.json/'.$domainId);
var id = '97167'
var domainId = '79182'
api.get('/zones/pull/' + id + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomain": {
            "bucket_id": "97167",
            "custom_domain": "cdn.somenewdomain.com",
            "id": "79182",
            "type": null
        }
    }
}

Update Custom Domain

Updates a custom domain specified by the id parameter

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- custom_domain | - | required
length: 1-255 chars, valid::custom_domain, !valid::full_domain | A new valid custom domain |

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The new valid custom domain |

Code Samples

zoneId = '97167'
domainId = '79182'
params = {"custom_domain"=>"cdn.somenewdomain41.com"}
api.put('/zones/pull/'+zoneId+'/customdomains.json/'+domainId,params)
zoneId = '97167'
domainId = '79182'
params = {"custom_domain":"cdn.somenewdomain41.com"}
api.put('/zones/pull/'+zoneId+'/customdomains.json/'+domainId,params=params)
$zoneId = '97167';
$domainId = '79182';
$params = array("custom_domain"=>"cdn.somenewdomain.com");
$api->put('/zones/pull/'.$zoneId.'/customdomains.json/'.$domainId, $params);
var zoneId = '97167'
var domainId = '79182'
api.put('/zones/pull/' + zoneId + '/customdomains.json/' + domainId, { custom_domain: 'cdn.somenewdomain.com' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomain": {
            "bucket_id": "97167",
            "custom_domain": "cdn.somenewdomain4.com",
            "id": "79182",
            "type": null
        }
    }
}

Delete Custom Domain

Deletes a custom domain specified by the {zone_id} and {customdomain_id} parameters

Code Samples

zoneId = '97167'
domainId = '79182'
api.delete('/zones/pull/'+zoneId+'/customdomains.json/'+domainId)
zoneId = '97167'
domainId = '79182'
api.delete('/zones/pull/'+zoneId+'/customdomains.json/'+domainId)
$zoneId = '97167';
$domainId = '79182';
$api->delete('/zones/pull/'.$zoneId.'/customdomains.json/'.$domainId);
var zoneId = '97167'
var domainId = '79182'
api.del('/zones/pull/' + zoneId + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Push Zone API

List Push Zones

Returns a list of all push zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- id | Push Zone ID | name | Push Zone name | label | Something that describes your zone | valid_referers | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | content_disposition | Force files to download | sslshared | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

api.get('/zones/push.json')
api.get('/zones/push.json')
$api->get('/zones/push.json');
api.get('/zones/push.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 2,
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "pushzones": [
            {
                "cdn_url": "cdn.somedomain.net",
                "compress": "0",
                "content_disposition": "0",
                "creation_date": "2013-05-16 15:25:19",
                "expires": null,
                "ftp_url": "ftp.newpushzone2.alias.netdna-cdn.com",
                "id": "96182",
                "inactive": "0",
                "label": null,
                "locked": "0",
                "name": "newpushzone2",
                "server_id": "11",
                "sslshared": "0",
                "storage_updated": "2013-05-24 06:31:52",
                "storage_used": "20480",
                "suspend": "0",
                "tmp_url": "newpushzone2.alias.netdna-cdn.com",
                "type": "3",
                "valid_referers": null
            },
            {
                "cdn_url": "cdn.somenewdomain2.com",
                "compress": "0",
                "content_disposition": "0",
                "creation_date": "2013-05-23 21:01:39",
                "expires": null,
                "ftp_url": "ftp.newpushzone3.alias.netdna-cdn.com",
                "id": "97181",
                "inactive": "0",
                "label": "Some other description",
                "locked": "0",
                "name": "newpushzone3",
                "server_id": "11",
                "sslshared": "0",
                "storage_updated": "2013-05-24 06:31:52",
                "storage_used": "20480",
                "suspend": "0",
                "tmp_url": "newpushzone3.alias.netdna-cdn.com",
                "type": "3",
                "valid_referers": null
            }
        ],
        "total": 2
    }
}

Create Push Zone

Creates a new push zone

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- name | - | required
length: 3-30 chars; only letters, digits, and dash (-)accepted | Push Zone name | password | - | required
length: 5-30 chars; | Push Zone FTP password | label | - | length: 1-255 chars | Something that describes your zone | valid_referers | - | length: 1-200 chars | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | content_disposition | 0 | only 0 or 1 accepted | Force files to download | sslshared | 0 | only 0 or 1 accepted | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. |

Response Parameters

Parameter | Description | --- | --- | --- id | Push Zone ID | name | Push Zone name | label | Something that describes your zone | valid_referers | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | content_disposition | Force files to download | sslshared | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

params = {"name"=>"newPushZone99","password"=>"password"}
api.post('/zones/push.json',params)
params = {"name":"newPushZone6","password":"password"}
api.post('/zones/push.json',data=params)
$params = array("name"=>"newPushZone","password"=>"password");
$api->post('/zones/push.json', $params);
api.post('/zones/push.json', { name: 'newPushZone', password: 'password' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 201,
    "data": {
        "pushzone": {
            "cdn_url": "newpushzone4.alias.netdna-cdn.com",
            "compress": 0,
            "content_disposition": 0,
            "creation_date": "2013-05-24 16:41:53",
            "expires": null,
            "ftp_url": "ftp.newpushzone4.alias.netdna-cdn.com",
            "id": 97317,
            "inactive": 0,
            "label": null,
            "locked": 0,
            "name": "newpushzone4",
            "server_id": "11",
            "sslshared": null,
            "storage_updated": null,
            "storage_used": null,
            "suspend": 0,
            "tmp_url": "newpushzone4.alias.netdna-cdn.com",
            "type": 3,
            "valid_referers": null
        }
    }
}

Get Push Zones Count

Counts all push zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- count | The number of push zones on the specified account |

Code Samples

api.get('/zones/push.json/count')
api.get('/zones/push.json/count')
$api->get('/zones/push.json/count');
api.get('/zones/push.json/count', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "count": "3"
    }
}

Get Push Zone

Gets a push zone specified by the {zone_id} parameter

Response Parameters

Parameter | Description | --- | --- | --- id | Push Zone ID | name | Push Zone name | label | Something that describes your zone | valid_referers | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | content_disposition | Force files to download | sslshared | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

id = '97793'
api.get('/zones/push.json/'+id)
id = '96182'
api.get('/zones/push.json/'+id)
$id = '97181';
$api->get('/zones/push.json/'.$id);
var id = '97182'
api.get('/zones/push.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "pushzone": {
            "cdn_url": "cdn.somenewdomain2.com",
            "compress": "0",
            "content_disposition": "0",
            "creation_date": "2013-05-23 21:01:39",
            "expires": null,
            "ftp_url": "ftp.newpushzone3.alias.netdna-cdn.com",
            "id": "97181",
            "inactive": "0",
            "label": "Some other description",
            "locked": "0",
            "name": "newpushzone3",
            "server_id": "11",
            "sslshared": "0",
            "storage_updated": "2013-05-24 06:31:52",
            "storage_used": "20480",
            "suspend": "0",
            "tmp_url": "newpushzone3.alias.netdna-cdn.com",
            "type": "3",
            "valid_referers": null
        }
    }
}

Update Push Zone

Updates a push zone specified by the {zone_id} parameter

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- label | - | length: 1-255 chars | Something that describes your zone | valid_referers | - | length: 1-100 chars | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | content_disposition | 0 | only 0 or 1 accepted | Force files to download | sslshared | 0 | only 0 or 1 accepted | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. |

Response Parameters

Parameter | Description | --- | --- | --- id | Push Zone ID | name | Push Zone name | label | Something that describes your zone | valid_referers | List of domains for http referrer protection (separated byspace). Only the domains in the list will be treated as validreferrers | content_disposition | Force files to download | sslshared | Enable Shared SSL. This feature allows you use your zone inHTTPS mode. You don't need your own SSL certificate, our servernetdna-ssl.com will be used. | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

id = '97793'
params = {"label"=>"Some other description"}
api.put('/zones/push.json/'+id,params)
id = '96182'
params = {"label":"Some other description"}
api.put('/zones/push.json/'+id,params=params)
$id = '97181';
$params = array("label"=>"Some other description");
$api->put('/zones/push.json/'.$id, $params);
var id = '97182'
api.get('/zones/push.json/' + id, { label: 'Some other description' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "pushzone": {
            "cdn_url": "cdn.somenewdomain2.com",
            "compress": "0",
            "content_disposition": "0",
            "creation_date": "2013-05-23 21:01:39",
            "expires": null,
            "ftp_url": "ftp.newpushzone3.alias.netdna-cdn.com",
            "id": "97181",
            "inactive": "0",
            "label": "Some other description",
            "locked": "0",
            "name": "newpushzone3",
            "server_id": "11",
            "sslshared": "0",
            "storage_updated": "2013-05-24 06:31:52",
            "storage_used": "20480",
            "suspend": "0",
            "tmp_url": "newpushzone3.alias.netdna-cdn.com",
            "type": "3",
            "valid_referers": null
        }
    }
}

Delete Push Zone

Deletes a push zone specified by the {zone_id} parameter

Code Samples

id = '97793'
api.delete('/zones/push.json/'+id)
id = '96182'
api.delete('/zones/push.json/'+id)
$id = '97181';
$api->delete('/zones/push.json/'.$id);
var id = '97181'
api.del('/zones/push.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Enable Push Zone

Enables a push zone specified by the {zone_id} parameter

Code Samples

id = '97793'
api.put('/zones/push/'+id+'/enable.json')
id = '96182'
api.put('/zones/push/'+id+'/enable.json')
$id = '97181';
$api->put('/zones/push/'.$id.'/enable.json');
var id = '97181'
api.put('/zones/push/' + id + '/enable.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Disable Push Zone

Disables a push zone specified by the {zone_id} parameter

Code Samples

id = '97793'
api.put('/zones/push/'+id+'/disable.json')
id = '96182'
api.put('/zones/push/'+id+'/disable.json')
$id = '97181';
$api->put('/zones/push/'.$id.'/disable.json');
var id = '97181'
api.put('/zones/push/' + id + '/disable.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Push Zone Custom Domains API

List Custom Domains

Returns a list of all custom domains on the zone specified by {zone_id}

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | A valid custom domain |

Code Samples

id = '97793'
api.get('/zones/push/'+id+'/customdomains.json')
id = '96182'
api.get('/zones/push/'+id+'/customdomains.json')
$id = '96061';
$api->get('/zones/push/'.$id.'/customdomains.json');
var id = '96061'
api.get('/zones/push/' + id + '/customdomains.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomains": [
            {
                "bucket_id": "96061",
                "custom_domain": "cdn.somedomain.com",
                "id": "78330",
                "type": null
            }
        ],
        "total": 1
    }
}

Create Custom Domain

Adds a new custom domain to {zone_id}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- custom_domain | - | required
length: 1-255 chars, valid::custom_domain, !valid::full_domain | A valid custom domain | type | - | Applies only to Vod Zones and must be either 'vod-rtmp','vod-pseudo', 'vod-direct', or 'vod-ftp' | The type of custom domain being created |

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The valid custom domain |

Code Samples

id = '97793'
params = {"custom_domain"=>"cdn.somedomain19.com"}
api.post('/zones/push/'+id+'/customdomains.json', params)
id = '96182'
params = {"custom_domain":"cdn.somedomain15.com"}
api.post('/zones/push/'+id+'/customdomains.json', params)
$id = '97181';
$params = array("custom_domain"=>"cdn.somedomain2.net");
$api->post('/zones/push/'.$id.'/customdomains.json', $params);
var id = '97181'
api.post('/zones/push/' + id + '/customdomains.json', { custom_domain: 'cdn.somedomain2.net' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 201,
    "data": {
        "customdomain": {
            "bucket_id": "97181",
            "custom_domain": "cdn.somedomain4.net",
            "id": 79283,
            "type": null
        }
    }
}

Get Custom Domain

Gets a custom domain specified by the {zone_id} and {customdomain_id} parameters

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The valid custom domain |

Code Samples

zoneId = '97793'
domainId = '79747'
api.get('/zones/push/'+zoneId+'/customdomains.json/'+domainId)
zoneId = '96182'
domainId = '79320'
api.get('/zones/push/'+zoneId+'/customdomains.json/'+domainId)
$zoneId = '97181';
$domainId = '79188';
$api->get('/zones/push/'.$zoneId.'/customdomains.json/'.$domainId);
var zoneId = '97181'
var domainId = '79188'
api.get('/zones/push/' + zoneId + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomain": {
            "bucket_id": "97181",
            "custom_domain": "cdn.somenewdomain2.com",
            "id": "79188",
            "type": null
        }
    }
}

Update Custom Domain

Updates a custom domain specified by the id parameter

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- custom_domain | - | required
length: 1-255 chars, valid::custom_domain, !valid::full_domain | A new valid custom domain |

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The new valid custom domain |

Code Samples

zoneId = '97793'
domainId = '79747'
params = {"custom_domain"=>"cdn.somenewdomain41.com"}
api.put('/zones/push/'+zoneId+'/customdomains.json/'+domainId,params)
zoneId = '96182'
domainId = '79320'
params = {"custom_domain":"cdn.somenewdomain40.com"}
api.put('/zones/push/'+zoneId+'/customdomains.json/'+domainId,params=params)
$zoneId = '97181';
$domainId = '79188';
$params = array("custom_domain"=>"cdn.somenewdomain2.com");
$api->put('/zones/push/'.$zoneId.'/customdomains.json/'.$domainId, $params);
var zoneId = '97181'
var domainId = '79188'
api.put('/zones/push/' + zoneId + '/customdomains.json/' + domainId, { custom_domain: 'cdn.somenewdomain2.com' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomain": {
            "bucket_id": "97181",
            "custom_domain": "cdn.somenewdomain12.com",
            "id": "79188",
            "type": null
        }
    }
}

Delete Custom Domain

Deletes a custom domain specified by the {zone_id} and {customdomain_id} parameters

Code Samples

zoneId = '97793'
domainId = '79747'
api.delete('/zones/push/'+zoneId+'/customdomains.json/'+domainId)
zoneId = '96182'
domainId = '79320'
api.delete('/zones/push/'+zoneId+'/customdomains.json/'+domainId)
$zoneId = '97181';
$domainId = '79188';
$api->delete('/zones/push/'.$zoneId.'/customdomains.json/'.$domainId);
var zoneId = '97181'
var domainId = '79188'
api.del('/zones/push/' + zoneId + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

VOD Zone API

List VOD Zones

Returns a list of all VOD zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- id | VOD Zone ID | name | VOD Zone name | label | The zone's description | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

api.get('/zones/vod.json')
api.get('/zones/vod.json')
$api->get('/zones/vod.json');
api.get('/zones/vod.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 2,
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "total": 2,
        "vodzones": [
            {
                "cdn_url": "cdn.somedomain.com",
                "creation_date": "2013-05-16 16:02:35",
                "direct_url": "d.newvodzone.alias.netdna-cdn.com",
                "ftp_url": "ftp.newvodzone.alias.netdna-cdn.com",
                "id": "96187",
                "inactive": "0",
                "label": null,
                "locked": "0",
                "name": "newvodzone",
                "pseudo_url": "p.newvodzone.alias.netdna-cdn.com",
                "rtmp_url": "r.newvodzone.alias.netdna-cdn.com",
                "server_id": "30",
                "storage_updated": "2013-05-24 06:35:35",
                "storage_used": "4096",
                "suspend": "0",
                "tmp_url": "newvodzone.alias.netdna-cdn.com",
                "token": null,
                "type": "4"
            },
            {
                "cdn_url": "cdn.somenewdomain3.com",
                "creation_date": "2013-05-23 21:25:44",
                "direct_url": "d.newvodzone3.alias.netdna-cdn.com",
                "ftp_url": "ftp.newvodzone3.alias.netdna-cdn.com",
                "id": "97183",
                "inactive": "0",
                "label": "Some other description",
                "locked": "0",
                "name": "newvodzone3",
                "pseudo_url": "p.newvodzone3.alias.netdna-cdn.com",
                "rtmp_url": "r.newvodzone3.alias.netdna-cdn.com",
                "server_id": "30",
                "storage_updated": "2013-05-24 06:35:35",
                "storage_used": "4096",
                "suspend": "0",
                "tmp_url": "newvodzone3.alias.netdna-cdn.com",
                "token": null,
                "type": "4"
            }
        ]
    }
}

Create VOD Zone

Creates a new VOD zone

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- name | - | required
length: 3-30 chars; only letters, digits, and dash (-)accepted | VOD Zone user name | password | - | required
length: 5-30 chars | Your desired password | token | - | length: 1-64 chars | The token value (shared secret) for secure streaming | label | - | length: 1-255 chars | Something that describes your zone |

Response Parameters

Parameter | Description | --- | --- | --- id | VOD Zone ID | name | VOD Zone name | label | The zone's description | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

params = {"name"=>"newVodZone99","password"=>"password"}
api.post('/zones/vod.json',params)
params = {"name":"newvodZone7","password":"password"}
api.post('/zones/vod.json',data=params)
$params = array("name"=>"newVODZone3","password"=>"password");
$api->post('/zones/vod.json',$params);
api.post('/zones/vod.json', { name: 'newVODZone3', password: 'password' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 201,
    "data": {
        "vodzone": {
            "cdn_url": "newvodzone4.alias.netdna-cdn.com",
            "creation_date": "2013-05-24 16:50:18",
            "direct_url": "d.newvodzone4.alias.netdna-cdn.com",
            "ftp_url": "ftp.newvodzone4.alias.netdna-cdn.com",
            "id": 97319,
            "inactive": 0,
            "label": null,
            "locked": 0,
            "name": "newvodzone4",
            "pseudo_url": "p.newvodzone4.alias.netdna-cdn.com",
            "rtmp_url": "r.newvodzone4.alias.netdna-cdn.com",
            "server_id": "30",
            "storage_updated": null,
            "storage_used": null,
            "suspend": 0,
            "tmp_url": "newvodzone4.alias.netdna-cdn.com",
            "token": null,
            "type": 4
        }
    }
}

Get VOD Zones Count

Counts all vod zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- count | The number of vod zones on the specified account |

Code Samples

api.get('/zones/vod.json/count')
api.get('/zones/vod.json/count')
$api->get('/zones/vod.json/count');
api.get('/zones/vod.json/count', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "count": "4"
    }
}

Get VOD Zone

Gets a VOD zone specified by the {zone_id} parameter

Response Parameters

Parameter | Description | --- | --- | --- id | VOD Zone ID | name | VOD Zone name | label | The zone's description | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

id = '97794'
api.get('/zones/vod.json/'+id)
id = '96187'
api.get('/zones/vod.json/'+id)
$id = '97183';
$api->get('/zones/vod.json/'.$id);
var id = '97183'
api.get('/zones/vod.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "vodzone": {
            "cdn_url": "cdn.somenewdomain3.com",
            "creation_date": "2013-05-23 21:25:44",
            "direct_url": "d.newvodzone3.alias.netdna-cdn.com",
            "ftp_url": "ftp.newvodzone3.alias.netdna-cdn.com",
            "id": "97183",
            "inactive": "0",
            "label": "Some other description",
            "locked": "0",
            "name": "newvodzone3",
            "pseudo_url": "p.newvodzone3.alias.netdna-cdn.com",
            "rtmp_url": "r.newvodzone3.alias.netdna-cdn.com",
            "server_id": "30",
            "storage_updated": "2013-05-24 06:35:35",
            "storage_used": "4096",
            "suspend": "0",
            "tmp_url": "newvodzone3.alias.netdna-cdn.com",
            "token": null,
            "type": "4"
        }
    }
}

Update VOD Zone

Updates a VOD zone specified by the {zone_id} parameter

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- password | - | length: 5-30 chars | Your desired password | token | - | length: 1-64 chars | The token value (shared secret) for secure streaming | label | - | length: 1-255 chars | Something that describes your zone |

Response Parameters

Parameter | Description | --- | --- | --- id | VOD Zone ID | name | VOD Zone name | label | The zone's description | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

id = '97794'
params = {"label"=>"Some other description"}
api.put('/zones/vod.json/'+id,params)
id = '96187'
params = {"label":"Some other description"}
api.put('/zones/vod.json/'+id,params=params)
$id = '97183';
$params =  array("label"=>"Some other description");
$api->put('/zones/vod.json/'.$id,$params);
var id = '97183'
api.put('/zones/vod.json/' + id, { label: 'Some other description' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "vodzone": {
            "cdn_url": "cdn.somenewdomain3.com",
            "creation_date": "2013-05-23 21:25:44",
            "direct_url": "d.newvodzone3.alias.netdna-cdn.com",
            "ftp_url": "ftp.newvodzone3.alias.netdna-cdn.com",
            "id": "97183",
            "inactive": "0",
            "label": "Some other description",
            "locked": "0",
            "name": "newvodzone3",
            "pseudo_url": "p.newvodzone3.alias.netdna-cdn.com",
            "rtmp_url": "r.newvodzone3.alias.netdna-cdn.com",
            "server_id": "30",
            "storage_updated": "2013-05-24 06:35:35",
            "storage_used": "4096",
            "suspend": "0",
            "tmp_url": "newvodzone3.alias.netdna-cdn.com",
            "token": null,
            "type": "4"
        }
    }
}

Delete VOD Zone

Deletes a VOD zone specified by the {zone_id} parameter

Code Samples

id = '97794'
api.delete('/zones/vod.json/'+id)
id = '96187'
api.delete('/zones/vod.json/'+id)
$id = '97183';
$api->delete('/zones/vod.json/'.$id);
var id = '97183'
api.del('/zones/vod.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Enable VOD Zone

Enables a VOD zone specified by the {zone_id} parameter

Code Samples

id = '97794'
api.put('/zones/vod/'+id+'/enable.json')
id = '96187'
api.put('/zones/vod/'+id+'/enable.json')
$id = '96187';
$api->put('/zones/vod/'.$id.'/enable.json');
var id = '96187'
api.put('/zones/vod/' + id + '/enable.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Disable VOD Zone

Disables a VOD zone specified by the {zone_id} parameter

Code Samples

id = '97794'
api.put('/zones/vod/'+id+'/disable.json')
id = '96187'
api.put('/zones/vod/'+id+'/disable.json')
$id = '96187';
$api->put('/zones/vod/'.$id.'/disable.json');
var id = '96187'
api.put('/zones/vod/' + id + '/disable.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

VOD Zone Custom Domains API

List Custom Domains

Returns a list of all custom domains on the zone specified by {zone_id}

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | A valid custom domain |

Code Samples

id = '97794'
api.get('/zones/vod/'+id+'/customdomains.json')
id = '96187'
api.get('/zones/vod/'+id+'/customdomains.json')
$id = '97183';
$api->get('/zones/vod/'.$id.'/customdomains.json');
var id = '97183'
api.get('/zones/vod.json/' + id + '/customdomains.json, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomains": [
            {
                "bucket_id": "97183",
                "custom_domain": "cdn.somenewdomain3.com",
                "id": "79191",
                "type": "vod-rtmp"
            }
        ],
        "total": 1
    }
}

Create Custom Domain

Adds a new custom domain to {zone_id}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- custom_domain | - | required
length: 1-255 chars, valid::custom_domain, !valid::full_domain | A valid custom domain | type | - | Applies only to Vod Zones and must be either 'vod-rtmp','vod-pseudo', 'vod-direct', or 'vod-ftp' | The type of custom domain being created |

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The valid custom domain |

Code Samples

id = '97794'
params = {"custom_domain"=>"cdn.somedomain39.com","type"=>"vod-rtmp"}
api.post('/zones/vod/'+id+'/customdomains.json', params)
id = '96187'
params = {"custom_domain":"cdn.somedomain16.com","type":"vod-rtmp"}
api.post('/zones/vod/'+id+'/customdomains.json', params)
$id = '97183';
$params = array("custom_domain"=>"cdn.somedomain2.com","type"=>"vod-rtmp");
$api->post('/zones/vod/'.$id.'/customdomains.json', $params);
var id = '97183'
api.post('/zones/vod/' + id + '/customdomains.json', { custom_domain: 'cdn.somedomain2.com', type: 'vod-rtmp' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 201,
    "data": {
        "customdomain": {
            "bucket_id": "97183",
            "custom_domain": "cdn.somedomain2.com",
            "id": 79284,
            "type": "vod-rtmp"
        }
    }
}

Get Custom Domain

Gets a custom domain specified by the {zone_id} and {customdomain_id} parameters

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The valid custom domain |

Code Samples

zoneId = '97794'
domainId = '79748'
api.get('/zones/vod/'+zoneId+'/customdomains.json/'+domainId)
zoneId = '96187'
domainId = '79321'
api.get('/zones/vod/'+zoneId+'/customdomains.json/'+domainId)
$zoneId = '97183';
$domainId = '79191';
$api->get('/zones/vod/'.$zoneId.'/customdomains.json/'.$domainId);
var zoneId = '97183'
var domainId = '79191'
api.get('/zones/vod/' + zoneId + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomain": {
            "bucket_id": "97183",
            "custom_domain": "cdn.somenewdomain3.com",
            "id": "79191",
            "type": "vod-rtmp"
        }
    }
}

Update Custom Domain

Updates a custom domain specified by the id parameter

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- custom_domain | - | required
length: 1-255 chars, valid::custom_domain, !valid::full_domain | A new valid custom domain |

Response Parameters

Parameter | Description | --- | --- | --- id | The id of the custom domain | bucket_id | The id of the zone the custom domain belongs to | custom_domain | The new valid custom domain |

Code Samples

zoneId = '97794'
domainId = '79748'
params = {"custom_domain"=>"cdn.somenewdomain49.com"}
api.put('/zones/vod/'+zoneId+'/customdomains.json/'+domainId,params)
zoneId = '96187'
domainId = '79321'
params = {"custom_domain":"cdn.somenewdomain401.com"}
api.put('/zones/vod/'+zoneId+'/customdomains.json/'+domainId,params=params)
$zoneId = '97183';
$domainId = '79191';
$params = array("custom_domain"=>"cdn.somenewdomain3.com");
$api->put('/zones/vod/'.$zoneId.'/customdomains.json/'.$domainId, $params);
var zoneId = '97183'
var domainId = '79191'
api.put('/zones/vod/' + zoneId + '/customdomains.json/' + domainId, { custom_domain: 'cdn.somenewdomain3.com' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "customdomain": {
            "bucket_id": "97183",
            "custom_domain": "cdn.somenewdomain42.com",
            "id": "79284",
            "type": "vod-rtmp"
        }
    }
}

Delete Custom Domain

Deletes a custom domain specified by the {zone_id} and {customdomain_id} parameters

Code Samples

zoneId = '97794'
domainId = '79748'
api.delete('/zones/vod/'+zoneId+'/customdomains.json/'+domainId)
zoneId = '96187'
domainId = '79321'
api.delete('/zones/vod/'+zoneId+'/customdomains.json/'+domainId)
$zoneId = '97183';
$domainId = '79191';
$api->delete('/zones/vod/'.$zoneId.'/customdomains.json/'.$domainId);
var zoneId = '97183'
var domainId = '79191'
api.del('/zones/vod/' + zoneId + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Live Zone API

List Live Zones

Returns a list of all live zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- id | Live Zone ID | name | Live Zone name | label | The zone's description | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

api.get('/zones/live.json')
api.get('/zones/live.json')
$api->get('/zones/live.json');
api.get('/zones/live.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 2,
        "livezones": [
            {
                "cdn_url": "newlivezone.alias.netdna-cdn.com",
                "creation_date": "2013-05-16 16:23:49",
                "id": "96193",
                "inactive": "0",
                "label": null,
                "locked": "0",
                "name": "newlivezone",
                "pub_url": "publish.newlivezone.alias.netdna-cdn.com/live/96193",
                "server_id": "3",
                "suspend": "0",
                "tmp_url": "newlivezone.alias.netdna-cdn.com",
                "type": "5",
                "view_url": "newlivezone.alias.netdna-cdn.com/live/96193"
            },
            {
                "cdn_url": "newlivezone3.alias.netdna-cdn.com",
                "creation_date": "2013-05-23 21:50:00",
                "id": "97185",
                "inactive": "0",
                "label": "Some other description",
                "locked": "0",
                "name": "newlivezone3",
                "pub_url": "publish.newlivezone3.alias.netdna-cdn.com/live/97185",
                "server_id": "3",
                "suspend": "0",
                "tmp_url": "newlivezone3.alias.netdna-cdn.com",
                "type": "5",
                "view_url": "newlivezone3.alias.netdna-cdn.com/live/97185"
            }
        ],
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "total": 2
    }
}

Create Live Zone

Creates a new live zone

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- name | - | required
length: 3-30 chars; only letters, digits, and dash (-)accepted | Your desired zone name | password | - | required
length: 5-30 chars | Your desired password | label | - | length: 1-255 chars | Something that describes your zone |

Response Parameters

Parameter | Description | --- | --- | --- id | Live Zone ID | name | Live Zone name | label | The zone's description | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

params = {"name"=>"newLiveZone99","password"=>"password"}
api.post('/zones/live.json',params)
params = {"name":"newliveZone7","password":"password"}
api.post('/zones/live.json',data=params)
$params = array("name"=>"newLiveZone3","password"=>"password");
$api->post('/zones/live.json', $params);
api.post('/zones/live.json',  { name: 'newLiveZone3', password: 'password' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 201,
    "data": {
        "livezone": {
            "cdn_url": "newlivezone4.alias.netdna-cdn.com",
            "creation_date": "2013-05-24 17:01:30",
            "id": 97323,
            "inactive": 0,
            "label": null,
            "locked": 0,
            "name": "newlivezone4",
            "pub_url": "publish.newlivezone4.alias.netdna-cdn.com/live/97323",
            "server_id": 3,
            "suspend": 0,
            "tmp_url": "newlivezone4.alias.netdna-cdn.com",
            "type": 5,
            "view_url": "newlivezone4.alias.netdna-cdn.com/live/97323"
        }
    }
}

Get Live Zones Count

Counts all live zones on the specified account

Response Parameters

Parameter | Description | --- | --- | --- count | The number of live zones on the specified account |

Code Samples

api.get('/zones/live.json/count')
api.get('/zones/live.json/count')
$api->get('/zones/live.json/count');
api.get('/zones.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "count": "4"
    }
}

Get Live Zone

Gets a live zone specified by the {zone_id} parameter

Response Parameters

Parameter | Description | --- | --- | --- id | Live Zone ID | name | Live Zone name | label | The zone's description | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

id = '97795'
api.get('/zones/live.json/'+id)
id = '96193'
api.get('/zones/live.json/'+id)
$id = '97185';
$api->get('/zones/live.json/'.$id);
var id = '97185'
api.get('/zones/live.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "livezone": {
            "cdn_url": "newlivezone3.alias.netdna-cdn.com",
            "creation_date": "2013-05-23 21:50:00",
            "id": "97185",
            "inactive": "0",
            "label": "Some other description",
            "locked": "0",
            "name": "newlivezone3",
            "pub_url": "publish.newlivezone3.alias.netdna-cdn.com/live/97185",
            "server_id": "3",
            "suspend": "0",
            "tmp_url": "newlivezone3.alias.netdna-cdn.com",
            "type": "5",
            "view_url": "newlivezone3.alias.netdna-cdn.com/live/97185"
        }
    }
}

Update Live Zone

Updates a live zone specified by the {zone_id} parameter

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- password | - | length: 5-30 chars | Your desired password | token | - | length: 1-64 chars | The token value (shared secret) for secure streaming | label | - | length: 1-255 chars | Something that describes your zone |

Response Parameters

Parameter | Description | --- | --- | --- id | Live Zone ID | name | Live Zone name | label | The zone's description | suspend | Flag denoting if the zone has been suspended | locked | Flag denoting if the zone has been locked | inactive | Flag denoting if the zone has been deleted | creation_date | Date Created |

Code Samples

id = '96193'
params = {"label"=>"Some other description"}
api.put('/zones/live.json/'+id,params)
id = '96193'
params = {"label":"Some other description"}
api.put('/zones/live.json/'+id,params=params)
$id = '97185';
$params =  array("label"=>"Some other description");
$api->put('/zones/live.json/'.$id,$params);
var id = '97185'
api.put('/zones/live.json/' + id, { label: 'Some other description' }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "livezone": {
            "cdn_url": "newlivezone3.alias.netdna-cdn.com",
            "creation_date": "2013-05-23 21:50:00",
            "id": "97185",
            "inactive": "0",
            "label": "Some other description",
            "locked": "0",
            "name": "newlivezone3",
            "pub_url": "publish.newlivezone3.alias.netdna-cdn.com/live/97185",
            "server_id": "3",
            "suspend": "0",
            "tmp_url": "newlivezone3.alias.netdna-cdn.com",
            "type": "5",
            "view_url": "newlivezone3.alias.netdna-cdn.com/live/97185"
        }
    }
}

Delete Live Zone

Deletes a live zone specified by the {zone_id} parameter

Code Samples

id = '97795'
api.delete('/zones/live.json/'+id)
id = '96193'
api.delete('/zones/live.json/'+id)
$id = '97185';
$api->delete('/zones/live.json/'.$id);
var id = '97185'
api.del('/zones/live.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Enable Live Zone

Enables a live zone specified by the {zone_id} parameter

Code Samples

id = '97795'
api.put('/zones/live/'+id+'/enable.json')
id = '96193'
api.put('/zones/live/'+id+'/enable.json')
$id = '96061';
$api->put('/zones/live/'.$id.'/enable.json');
var id = '96061'
api.put('/zones/live/' + id + '/enable.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Disable Live Zone

Disables a live zone specified by the {zone_id} parameter

Code Samples

id = '97795'
api.put('/zones/live/'+id+'/disable.json')
id = '96193'
api.put('/zones/live/'+id+'/disable.json')
$id = '96061';
api->put('/zones/live/'.$id.'/disable.json');
var id = '96061'
api.put('/zones/live/' + id + '/disable.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200
}

Zones SSL API

Get Zone's SSL Information

Get the SSL certificate for the specified {zone_type} and {zone_id}.

Code Samples

id = '96061'
type = 'pull'
api.get('/zones/'+type+'/'+id+'/ssl.json')
id = '96061'
type = 'pull'
api.get('/zones/'+type+'/'+id+'/ssl.json')
$id = '96061';
$type = 'pull';
$api->get('/zones/'.$type.'/'.$id.'/ssl.json');
var id = '96061'
var type = 'pull'
api.get('/zones/' + type + '/' + id + '/ssl.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":201,
	"data":{
		"ssl":{
			"id":1459,
			"ssl_crt":"-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n",
			"ssl_key":"-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----",
			"ssl_cabundle":null,
			"date_expiration":"2014-01-24",
			"anycast_ip_id":null,
			"wildcard":1,
			"domain":"*.idcreator.com"
		}
	}
}

Install SSL on Zone

Upload an SSL certificate for the specified {zone_type} and {zone_id}.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- ssl_crt | - | required
| The SSL certificate you are installing. | ssl_key | - | required
| The key for the SSL certificate you are installing. | ssl_cabundle | - | The CA Bundle for the SSL Certificate you are installing. |

Response Parameters

Parameter | Description | --- | --- | --- id | The SSL Certificate ID. | ssl_crt | The SSL certificate. | ssl_key | The SSL Private Key. | ssl_cabundle | The CA Bundle for the cert. | domain | The domain applicable to this certificate. | date_expiration | The date of expiration for the certificate. | wildcard | Flag to signify whether this is a wildcard certificate. |

Code Samples

id = '96061'
type = 'pull'
ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n"
ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----"
params = {"ssl_crt"=> ssl_crt,"ssl_key"=> ssl_key}
api.post('/zones/'+type+'/'+id+'/ssl.json',params)
id = '96061'
type = 'pull'
ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n"
ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----"
params = {"ssl_crt": ssl_crt,"ssl_key": ssl_key}
api.post('/zones/'+type+'/'+id+'/ssl.json',params)
$id = '96061';
$type = 'pull';
$ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n";
$ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----";
$params = array("ssl_crt"=>$ssl_crt,"ssl_key"=>$ssl_key);
$api->post('/zones/'.$type.'/'.$id.'/ssl.json',$params);
var id = '96061'
var type = 'pull'
var ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n"
var ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----"
api.post('/zones/' + type + '/' + id + '/ssl.json', { ssl_crt: ssl_crt, ssl_key: ssl_key }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":201,
	"data":{
		"ssl":{
			"id":1459,
			"ssl_crt":"-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n",
			"ssl_key":"-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----",
			"ssl_cabundle":null,
			"date_expiration":"2014-01-24",
			"anycast_ip_id":null,
			"wildcard":1,
			"domain":"*.idcreator.com"
		}
	}
}

Update Zone's SSL Information

Update the SSL certificate for the specified {zone_type} and {zone_id}.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- ssl_crt | - | required
| The SSL certificate you are installing. | ssl_key | - | required
| The key for the SSL certificate you are installing. | ssl_cabundle | - | The CABundle for the SSL Certificate you are installing. |

Response Parameters

Parameter | Description | --- | --- | --- id | The SSL Certificate ID. | ssl_crt | The SSL certificate. | ssl_key | The SSL Private Key. | ssl_cabundle | The CA Bundle for the cert. | domain | The domain applicable to this certificate. | date_expiration | The date of expiration for the certificate. | wildcard | Flag to signify whether this is a wildcard certificate. |

Code Samples

id = '96061'
type = 'pull'
ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n"
ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----"
params = {"ssl_crt"=> ssl_crt,"ssl_key"=> ssl_key}
api.put('/zones/'+type+'/'+id+'/ssl.json',params)
id = '96061'
type = 'pull'
ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n"
ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----"
params = {"ssl_crt": ssl_crt,"ssl_key": ssl_key}
api.put('/zones/'+type+'/'+id+'/ssl.json',params)
$id = '96061';
$type = 'pull';
$ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n";
$ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----";
$ssl_key = "
$params = array("ssl_crt"=>$ssl_crt,"ssl_key"=>$ssl_key);
$api->put('/zones/'.$type.'/'.$id.'/ssl.json',$params);
var id = '96061'
var type = 'pull'
var ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n"
var ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----"
api.put('/zones/' + type + '/' + id + '/ssl.json', { ssl_crt: ssl_crt, ssl_key: ssl_key }, function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":201,
	"data":{
		"ssl":{
			"id":1459,
			"ssl_crt":"-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n",
			"ssl_key":"-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----",
			"ssl_cabundle":null,
			"date_expiration":"2014-01-24",
			"anycast_ip_id":null,
			"wildcard":1,
			"domain":"*.idcreator.com"
		}
	}
}

Remove Zone's SSL Information

Remove the SSL certificate for the specified {zone_type} and {zone_id}.

Code Samples

id = '96061'
type = 'pull'
api.delete('/zones/'+type+'/'+id+'/ssl.json')
id = '96061'
type = 'pull'
api.delete('/zones/'+type+'/'+id+'/ssl.json')
$id = '96061';
$type = 'pull';
$api->delete('/zones/'.$type.'/'.$id.'/ssl.json');
var id = '96061'
var type = 'pull'
api.delete('/zones/' + type + '/' + id + '/ssl.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
	"code":200,
	"data":{
		"zone":{
			"id":"90652",
			"name":"newpullzonec5",
			"username":"username",
			"company_id":"1234",
			"url":"http:\/\/someplace.net",
			"port":"80",
			"ip":"123.0.0.49",
			"vhost":"someplace.net",
			"type":"2",
			"compress":"0",
			"backend_compress":"0",
			"queries":"1",
			"max_cache_size":"50000",
			"suspend":"0",
			"cache_valid":"1d",
			"content_encoding":"1",
			"label":"",
			"inactive":"0",
			"valid_referers":null,
			"key_zone_size":"50m",
			"expires":null,
			"disallow_robots":"0",
			"disallow_robots_txt":null,
			"canonical_link_headers":"0",
			"content_disposition":"0",
			"custom_domain_limit":"7",
			"locked":"0",
			"server_id":"123",
			"ssl":0,
			"sslshared":"0",
			"creation_date":"2013-07-22 19:00:54",
			"dsa_ip":null,
			"geo_enabled":"0",
			"set_host_header":null,
			"ssl_id":0,
			"dns_check":"1",
			"hit_bandwidth_by_dir":"0",
			"hit_bandwidth_by_custom_domain":"0",
			"hit_bandwidth_by_file_name_status_code":"0",
			"cache_version":"0",
			"ignore_setcookie_header":"0",
			"hide_setcookie_header":"0",
			"ignore_cache_control":"0",
			"use_stale":"0",
			"proxy_cache_lock":"0",
			"pseudo_streaming":"0",
			"secret":null,
			"upstream_enabled":"0",
			"cdn_url":"newpullzonec5.username.netdna-cdn.com",
			"tmp_url":"newpullzonec5.nycacorp.netdna-cdn.com"
		}
	}
}

Zones Upstream API

Get Upstream information for the current zone

Get the upstream information for the specified {zone_id}.

Code Samples

type = 'pull'
id = '96061'
api.post('/zones/'+type+'/'+id+'/upstream.json')
type = 'pull'
id = '96061'
api.post('/zones/'+type+'/'+id+'/upstream.json')
$type = 'pull';
$id = '96061';
$api->post('/zones/'.$type.'/'.$id.'/upstream.json');
var type = 'pull'
var id = '96061'
api.post('/zones/' + type + '/' + id + '/upstream.json', function(err, response) {
  console.log('err', err, 'response', response)
})

  

Enable Upstream on Zone

Create and enable Upstream for a specific {zone_id}.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- server_url | - | required
| The server url or ip to provide the streaming resources port | - | required
| The port where server is to be called

Response Parameters

Parameter | Description | --- | --- | --- id | The Upstream ID. bucket_id | The bucket_id it belongs to server_url | The server url or ip port | The port it uses to call the server

Code Samples

type = 'pull'
id = '96061'
params = {"server_url"=> "http=>//cdn.somedomain.com","server"=> "http=>//cdn.somedomain.com","port"=> "80"}
api.post('/zones/'+type+'/'+id+'/upstream.json')
type = 'pull'
id = '96061'
params = {"server_url": "http://cdn.somedomain.com","server": "http://cdn.somedomain.com","port": "80"}
api.post('/zones/'+type+'/'+id+'/upstream.json')
$type = 'pull';
$id = '96061';
$params = array("server_url"=>"http://cdn.somedomain.com","server"=>"http://cdn.somedomain.com","port"=>"80");
$api->post('/zones/'.$type.'/'.$id.'/upstream.json');
var type = 'pull'
var id = '96061'
api.post('/zones/' + type + '/' + id + '/upstream.json', { server_url: 'http://cdn.somedomain.com', server: 'http://cdn.somedomain.com', port: '80' }, function(err, response) {
  console.log('err', err, 'response', response)
})

  

Update Zone's Upstream Information

Update the Upstream information for the specified {zone_id}.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- upstream_id | - | required
| The Upstream Information you're modifying. server_url | - | required
| The server url or ip port | - | required
| The port it uses to call the server

Response Parameters

Parameter | Description | --- | --- | --- id | The Upstream ID. bucket_id | The bucket_id it belongs to server_url | The server url or ip port | The port it uses to call the server

Code Samples

type = 'pull'
id = '96061'
params = {"upsream_id"=> "93013","server_url"=> "http=>//somedomain.com","port"=> "80"}
api.put('/zones/'+type+'/'+id+'/upstream.json')
type = 'pull'
id = '96061'
params = {"upsream_id": "93013","server_url": "http://somedomain.net","port": "80"}
api.put('/zones/'+type+'/'+id+'/upstream.json')
$type = 'pull';
$id = '96061';
$params = array("upstream_id"=>"93013","server_url"=>"http://somedomain.net","port"=>"80");
$api->put('/zones/'.$type.'/'.$id.'/upstream.json');
var type = 'pull'
var id = '96061'
api.put('/zones/' + type + '/' + id + '/upstream.json', { upstream_id: '93013', server_url: 'http://somedomain.net', port: '80' }, function(err, response) {
  console.log('err', err, 'response', response)
})

  

Remove Zone's Upstream Information

Remove the Upstream Information for the specified {zone_id}.

Code Samples

type = 'pull'
id = '96061'
api.delete('/zones/'+type+'/'+id+'/upstream.json')
type = 'pull'
id = '96061'
api.delete('/zones/'+type+'/'+id+'/upstream.json')
$type = 'pull';
$id = '96061';
$api->delete('/zones/'.$type.'/'.$id.'/upstream.json');
var type = 'pull'
var id = '96061'
api.del('/zones/' + type + '/' + id + '/upstream.json', function(err, response) {
  console.log('err', err, 'response', response)
})

  

Reports by Zone API

List Zone Stats

Gets all zone usage statistics optionally broken up by {report_type}. If no {report_type} is given the request will return the total usage for the zones.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- size | The amount of bytes transferred | hit | The number of times files were requested | noncache_hit | The number of times a requested file was not in cache | cache_hit | The number of times a requested file was already cached | timestamp | The timestamp for the corresponding {report_type}. |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/stats.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/stats.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/stats.json/'.$reportType);
var reportType = '' //Vaild input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/stats.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "stats": {
            "cache_hit": "0",
            "hit": "20",
            "noncache_hit": "20",
            "size": "0"
        },
        "total": "1"
    }
}

List Stats per Zone

Gets the {zone_id} usage statistics optionally broken up by {report_type}. If no {report_type} is given the request will return the total usage for the zones.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- size | The amount of bytes transferred | hit | The number of times files were requested | noncache_hit | The number of times a requested file was not in cache | cache_hit | The number of times a requested file was already cached | timestamp | The timestamp for the corresponding {report_type}. |

Code Samples

id = '96061'
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/'+id+'/stats.json'+reportType)
id = '96061'
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/'+id+'/stats.json'+reportType)
$id = '96061';
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/'.$id.'/stats.json/'.$reportType);
var id = '96061'
var reportType = '' //Vaild input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/' + id + '/stats.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "stats": {
            "cache_hit": null,
            "hit": null,
            "noncache_hit": null,
            "size": null
        },
        "summary": {
            "cache_hit": null,
            "hit": null,
            "noncache_hit": null,
            "size": null
        },
        "total": "0"
    }
}

Reports by Location API

List Nodes

Gets a list of all active nodes (locations)

Response Parameters

Parameter | Description | --- | --- | --- id | Node Id | name | Node 3 letter code | description | Full node name |

Code Samples

api.get('/reports/nodes.json')
api.get('/reports/nodes.json')
$api->get('/reports/nodes.json');
api.get('/reports/nodes.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "nodes": [
            {
                "description": "Los Angeles",
                "id": "1",
                "name": "lax"
            },
            {
                "description": "New York",
                "id": "3",
                "name": "jfk"
            },
            {
                "description": "Seattle",
                "id": "2",
                "name": "sea"
            },
            {
                "description": "Atlanta",
                "id": "4",
                "name": "atl"
            },
            {
                "description": "Amsterdam",
                "id": "5",
                "name": "ams"
            },
            {
                "description": "Dallas",
                "id": "6",
                "name": "dal"
            },
            {
                "description": "Chicago",
                "id": "8",
                "name": "chi"
            },
            {
                "description": "Virginia",
                "id": "9",
                "name": "vir"
            },
            {
                "description": "Miami",
                "id": "7",
                "name": "mia"
            },
            {
                "description": "London",
                "id": "12",
                "name": "lhr"
            },
            {
                "description": "San Francisco",
                "id": "13",
                "name": "sfo"
            },
            {
                "description": "Los Angeles 3",
                "id": "30",
                "name": "lax"
            }
        ]
    }
}

List Nodes by Zone

Gets a list of all active nodes (locations) specified by the {zone_id} parameter

Response Parameters

Parameter | Description | --- | --- | --- id | Node Id | name | Node 3 letter code | description | Full node name |

Code Samples

id = '96061'
api.get('/reports/'+id+'/nodes.json')
id = '96061'
api.get('/reports/'+id+'/nodes.json')
$id = '96061';
$api->get('/reports/'.$id.'/nodes.json');
var id = '96061'
api.get('/reports/' + id + '/nodes.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "nodes": [
            {
                "description": "Dallas",
                "id": "6",
                "name": "dal"
            },
            {
                "description": "Los Angeles",
                "id": "1",
                "name": "lax"
            },
            {
                "description": "Seattle",
                "id": "2",
                "name": "sea"
            },
            {
                "description": "New York",
                "id": "3",
                "name": "jfk"
            },
            {
                "description": "Atlanta",
                "id": "4",
                "name": "atl"
            },
            {
                "description": "Amsterdam",
                "id": "5",
                "name": "ams"
            },
            {
                "description": "Chicago",
                "id": "8",
                "name": "chi"
            },
            {
                "description": "Virginia",
                "id": "9",
                "name": "vir"
            },
            {
                "description": "London",
                "id": "12",
                "name": "lhr"
            },
            {
                "description": "San Francisco",
                "id": "13",
                "name": "sfo"
            }
        ]
    }
}

List Zone Node Stats by Report Type

Get usage statistics broken up by nodes and optionally {report_type}. If no {report_type} is given the request will return the total usage broken up by node.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-31) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-31) | End date |

Response Parameters

Parameter | Description | --- | --- | --- pop_id | Node Id | pop_name | Node 3 letter code. Only returned when {report_type} is notempty. | pop_description | Full node name. Only returned when {report_type} is notempty. | size | The amount of bytes transferred | hit | The number of times files were requested | noncache_hit | The number of times a requested file was not in cache | cache_hit | The number of times a requested file was already cached | timestamp | A timestamp corresponding to {report_type}. Only returned when{report_type} is not empty. |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/nodes.json/stats'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/nodes.json/stats'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/nodes.json/stats/'.$reportType);
var reportType = '' //Vaild input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/nodes.json/stats/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "stats": [
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "Los Angeles",
                "pop_id": "1",
                "pop_name": "lax",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "Atlanta",
                "pop_id": "4",
                "pop_name": "atl",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "Chicago",
                "pop_id": "8",
                "pop_name": "chi",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "San Francisco",
                "pop_id": "13",
                "pop_name": "sfo",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "Seattle",
                "pop_id": "2",
                "pop_name": "sea",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "Amsterdam",
                "pop_id": "5",
                "pop_name": "ams",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "Virginia",
                "pop_id": "9",
                "pop_name": "vir",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "New York",
                "pop_id": "3",
                "pop_name": "jfk",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "Dallas",
                "pop_id": "6",
                "pop_name": "dal",
                "size": "0"
            },
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "pop_description": "London",
                "pop_id": "12",
                "pop_name": "lhr",
                "size": "0"
            }
        ],
        "summary": {
            "cache_hit": "0",
            "hit": "20",
            "noncache_hit": "20",
            "size": "0"
        },
        "total": "1"
    }
}

List Node Stats by Zone and Report Type

Get usage statistics for a particular {zone_id} broken up by nodes and optionally {report_type}. If no {report_type} is given the request will return the total usage broken up by node.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- pop_id | Node Id | pop_name | Node 3 letter code. Only returned when {report_type} is notempty. | pop_description | Full node name. Only returned when {report_type} is notempty. | size | The amount of bytes transferred | hit | The number of times files were requested | noncache_hit | The number of times a requested file was not in cache | cache_hit | The number of times a requested file was already cached | timestamp | A timestamp corresponding to {report_type}. Only returned when{report_type} is not empty. |

Code Samples

id = '96061'
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/'+id+'/nodes.json/stats'+reportType)
id = '96061'
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/'+id+'/nodes.json/stats'+reportType)
$id = '96061';
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/'.$id.'/nodes.json/stats/'.$reportType);
var id = '96061'
var reportType = '' //Vaild input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/' + id + '/nodes.json/stats/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "stats": [],
        "summary": {
            "cache_hit": null,
            "hit": null,
            "noncache_hit": null,
            "size": null
        },
        "total": null
    }
}

Get Zone Node

Gets the node information for the specified {node_id}

Response Parameters

Parameter | Description | --- | --- | --- id | Node Id | name | Node 3 letter code | description | Full node name |

Code Samples

id = '1'
api.get('/reports/nodes.json/'+id)
id = '1'
api.get('/reports/nodes.json/'+id)
$id = '1';
$api->get('/reports/nodes.json/'.$id);
var id = '1'
api.get('/reports/nodes.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "node": {
            "description": "Los Angeles",
            "id": "1",
            "name": "lax"
        }
    }
}

Get Node by Zone

Gets the node information for the specified {node_id} and {zone_id}

Response Parameters

Parameter | Description | --- | --- | --- id | Node Id | name | Node 3 letter code | description | Full node name |

Code Samples

zoneId = '96061'
nodeId = '1'
api.get('/reports/'+zoneId+'/nodes.json/'+nodeId)
zoneId = '96061'
nodeId = '1'
api.get('/reports/'+zoneId+'/nodes.json/'+nodeId)
$zoneId = '96061';
$nodeId = '1';
$api->get('/reports/'.$zoneId.'/nodes.json/'.$nodeId);
var zoneId = '96061'
var nodeId = '1'
api.get('/reports/' + zoneId + '/nodes.json/' + nodeId, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "stats": [],
        "summary": {
            "cache_hit": null,
            "hit": null,
            "noncache_hit": null,
            "size": null
        },
        "total": null
    }
}

Get Zone Node Stats by Report Type

Get usage statistics for a particular {node_id} optionally broken up by {report_type}. If no {report_type} is given the request will return the total usage for the node.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date. | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date. |

Response Parameters

Parameter | Description | --- | --- | --- size | The amount of bytes transferred | hit | The number of times files were requested | noncache_hit | The number of times a requested file was not in cache | cache_hit | The number of times a requested file was already cached | timestamp | A timestamp corresponding to {report_type}. Only returned when{report_type} is not empty. |

Code Samples

id = '1'
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/nodes.json/'+id+'/stats'+reportType)
id = '1'
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/nodes.json/'+id+'/stats'+reportType)
$id = '1';
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/nodes.json/'.$id.'/stats/'.$reportType);
var id = '1'
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/nodes.json/' + id + '/stats/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "stats": [
            {
                "cache_hit": "0",
                "hit": "2",
                "noncache_hit": "2",
                "size": "0"
            }
        ],
        "total": "1"
    }
}

Get Node Stats by Zone and Report Type

Get usage statistics for a particular {node_id} and {zone_id}, optionally broken up by {report_type}. If no {report_type} is given the request will return the total usage for the node.

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- size | The amount of bytes transferred | hit | The number of times files were requested | noncache_hit | The number of times a requested file was not in cache | cache_hit | The number of times a requested file was already cached | timestamp | A timestamp corresponding to {report_type}. Only returned when{report_type} is not empty. |

Code Samples

zoneId='96061'
nodeId='1'
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/'+zoneId+'/nodes.json/'+nodeId+'/stats'+reportType)
zoneId='96061'
nodeId='1'
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/'+zoneId+'/nodes.json/'+nodeId+'/stats'+reportType)
$zoneId='96061';
$nodeId='1';
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/'.$zoneId.'/nodes.json/'.$nodeId.'/stats/'.$reportType);
var zoneId = '96061'
var nodeId = '1'
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/' + zoneId + '/nodes.json/' + nodeId + '/stats/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "stats": [
            {
                "cache_hit": null,
                "hit": null,
                "noncache_hit": null,
                "size": null
            }
        ],
        "total": "0"
    }
}

Reports by Popular Files API

List Popular Files

Gets the most popularly requested files for your account, grouped into daily statistics

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01). | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01). | End date |

Response Parameters

Parameter | Description | --- | --- | --- bucket_id | The Zone ID for the popular file | uri | The URI for the requested popular file | hit | The number of times the file was requested | size | The amount of bytes transferred for the given file | vhost | The CDN URL for the corresponding zone | timestamp | The amount of bytes transferred |

Code Samples

api.get('/reports/popularfiles.json')
api.get('/reports/popularfiles.json')
$api->get('/reports/popularfiles.json');
api.get('/reports/popularfiles.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "popularfiles": [],
        "summary": {
            "hit": null,
            "size": null
        },
        "total": "0"
    }
}

List Popular Files By Zone Type

Gets the most popularly requested files for your account, filtered by {zone_type} and grouped into daily statistics

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- bucket_id | The Zone ID for the popular file | uri | The URI for the requested popular file | hit | The number of times the file was requested | size | The amount of bytes transferred for the given file | vhost | The CDN URL for the corresponding zone | timestamp | The amount of bytes transferred |

Code Samples

type='pull'
api.get('/reports/'+type+'/popularfiles.json')
type='pull'
api.get('/reports/'+type+'/popularfiles.json')
$type='pull';
$api->get('/reports/'.$type.'/popularfiles.json');
var type = 'pull'
api.get('/reports/' + type + '/popularfiles.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "popularfiles": [],
        "summary": {
            "hit": null,
            "size": null
        },
        "total": "0"
    }
}

Reports by Status Codes API

List Status Code Responses

Gets HTTP status code response statistics for your account

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- status_code | The HTTP status code for the response | hit | The number of responses with this status code | definition | The definition for the status code |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statuscodes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statuscodes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/statuscodes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statuscodes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "statuscodes": [
            {
                "definition": "Not Found",
                "hit": "20",
                "status_code": "404"
            }
        ],
        "summary": {
            "hit": "20"
        },
        "total": "1"
    }
}

List Status Code Responses by Zone Id

Gets HTTP status code response statistics for a specific {zone_id}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- status_code | The HTTP status code for the response | hit | The number of responses with this status code | definition | The definition for the status code |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/statuscodes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/statuscodes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$id = '96061';
$api->get('/reports/'.$id.'/statuscodes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var id = '96061'
api.get('/reports/' + id + '/statuscodes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "statuscodes": [],
        "summary": {
            "hit": null
        },
        "total": "0"
    }
}

List Status Codes by Zone Type

Gets HTTP status code response statistics for a specific {zone_type}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- status_code | The HTTP status code for the response | hit | The number of responses with this status code | definition | The definition for the status code |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
api.get('/reports/'+zoneType+'/statuscodes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
api.get('/reports/'+zoneType+'/statuscodes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$zoneType = 'pull';
$api->get('/reports/'.$zoneType.'/statuscodes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var zoneType = 'pull'
api.get('/reports/' + zoneType + '/statuscodes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "statuscodes": [
            {
                "definition": "Not Found",
                "hit": "20",
                "status_code": "404"
            }
        ],
        "summary": {
            "hit": "20"
        },
        "total": "1"
    }
}

List Status Codes by Zone Id

Gets HTTP status code response statistics for a specific {zone_type} and {zone_id}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- status_code | The HTTP status code for the response | hit | The number of responses with this status code | definition | The definition for the status code |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/statuscodes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/statuscodes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$zoneType = 'pull';
$id = '96061';
$api->get('/reports/'.$zoneType.'/'.$id.'/statuscodes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var zoneType = 'pull'
var id = '96061'
api.get('/reports/' + zoneType + '/' + id + '/statuscodes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "statuscodes": [],
        "summary": {
            "hit": null
        },
        "total": "0"
    }
}

Reports by File Types API

List File Types

Gets file type statistics for your account

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- file_type | The file type requested | hit | The number of times a file of this type has been requested |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/filetypes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/filetypes.json'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/filetypes.json', function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 1,
        "filetypes": [
            {
                "file_type": "txt",
                "hit": "20"
            }
        ],
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "summary": {
            "hit": "20"
        },
        "total": "1"
    }
}

List File Types by Zone Id

Gets file type statistics for a specific {zone_id}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d e.g. 2012-01-01 | Start date | date_to | now() | Y-m-d e.g. 2012-01-01 | End date |

Response Parameters

Parameter | Description | --- | --- | --- file_type | The file type requested | hit | The number of times a file of this type has been requested |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/filetypes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$id = '96061';
$api->get('/reports/'.$id.'/filetypes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var id = '96061'
api.get('/reports/' + id + '/filetypes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "filetypes": [],
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "summary": {
            "hit": null
        },
        "total": "0"
    }
}

List File Types by Zone Type

Gets file type statistics for a specific {zone_type}

Response Parameters

Parameter | Description | --- | --- | --- file_type | The file type requested | hit | The number of times a file of this type has been requested |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
api.get('/reports/'+zoneType+'/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
api.get('/reports/'+zoneType+'/filetypes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$zoneType = 'pull';
$api->get('/reports/'.$zoneType.'/filetypes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var zoneType = 'pull'
api.get('/reports/' + zoneType + '/filetypes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 1,
        "filetypes": [
            {
                "file_type": "txt",
                "hit": "20"
            }
        ],
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "summary": {
            "hit": "20"
        },
        "total": "1"
    }
}

List File Types by Zone Id

Gets file type statistics for a specific {zone_type} and {zone_id}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- file_type | The file type requested | hit | The number of times a file of this type has been requested |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/filetypes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$zoneType = 'pull';
$id = '96061';
$api->get('/reports/'.$zoneType.'/'.$id.'/filetypes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var zoneType = 'pull'
var id = '96061'
api.get('/reports/' + zoneType + '/' + id + '/filetypes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "filetypes": [],
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "summary": {
            "hit": null
        },
        "total": "0"
    }
}

Reports by File Size Ranges API

List File Sizes

Gets request statistics for your account based on file size ranges

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- le_10k_hits | The number of requests for files <= 10KB | le_50k_hits | The number of requests for files <= 50KB | le_100k_hits | The number of requests for files <= 100KB | le_500k_hits | The number of requests for files <= 500KB | le_1m_hits | The number of requests for files <= 1MB | le_10m_hits | The number of requests for files <= 10MB | le_100m_hits | The number of requests for files <= 100MB | gt_100m_hits | The number of requests for files > 100MB |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/filesizes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/filesizes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/filesizes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "filesizes": [
            {
                "gt_100m_hit": "0",
                "le_100k_hit": "0",
                "le_100m_hit": "0",
                "le_10k_hit": "20",
                "le_10m_hit": "0",
                "le_1m_hit": "0",
                "le_500k_hit": "0",
                "le_50k_hit": "0"
            }
        ],
        "summary": {
            "hit": "20"
        }
    }
}

List File Sizes by Zone Id

Gets request statistics for the specified {zone_id} based on file size ranges

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d e.g. 2012-01-01 | Start date | date_to | now() | Y-m-d e.g. 2012-01-01 | End date |

Response Parameters

Parameter | Description | --- | --- | --- le_10k_hits | The number of requests for files <= 10KB | le_50k_hits | The number of requests for files <= 50KB | le_100k_hits | The number of requests for files <= 100KB | le_500k_hits | The number of requests for files <= 500KB | le_1m_hits | The number of requests for files <= 1MB | le_10m_hits | The number of requests for files <= 10MB | le_100m_hits | The number of requests for files <= 100MB | gt_100m_hits | The number of requests for files > 100MB |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/filesizes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/filesizes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$id = '96061';
$api->get('/reports/'.$id.'/filesizes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var id = '96061'
api.get('/reports/' + id + '/filesizes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "filesizes": [
            {
                "gt_100m_hit": null,
                "le_100k_hit": null,
                "le_100m_hit": null,
                "le_10k_hit": null,
                "le_10m_hit": null,
                "le_1m_hit": null,
                "le_500k_hit": null,
                "le_50k_hit": null
            }
        ],
        "summary": {
            "hit": null
        }
    }
}

List File Sizes by Zone Type

Gets request statistics for the specified {zone_type} based on file size ranges

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d e.g. 2012-01-01 | Start date | date_to | now() | Y-m-d e.g. 2012-01-01 | End date |

Response Parameters

Parameter | Description | --- | --- | --- le_10k_hits | The number of requests for files <= 10KB | le_50k_hits | The number of requests for files <= 50KB | le_100k_hits | The number of requests for files <= 100KB | le_500k_hits | The number of requests for files <= 500KB | le_1m_hits | The number of requests for files <= 1MB | le_10m_hits | The number of requests for files <= 10MB | le_100m_hits | The number of requests for files <= 100MB | gt_100m_hits | The number of requests for files > 100MB |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
api.get('/reports/'+zoneType+'/filesizes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
api.get('/reports/'+zoneType+'/filesizes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$zoneType = 'pull';
$api->get('/reports/'.$zoneType.'/filesizes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var zoneType = 'pull'
api.get('/reports/' + zoneType + '/filesizes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "filesizes": [
            {
                "gt_100m_hit": "0",
                "le_100k_hit": "0",
                "le_100m_hit": "0",
                "le_10k_hit": "20",
                "le_10m_hit": "0",
                "le_1m_hit": "0",
                "le_500k_hit": "0",
                "le_50k_hit": "0"
            }
        ],
        "summary": {
            "hit": "20"
        }
    }
}

List File Sizes by Zone Id

Gets request statistics for the specified {zone_type} and {zone_id} based on file size ranges

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- le_10k_hits | The number of requests for files <= 10KB | le_50k_hits | The number of requests for files <= 50KB | le_100k_hits | The number of requests for files <= 100KB | le_500k_hits | The number of requests for files <= 500KB | le_1m_hits | The number of requests for files <= 1MB | le_10m_hits | The number of requests for files <= 10MB | le_100m_hits | The number of requests for files <= 100MB | gt_100m_hits | The number of requests for files > 100MB |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/filesizes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/filesizes.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$zoneType = 'pull';
$id = '96061';
$api->get('/reports/'.$zoneType.'/'.$id.'/filesizes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var zoneType = 'pull'
var id = '96061'
api.get('/reports/' + zoneType + '/' + id + '/filesizes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "filesizes": [
            {
                "gt_100m_hit": null,
                "le_100k_hit": null,
                "le_100m_hit": null,
                "le_10k_hit": null,
                "le_10m_hit": null,
                "le_1m_hit": null,
                "le_500k_hit": null,
                "le_50k_hit": null
            }
        ],
        "summary": {
            "hit": null
        }
    }
}

Reports By Directory API

List Stats By Directory

Gets usage statistics by directory for your account. (This report has to be enabled by Sales).

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- bucket_id | The Zone ID for the top level directory | dir | The name of the directory | hit | The number of requests made to files within this directory | size | The amount of bytes transferred from within this directory |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statsbydir.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statsbydir.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/statsbydir.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statsbydir.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "statsbydir": [],
        "summary": {
            "hit": null,
            "size": null
        },
        "total": "0"
    }
}

List Stats By Directory and Zone Id

Gets usage statistics by directory for the specified {zone_id}. (This report has to be enabled by Sales).

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- bucket_id | The Zone ID for the top level directory | dir | The name of the directory | hit | The number of requests made to files within this directory | size | The amount of bytes transferred from within this directory |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/statsbydir.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/statsbydir.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$id = '96061';
$api->get('/reports/'.$id.'/statsbydir.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var id = '96061'
api.get('/reports/' + id + '/' + '/statsbydir.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "statsbydir": [],
        "summary": {
            "hit": null,
            "size": null
        },
        "total": "0"
    }
}

Reports By File Name API

List Stats By File Name

Gets usage statistics by file name for your account

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date | file_names | A JSON Encoded file names list | filter | Matching expression for file names | sort_by | Field to sort by | sort_dir | Directory to sort files by | page_size | - | The number of records returned in the result set |

Response Parameters

Parameter | Description | --- | --- | --- 200 | The amount of 200 hits | 206 | The amount of 206 hits | 2xx | The amount of 2xx hits | 3xx | The amount of 3xx hits | 404 | The amount of 404 hits | 4xx | The amount of 4xx hits | 5xx | The amount of 5xx hits | bucket_id | The Zone ID for the top level directory | file_name | URI | hit | The number of requests made to files within this directory | size | The amount of bytes transferred from within this directory | timestampf | Timestamp | vhost | CDN URL |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
clientId = ''
api.get('/clients/'+clientId+'/reports/statsbyfilename.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
clientId = ''	
api.get('/clients/'+clientId+'/reports/statsbyfilename.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$clientId = '';
$api->get('/clients/'.$clientId.'/reports/statsbyfilename.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var clientId = ''
api.get('/clients/' + clientId + '/reports/statsbyfilename.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "statsbyfilename": [
            {
                "200": "0",
                "206": "0",
                "2xx": "0",
                "3xx": "0",
                "404": "0",
                "4xx": "0",
                "5xx": "35036",
                "bucket_id": "21597",
                "file_name": "/",
                "hit": "35036",
                "size": "20110664",
                "timestampf": "2013",
                "vhost": "edge02.nycacorp.netdna-cdn.com"
            },
            {
                "200": "0",
                "206": "0",
                "2xx": "0",
                "3xx": "0",
                "404": "0",
                "4xx": "2",
                "5xx": "35032",
                "bucket_id": "21597",
                "file_name": "/favicon.ico",
                "hit": "35034",
                "size": "20108368",
                "timestampf": "2013",
                "vhost": "edge02.nycacorp.netdna-cdn.com"
            }
        ],
        "summary": {
            "200": "0",
            "206": "0",
            "2xx": "0",
            "3xx": "0",
            "404": "0",
            "4xx": "2",
            "5xx": "70068",
            "hit": "70070",
            "size": "40219032"
        },
        "total": "2"
    }
}

List Stats By File Name and Zone Id

Gets usage statistics by file name for the specified {zone_id}

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date | file_names | A JSON Encoded file names list | filter | Matching expression for file names | sort_by | Field to sort by | sort_dir | Directory to sort files by | page_size | - | The number of records returned in the result set |

Response Parameters

Parameter | Description | --- | --- | --- bucket_id | The Zone ID for the top level directory | hit | The number of requests made to files within this directory | size | The amount of bytes transferred from within this directory | 200 | The amount of 200 hits | 206 | The amount of 206 hits | 2xx | The amount of 2xx hits | 3xx | The amount of 3xx hits | 404 | The amount of 404 hits | 4xx | The amount of 4xx hits | 5xx | The amount of 5xx hits | timestampf | Timestamp |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = ''
clientId = ''
api.get('/clients/'+clientId+'/reports/'+id+'/statsbyfilename.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
id = ''
clientId = ''
api.get('/clients/'+clientId+'/reports/'+id+'/statsbyfilename.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$id = '96061';
$clientId = '';
$api->get('/clients/'.$clientId.'/reports/'.$id.'/statsbyfilename.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var id = '96061'
var clientId = ''
api.get('/clients/' + clientId + '/reports/' + id + '/statsbyfilename.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
Non functional

Reports By Custom Domain API

List Stats By Directory

Gets usage statistics by custom domain for your account. (This report has to be enabled by Sales).

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- bucket_id | The Zone ID for the custom domain | custom_domain_id | The ID of your custom domain | hit | The number of requests made to this custom domain | size | The amount of bytes transferred to/from this custom domain |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
clientId = ''
api.get('/clients/'+clientId+'/reports/statsbycustomdomain.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
clientId = ''
api.get('/clients/'+clientId+'/reports/statsbycustomdomain.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$clientId = '';
$api->get('clients/'.$clientId.'/reports/statsbycustomdomain.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var clientId = ''
api.get('/clients/' + clientId + '/reports/statsbycustomdomain.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 1,
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "statsbycustomdomain": [
            {
                "bucket_id": "21597",
                "custom_domain_id": "0",
                "hit": "70320",
                "size": "40362532",
                "vhost": "edge02.nycacorp.netdna-cdn.com"
            }
        ],
        "summary": {
            "hit": "70320",
            "size": "40362532"
        },
        "total": "1"
    }
}

List Stats By Custom Domain and Zone Id

Gets usage statistics by custom domain for the specified {zone_id}. (This report has to be enabled by Sales).

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | now() - 1 month | Y-m-d (e.g. 2012-01-01) | Start date | date_to | now() | Y-m-d (e.g. 2012-01-01) | End date |

Response Parameters

Parameter | Description | --- | --- | --- bucket_id | The Zone ID for the top level directory | custom_domain_id | The ID of the Custom Domain | hit | The number of requests made to this custom domain | size | The amount of bytes transferred to/from this custom domain |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneId = ''
clientId = ''
api.get('/clients/'+clientId+'/reports/'+zoneId+'/statsbycustomdomain.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
zoneId = '84199'
clientId = '1'
api.get('/clients/'+clientId+'/reports/'+zoneId+'/statsbycustomdomain.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$zoneId = '';
$clientId = '';
$api->get('clients/'.$clientId.'/reports/'.$zoneId.'/statsbycustomdomain.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
var zoneId = ''
var clientId = ''
api.get('/clients/' + clientId + '/reports/' + zoneId + '/statsbycustomdomain.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "statsbycustomdomain": [],
        "summary": {
            "hit": null,
            "size": null
        },
        "total": "0"
    }
}

Reports for Live Zones API

List Connection Stats

Gets zone stats in hourly, daily, or monthly summaries

Accepted Request Parameters

Parameter | Default Value | Validation | Description | --- | --- | --- | --- | --- date_from | - | Y-m-d e.g. 2012-01-01 | Start date | date_to | - | Y-m-d e.g. 2012-01-01 | End date |

Code Samples

reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/live/connectionstats.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/live/connectionstats.json'+reportType)
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/live/connectionstats.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/live/connectionstats.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "stats": [],
        "total": "0"
    }
}