API Docs

MaxCDN API Docs

MaxCDN is a Content Delivery Network service.

Index

Index

Overview

Support

Changelog

  • 2016-06-28 Added the ability to block HTTP referers
  • 2016-06-20 Added multiple levels of compression
  • 2016-06-13 Added Activity Stream
  • 2016-05-19 Updated docs for HTTP/2
  • 2015-09-10 Updated docs for Reseller API
  • 2015-07-27 Updated validation for use_stale
  • 2015-03-06 Added ssl, ssl_sni, and geo_enabled flags for Pull Zones
  • 2015-01-19 Added account-level SSL
  • 2014-12-18 Removed Live Zone API documentation (EOL)
  • 2014-12-09 Added new Origin Shield API documentation
  • 2014-10-20 Updated description for use_stale
  • 2014-07-16 Added SNI option on SSL Installation
  • 2014-07-11 Updated PHP and .NET libs
  • 2014-06-30 Add RUM code for webperf measuring
  • 2014-06-24 Updated BootstrapCDN and favicon urls
  • 2014-06-20 Removed create Live Zone endpoint (EOL)
  • 2014-06-19 Removed links outdated Perl and .NET SDKs, added Go SDK (beta)
  • 2014-06-13 Updated all URL endpoints to rws.maxcdn.com
  • 2014-06-10 Added documentation for the Raw Logs API
  • 2014-05-19 Added feature “SPDY” to Pull and Push Zone settings
  • 2014-04-15 Added new MIME type for Pull Zone GZip compression: application/octet-stream
  • 2014-04-10 Added feature “X-Forwarded-For” to Pull Zone settings
  • 2014-03-05 Firefox bug fixes.
  • 2014-03-05 Added stats per zone reporting endpoint
  • 2014-03-03 Documented dns_check property of Pull Zones
  • 2014-01-10 Minor grammatical fixes
  • 2013-09-10 Rebranded for MaxCDN
  • 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

Auth-Overview

The first thing to do in order to use the MaxCDN REST Web Service (RWS) 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 MaxCDN RWS supports both 2-legged and 3-legged authentication.

3-legged OAuth is best used to allow 3rd party apps/services (e.g. Leftronic) access to a user’s 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, which can be useful for building a 3rd party app, 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 their credentials (i.e. username/password). On a conceptual level it works in the following way:

  • Client has signed up to the server and received their client credentials (also known as “consumer key and secret”) ahead of time
  • User wants to give the client access to their 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 their 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 received their client credentials (also known as “consumer key and secret”)
  • Client uses their client credentials (and empty token credentials) to access the protected resources on the server

Registering Your Application

Login and go to https://cp.maxcdn.com/account/api/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 MaxCDN.

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

User Authorization

The User Authorization step sends the user to the MaxCDN RWS authorization page, which grants 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.maxcdn.com/oauth/authorize

Key: Path Parameters

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

Account API

Get Account

Gets account information

GET https://rws.maxcdn.com/{companyalias}/account.json

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")
my $data = $api->get("/account.json");
print $data->{'account'}{'name'};
$api->get('/account.json');
api.get('/account.json', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
api.Get("/account.json");
MaxCDNObject response = api.get("/account.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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": "MaxCDN 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

PUT https://rws.maxcdn.com/{companyalias}/account.json

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)
my @params = ('name=IDABIC');
$api->put("/account.json", @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)
}
api.Put("/account.json", "name=UserName");
MaxCDNRequest data = MaxCDN.newRequest("firstname", "Jane");
MaxCDNObject response = api.put("/account.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/account.json/address

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')
my $data = $api->get("/account.json/address");
print $data->{'address'}{'street1'};
$api->get('/account.json/address')
api.get('/account.json/address', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
api.Get("/account.json/address");
MaxCDNObject response = api.get("/account.json/address");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

PUT https://rws.maxcdn.com/{companyalias}/account.json/address

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)
my @params = ('street1=Main');
$api->put("/account.json/address", @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)
}
api.Put("/account.json/address", "street1=1234 Main Street");
MaxCDNRequest data = MaxCDN.newRequest("street1", "Main St 12").append("street2", "Lake St 13");
MaxCDNObject response = api.put("/account.json/address", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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"
        }
    }
}

Get Activity

Gets account activity.

GET https://rws.maxcdn.com/{companyalias}/activity.json

Accepted Request Parameters

Parameter Default Value Validation Description
page 1 int Pages of results to return
page_size 50 int Number of results to return per page
user_id - int User ID that performed the activity
start now() - 90 days ISO-8601 formatted date/time The start of the range for activity to pull (restricted to last 90 days)
end now() ISO-8601 formatted date/time The end of the range for activity to pull

Response Parameters

Parameter Description
id Unique ID for Activity event
timestamp The timestamp when the activity occurred
user_id User ID of user that performed the activity
user_email Email address of user that performed the activity
activity_message Text describing activity action performed
user_agent Text identifying the user’s browser
user_ip Text identifying the user’s IP address
location Text identifying the user’s location, if available

Code Samples

api.get("/activity.json")
api.get("/activity.json")
my $data = $api->get("/activity.json");
print $data->{'account'}{'name'};
$api->get('/activity.json');
api.get('/activity.json', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
api.Get("/activity.json");
MaxCDNObject response = api.get("/activity.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code": 200,
  "data": {
      "activity_stream": [
          {
              "activity_message": "Push Zone Error: Zone Not Found [zone_id: 150545]",
              "id": "26371",
              "location": "US,United States,South Park,CO,80440,,719, 39.2252631,-106.0051282",
              "timestamp": "2016-06-08 21:41:09",
              "user_agent": "MaxCDN Beefcake API Client",
              "user_email": "eric@cartman.io",
              "user_id": "27640",
              "user_ip": "192.168.10.1"
          }
      ]
  }
}

Users API

List Users

Returns a list of all users on the specified account

GET https://rws.maxcdn.com/{companyalias}/users.json

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')
my $data = $api->get("/users.json");
print $data->{'users'}[0]{'id'};
$api->get('/users.json');
api.get('/users.json', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
api.Get("/users.json");
MaxCDNObject response = api.get("/users.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

POST https://rws.maxcdn.com/{companyalias}/users.json

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 of Supported 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 )
my @params = {firstname => 'Perl', lastname => 'User', email => 'user@domain.com', password => 'testpwd'};
$api->post("/users.json", @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)
}
Console.Write("User First Name: \n");
string fname = Console.ReadLine();
Console.Write("User Last Name: \n");
string lname = Console.ReadLine();
Console.Write("User email: \n");
string email = Console.ReadLine();
Console.Write("Password: \n");
string pwd = Console.ReadLine();

api.Post("/users.json", "firstname=" + fname + "&lastname=" + lname + "&password=" + pwd + "&email=" + email);
MaxCDNRequest data = MaxCDN.newRequest("email", "test@gmail.com").append("password", "pass1234").append("firstname", "Jane").append("lastname", "Smith");
MaxCDNObject response = api.post("/users.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/users.json/{user_id}

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)
my $id = 58309;
my $data = $api->get("/users.json/58309");
print $data->{'user'}{'lastname'};
$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)
}
Console.Write("User ID: \n");
string id = Console.ReadLine();
api.Get("/users.json/" + id);
String userId = "12345";
MaxCDNObject response = api.get("/users.json"+userId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

PUT https://rws.maxcdn.com/{companyalias}/users.json/{user_id}

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 of Supported 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'})
my $id = 58309;
my @params = ('lastname=Test');
$api->put("/users.json/" . $id, @params);
$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)
}
Console.Write("Enter user ID to edit: \n");
int uid = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter property to edit: \n");
string prop = Console.ReadLine();
Console.Write("New value: \n");
string val = Console.ReadLine();

api.Put("/users.json/" + uid + "/", prop + "=" + val);
String userId = "12345";
MaxCDNRequest data = MaxCDN.newRequest("firstname", "Jane"); 
MaxCDNObject response = api.put("/users.json/"+userId, data); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

DELETE https://rws.maxcdn.com/{companyalias}/users.json/{user_id}

Code Samples

id = '33706'
api.delete('/users.json/'+id)
id = '33706'
api.delete('/users.json/'+id)
my $id = 58309;
$api->delete("/users.json/" . $id);
$id = '33715';
$api->delete('/users.json/'.$id);
var id = '33715'
api.delete('/users.json/' + id, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
Console.Write("User id to delete: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Delete("/users.json/" + id);
String userId = "12345";
MaxCDNObject response = api.delete("/users.json/"+userId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Zones API

List Zones

Returns a list of all zones on the specified account

GET https://rws.maxcdn.com/{companyalias}/zones.json

Code Samples

api.get('/zones.json')
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)
})
api.Get("/zones/pull.json");
MaxCDNObject response = api.get("/zones.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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"
            }
        ]
    }
}

Get Zone Summary

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

GET https://rws.maxcdn.com/{companyalias}/zones.json/summary

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

Code Samples

api.get('/zones.json/summary')
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)
})
api.Get("/zones.json/summary");
MaxCDNObject response = api.get("/zones.json/summary");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "summary": {
            "pull": 1,
            "push": 1,
            "vod": 1
        }
    }
}

Get Zone Count

Counts all zones on the specified account

GET https://rws.maxcdn.com/{companyalias}/zones.json/count

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');
api.get('/zones.json/count', function(err, response) {
  console.log('err', err, 'response', response)
})
api.Get("/zones.json/count");
MaxCDNObject response = api.get("/zones.json/count");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200,"data":
    {
      "count":"4"
    }
}

Pull Zone API

List Pull Zones

Returns a list of all pull zones on the specified account

GET https://rws.maxcdn.com/{companyalias}/zones/pull.json

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 Enables on the fly GZip compression of your files from our edge servers 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, application/octet-stream
backend_compress Enables us to cache, from origin, GZip compressed versions of your files 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 to have a Max-Age of 1d, 7d, 1M or 12M
ignore_setcookie_header Ignore any cookies set by the origin in order to make the content consistently cacheable
ignore_cache_control Ignore any max age values set by the origin and use the CDN set value instead
use_stale Serve expired content while fetching new content. This will also cause the CDN to serve expired content in cases where the origin is down
proxy_cache_lock When multiple requests for an uncached file are received, they will wait until the first response is received rather than sending each request back to the origin
label Something that describes your zone
valid_referers List of domains for http referrer protection (separated by space), only the domains in the list will be treated as valid referrers
expires Set any request with a no “Cache-Control header” from the origin 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 for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
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
http2 Flag denoting if the zone has HTTP/2 protocol enabled
ssl Read-only flag denoting if the zone has Dedicated IP SSL enabled
ssl_sni Read-only flag denoting if the zone has SNI SSL enabled
geo_enabled Read-only flag denoting if the zone has ‘More Locations’ enabled

Code Samples

api.get('/zones/pull.json')
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)
})
api.Post("/zones/pull.json");
MaxCDNObject response = api.get("/zones/pull.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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,
                "http2": 1,
                "ssl": 1,
                "ssl_sni": 0,
                "geo_enabled": 1
            },
            <...>,
            {
                "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,
                "http2": 1,
                "ssl": 0,
                "ssl_sni": 1,
                "geo_enabled": 0
            }
        ],
        "total": 3
    }
}

Create Pull Zone

Creates a new pull zone

POST https://rws.maxcdn.com/{companyalias}/zones/pull.json

Accepted Request Parameters

Parameter Default Value Validation Description
name - required
length: 3-30 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
dns_check 1 only 0 or 1 accepted This field determines how your Origin resolves. When set to 1, we automatically grab the origin’s IP using DNS. Setting it to 0 allows you explicitly provide the IP of the origin.
ip - length: 1-10 chars, only digits accepted Valid IP address of the Origin URL. Be sure to set dns_check to 0 to prevent this value from being overwritten.
compress 0 0 is off; ranges between 1 and 6 specify the compression level Enables on the fly GZip compression of your files from our edge servers 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 Enables us to cache, from origin, GZip compressed versions of your files 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 to have 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 the content consistently cacheable
ignore_cache_control 0 only 0 or 1 accepted Ignore any max age values set by the origin and use the CDN set value instead
use_stale 0 List of status codes separated with space - empty character - (?use_stale=500 502 503 504 403 404) are accepted as a valid request. 0 or 1 are accepted by legacy but, these are not valid parameters any more. To disable use_stale you can pass 0 (as a part of the legacy) or empty string “”. Serve expired content while fetching new content. This will also cause the CDN to serve expired content in cases where the origin is down
proxy_cache_lock 0 only 0 or 1 accepted When multiple requests for an uncached file are received, they will wait until the first response is received rather than sending each 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 access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
expires 1d length: 1-32 chars Set any request with a no “Cache-Control header” from the origin 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
x_forward_for 0 only 0 or 1 accepted Add X-Forwarded-For (XFF) HTTP Header
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 for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com

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 Enables on the fly GZip compression of your files from our edge servers 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 Enables us to cache, from origin, GZip compressed versions of your files 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 to have a Max-Age of 1d, 7d, 1M or 12M
ignore_setcookie_header Ignore any cookies set by the origin in order to make the content consistently cacheable
ignore_cache_control Ignore any max age values set by the origin and use the CDN set value instead
use_stale Serve expired content while fetching new content. This will also cause the CDN to serve expired content in cases where the origin is down
proxy_cache_lock When multiple requests for an uncached file are received, they will wait until the first response is received rather than sending each request back to the origin
label Something that describes your zone
valid_referers List of domains for HTTP referrer access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
expires Set any request with a no “Cache-Control header” from the origin 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
x_forward_for Add X-Forwarded-For (XFF) HTTP Header
pseudo_streaming Enable the zone for pseudo streaming content
sslshared Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
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
ssl Read-only flag denoting if the zone has Dedicated IP SSL enabled
ssl_sni Read-only flag denoting if the zone has SNI SSL enabled
geo_enabled Read-only flag denoting if the zone has ‘More Locations’ enabled

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)
my @params = {name => 'perltest5', url => 'http://www.domain.com'};
$api->post("/zones/pull.json", @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)
})
Console.Write("Zone Name: \n");
string ZoneName = Console.ReadLine();
Console.Write("Origin URL (starting with http://): \n");
string url = Console.ReadLine();

api.Post("/zones/pull.json", "url=" + url + "&name=" + ZoneName);
MaxCDNRequest data = MaxCDN.newRequest("name", "cdn").append("url", "http://domain.com");
MaxCDNObject response = api.post("/zones/pull.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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,
            "x_forward_for": 0,
            "valid_referers": null,
            "http2": 1,
            "ssl": 1,
            "ssl_sni": 0,
            "geo_enabled": 1
        }
    }
}

Get Pull Zones Count

Counts all pull zones on the specified account

GET https://rws.maxcdn.com/{companyalias}/zones/pull.json/count

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');
api.get('/zones/pull.json/count', function(err, response) {
  console.log('err', err, 'response', response)
})
api.Get("/zones/pull.json/count");
MaxCDNObject response = api.get("/zones/pull.json/count");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200,"data":
    {
      "count": "3"
    }
}

Get Pull Zone

Gets a pull zone specified by the {zone_id} parameter

GET https://rws.maxcdn.com/{companyalias}/zones/pull.json/{zone_id}

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 service will automatically try to find the IP
compress Enables on the fly GZip compression of your files from our edge servers 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 Enables us to cache, from origin, GZip compressed versions of your files 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 to have a Max-Age of 1d, 7d, 1M or 12M
ignore_setcookie_header Ignore any cookies set by the origin in order to make the content consistently cacheable
ignore_cache_control Ignore any max age values set by the origin and use the CDN set value instead
use_stale Serve expired content while fetching new content. This will also cause the CDN to serve expired content in cases where the origin is down
proxy_cache_lock When multiple requests for an uncached file are received, they will wait until the first response is received rather than sending each request back to the origin
label Something that describes your zone
valid_referers List of domains for HTTP referrer access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
expires Set any request with a no “Cache-Control header” from the origin 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
x_forward_for Add X-Forwarded-For (XFF) HTTP Header
pseudo_streaming Enable the zone for pseudo streaming content
sslshared Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
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
http2 Flag denoting if the zone has the HTTP/2 protocol enabled
ssl Read-only flag denoting if the zone has Dedicated IP SSL enabled
ssl_sni Read-only flag denoting if the zone has SNI SSL enabled
geo_enabled Read-only flag denoting if the zone has ‘More Locations’ enabled

Code Samples

id = '97167'
api.get('/zones/pull.json/'+id)
id = '97167'
api.get('/zones/pull.json/'+id)
my $id = 96076;
$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)
})
Console.Write("Zone id: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Get("/zones/pull.json/" + id);
String zoneId = "100200";
MaxCDNObject response = api.get("/zones/pull.json/"+zoneId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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",
            "x_forward_for": "0",
            "valid_referers": null,
            "http2": 1,
            "ssl": 1,
            "ssl_sni": 0,
            "geo_enabled": 1
        }
    }
}

Update Pull Zone

Updates a pull zone specified by the {zone_id} parameter

PUT https://rws.maxcdn.com/{companyalias}/zones/pull.json/{zone_id}

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
dns_check 1 only 0 or 1 accepted This field determines how your Origin resolves. When set to 1, we automatically grab the origin’s IP using DNS. Setting it to 0 allows you explicitly provide the IP of the origin.
ip - length: 1-10 chars, only digits accepted Valid IP address of the Origin URL. Be sure to set dns_check to 0 to prevent this value from being overwritten.
compress 0 0 is off; ranges between 1 and 6 specify the compression level On the fly compression of your files served from our edges. Enables 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 the origin. Enables 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 to have 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 the content consistently cacheable
ignore_cache_control 0 only 0 or 1 accepted Ignore any max age values set by the origin and use the CDN set value instead
use_stale 0 List of status codes separated with space - empty character - (?use_stale=500 502 503 504 403 404) are accepted as a valid request. 0 or 1 are accepted by legacy but, these are not valid parameters any more. To disable use_stale you can pass 0 (as a part of the legacy) or empty string “”. Serve expired content while fetching new content. This will also cause the CDN to serve expired content in cases where the origin is down
proxy_cache_lock 0 only 0 or 1 accepted When multiple requests for an uncached file are received, they will wait until the first response is received rather than sending each 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 access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
expires 1d length: 1-32 chars Set any request with a no “Cache-Control header” from the origin 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
x_forward_for 0 only 0 or 1 accepted Add X-Forwarded-For (XFF) HTTP Header
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 for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
http2 0 only 0 or 1 accepted Enable HTTP/2 protocol on the zone (requires SSL)

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 service will automatically try to find the IP
compress On the fly compression of your files served from our edges. Enables 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 the origin. Enables 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 to have a Max-Age of 1d, 7d, 1M or 12M
ignore_setcookie_header Ignore any cookies set by the origin in order to make the content consistently cacheable
ignore_cache_control Ignore any max age values set by the origin and use the CDN set value instead
use_stale Serve expired content while fetching new content. This will also cause the CDN to serve expired content in cases where the origin is down
proxy_cache_lock When multiple requests for an uncached file are received, they will wait until the first response is received rather than sending each request back to the origin
label Something that describes your zone
valid_referers List of domains for HTTP referrer access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
expires Set any request with a no “Cache-Control header” from the origin 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
x_forward_for Add X-Forwarded-For (XFF) HTTP Header
pseudo_streaming Enable the zone for pseudo streaming content
sslshared Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
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
http2 Flag denoting if the zone has the HTTP/2 protocol enabled
ssl Read-only flag denoting if the zone has Dedicated IP SSL enabled
ssl_sni Read-only flag denoting if the zone has SNI SSL enabled
geo_enabled Read-only flag denoting if the zone has ‘More Locations’ enabled

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)
my $id = 236828;
my @params = ('compress=0');
$api->put("/zones/pull.json/" . $id, @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)
})
Console.Write("Zone id to edit: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Property to edit/change (url/compression...): \n");
string prop = Console.ReadLine();
Console.Write("New value: \n");
string val = Console.ReadLine();

api.Put("/zones/pull.json/" + zoneID, prop + "=" + val);
String zoneId = "100200";
MaxCDNRequest data = MaxCDN.newRequest("label", "New label"); 
MaxCDNObject response = api.put("/zones/pull.json/"+zoneId, data); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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",
            "x_forward_for": "0",
            "valid_referers": null,
            "http2": 1,
            "ssl": 1,
            "ssl_sni": 0,
            "geo_enabled": 1
        }
    }
}

Enable Flex

Enables additional locations on a pull zone specified by the {zone_id} parameter

POST https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/flex.json

Code Samples

id = '97167'
api.post('/zones/pull/'+id+'/flex.json')
id = '97167'
api.post('/zones/pull/'+id+'/flex.json')
my $id = 134458;
$api->post("/zones/pull/" . $id . "/flex.json");
$id = '97167';
$api->post('/zones/pull/'.$id.'/flex.json');
var id = '97167'
api.post('/zones/pull/' + id + '/flex.json', function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone id to enable: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Post("/zones/pull/" + id + "/flex.json");
String zoneId = "100200";
MaxCDNObject response = api.post("/zones/pull/"+zoneId+"/flex.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Disable Flex

Disables additional locations on a pull zone specified by the {zone_id} parameter

DELETE https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/flex.json

Code Samples

id = '97167'
api.delete('/zones/pull/'+id+'/flex.json')
id = '97167'
api.delete('/zones/pull/'+id+'/flex.json')
my $id = 134458;
$api->delete("/zones/pull/" . $id . "/flex.json");
$id = '97167';
$api->delete('/zones/pull'.$id.'flex.json);
var id = '97167'
api.delete('/zones/pull' + id + 'flex.json', function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone id to disable: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/pull/" + id + "/flex.json");
String zoneId = "100200";
MaxCDNObject response = api.delete("/zones/pull/"+zoneId+"/flex.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Delete Pull Zone

Deletes a pull zone specified by the {zone_id} parameter

DELETE https://rws.maxcdn.com/{companyalias}/zones/pull.json/{zone_id}

Code Samples

id = '97167'
api.delete('/zones/pull.json/'+id)
id = '97167'
api.delete('/zones/pull.json/'+id)
my $id = 236828;
$api->delete("/zones/pull.json/" . $id);
$id = '97167';
$api->delete('/zones/pull.json/'.$id);
var id = '97167'
api.delete('/zones/pull.json' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone id to delete: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/pull.json/" + id);
String zoneId = "100200";
MaxCDNObject response = api.delete("/zones/pull.json/"+zoneId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Enable Pull Zone

Enables a pull zone specified by the {zone_id} parameter

PUT https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/enable.json

Code Samples

id = '97167'
api.put('/zones/pull/'+id+'/enable.json')
id = '97167'
api.put('/zones/pull/'+id+'/enable.json')
my $id = 134458;
$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)
})
Console.Write("Zone id to enable: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Put("/zones/pull/" + id + "/enable.json");
String zoneId = "100200";
MaxCDNObject response = api.put("/zones/pull/"+zoneId+"/enable.json"); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Disable Pull Zone

Disables a pull zone specified by the {zone_id} parameter

PUT https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/disable.json

Code Samples

id = '97167'
api.put('/zones/pull/'+id+'/disable.json')
id = '97167'
api.put('/zones/pull/'+id+'/disable.json')
my $id = 134458;
$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)
})
Console.Write("Zone id to disable: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Put("/zones/pull/" + id + "/disable.json");
String zoneId = "100200";
MaxCDNObject response = api.put("/zones/pull/"+zoneId+"/disable.json"); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Purge Cache

Purges pull zone cache

DELETE https://rws.maxcdn.com/{companyalias}/zones/pull.json/{zone_id}/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
$api->delete("/zones/pull.json/165013/cache");

#Purge File
my @params = ("%2Frankings%2Fhotlist%2Fi%2F500w%2F2.jpg");
$api->delete("/zones/pull.json/165013/cache", @params);

#Purge Files
my @params = ("%2Frankings%2Fhotlist%2Fi%2F500w%2F2.jpg", "%2F_index%2Ff_mdcdb.html");
$api->delete("/zones/pull.json/165013/cache", @params);
//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(
    'files' => array(
        '/file1.txt',
        '/file2.txt'
    )
);
$api->delete('/zones/pull.json/'.$id.'/cache',$params);
// Purge Zone
var id = '96167'
api.delete('/zones/pull.json/' + id + '/cache', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}

// Purge File
var id = '96167'
var file = '/file1.txt'
api.delete('/zones/pull.json/' + id + '/cache', file, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}

// Purge File
var id = '96167'
var files = [ '/file1.txt', '/file2.txt' ]
api.delete('/zones/pull.json/' + id + '/cache', files, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("What do you want to purge? (all/file)");
string ptype = Console.ReadLine();
switch (ptype){
	case "all":
	//Purge ALL
	api.Delete("/zones/pull.json/" + zoneID + "/cache");
	break;
	case "file":
	//Purge FILE
	Console.Write("Enter File Path to Purge (relative path): \n");
	string file = Console.ReadLine();
	file = "file=" + file;
	api.Purge("/zones/pull.json/" + zoneID + "/cache", file);
	break;
	case "fileS":
	//Purge FILES
	Console.Write("How Many? \n");
	int loop = Convert.ToInt32(Console.ReadLine());
	Console.Write("Enter File Paths to Purge (relative paths): \n");
	string files = "";
	for (int i = 0; i < loop; i++)
	{
		Console.Write(i + 1 + ": \n");
		string File = Console.ReadLine();
		files += "file[" + i + "]=" + File + "&";
	}
	api.Purge("/zones/pull.json/" + zoneID + "/cache", files);
	break;
}
//Purge zone
String zoneId = "100200";
MaxCDNObject response = api.delete("/zones/pull.json/cache"+zoneId);        
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
//Purge single file
String zoneId = "100200";
String[] file = {"/file.txt"};
MaxCDNObject response = api.delete("/zones/pull.json/"+zoneId+"/cache?file="+file[0]);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
               
//Purge more files at once
String zoneId = "100200";
String[] file = {"/file_1.txt", "/file_2.txt"};
MaxCDNObject response = api.delete("/zones/pull.json/"+zoneId+"/cache?file="+file[0]+"&file="+file[1]);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200
}

Pull Zone Custom Domains API

List Custom Domains

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

GET https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/customdomains.json

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')
my $id = 134458;
$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)
})
Console.Write("Zone Id: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());

Console.Write(api.Get("/zones/pull/" + zoneID + "/customdomains.json"));
String zoneId = "100200";
MaxCDNObject response = api.get("/zones/pull/"+zoneId+"/customdomains.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

POST https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/customdomains.json

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)
my $id = 134458;
my @params = {custom_domain => 'idabic.dom.net'};
$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)
})
Console.Write("Zone Id: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Domain: \n");
string dat = Console.ReadLine();

api.Post("/zones/pull/" + zoneID + "/customdomains.json", dat="custom_domain=" + dat);
String zoneId = "100200";
MaxCDNRequest data = MaxCDN.newRequest("custom_domain", "cdnn.domain.com");
MaxCDNObject response = api.post("/zones/pull/"+zoneId+"/customdomains.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/customdomains.json/{customdomain_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 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)
my $zid = 134458;
my $cid = 113070;
my $data = $api->get("/zones/pull/" . $zid . "/customdomains.json/" . $cid);
print $data->{'customdomain'}{'custom_domain'};
$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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Domain Id: \n");
int domainId = Convert.ToInt32(Console.ReadLine());

api.Get("/zones/pull/" + zoneID + "/customdomains.json/" + domainId);
String zoneId = "100200";
String domainId = "287431";
MaxCDNObject response = api.get("/zones/pull/"+zoneId+"/customdomains.json/"+domainId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

PUT https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/customdomains.json/{customdomain_id}

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)
my $zid = 134458;
my $cid = 173075;
my @params = ('custom_domain=idabic.domain.net');
$api->put("/zones/pull/" . $zid . "/customdomains.json/" . $cid, @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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Doamin Id to Edit: \n");
int domainId = Convert.ToInt32(Console.ReadLine());
Console.Write("New Value for this custom domain: \n");
string cdname = Console.ReadLine();

api.Put("/zones/pull/" + zoneID + "/customdomains.json/" + domainId, "custom_domain=" + cdname);
String zoneId = "100200";
String domainId = "287790";
MaxCDNRequest data = MaxCDN.newRequest("custom_domain","cdn456.domain.com"); 
MaxCDNObject response = api.put("/zones/pull/"+zoneId+"/customdomains.json/"+domainId, data); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

DELETE https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/customdomains.json/{customdomain_id}

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)
my $zid = 134458;
my $cid = 173075;
$api->delete("/zones/pull/" . $zid . "/customdomains.json/" . $cid);
$zoneId = '97167';
$domainId = '79182';
$api->delete('/zones/pull/'.$zoneId.'/customdomains.json/'.$domainId);
var zoneId = '97167'
var domainId = '79182'
api.delete('/zones/pull/' + zoneId + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Domain Id to Delete: \n");
int domainId = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/pull/" + zoneID + "/customdomains.json/" + domainId);
String zoneId = "100200";
String domainId = "287431";
MaxCDNObject response = api.delete("/zones/pull/"+zoneId+"/customdomains.json/"+domainId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Push Zone API

List Push Zones

Returns a list of all push zones on the specified account

GET https://rws.maxcdn.com/{companyalias}/zones/push.json

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 access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
content_disposition Force files to download
sslshared Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
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
http2 Flag denoting if the zone has the HTTP/2 protocol enabled

Code Samples

api.get('/zones/push.json')
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)
})
api.Get("/zones/push.json");
MaxCDNObject response = api.get("/zones/push.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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,
                "http2": 1
            },
            {
                "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,
                "http2": 0
            }
        ],
        "total": 2
    }
}

Create Push Zone

Creates a new push zone

POST https://rws.maxcdn.com/{companyalias}/zones/push.json

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 access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
content_disposition 0 only 0 or 1 accepted Force files to download
sslshared 0 only 0 or 1 accepted Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com

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 access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
content_disposition Force files to download
sslshared Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
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)
my @params = {name => 'perltestpush', password => 'password'};
$api->post("/zones/push.json", @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)
})
Console.Write("Zone Name: \n");
string ZoneName = Console.ReadLine();
Console.Write("Password: \n");
string password = Console.ReadLine();

api.Post("/zones/push.json", "name=" + ZoneName + "&password=" + password);
MaxCDNRequest data = MaxCDN.newRequest("name", "newpush").append("password", "pass1234");
MaxCDNObject response = api.post("/zones/push.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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,
            "http2": 1
        }
    }
}

Get Push Zones Count

Counts all push zones on the specified account

GET https://rws.maxcdn.com/{companyalias}/zones/push.json/count

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');
api.get('/zones/push.json/count', function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone id: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Get("/zones/push.json/" + id);
MaxCDNObject response = api.get("/zones/push.json/count");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "count": "3"
    }
}

Get Push Zone

Gets a push zone specified by the {zone_id} parameter

GET https://rws.maxcdn.com/{companyalias}/zones/push.json/{zone_id}

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 access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
content_disposition Force files to download
sslshared Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
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
http2 Flag denoting if the zone has the HTTP/2 protocol enabled

Code Samples

id = '97793'
api.get('/zones/push.json/'+id)
id = '96182'
api.get('/zones/push.json/'+id)
my $id = 55659;
$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)
})
Console.Write("Zone id: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
api.Get("/zones/push.json/" + zoneID);
String zoneId = "100200";
MaxCDNObject response = api.get("/zones/push.json/"+zoneId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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,
            "http2": 1
        }
    }
}

Update Push Zone

Updates a push zone specified by the {zone_id} parameter

PUT https://rws.maxcdn.com/{companyalias}/zones/push.json/{zone_id}

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 access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
content_disposition 0 only 0 or 1 accepted Force files to download
sslshared 0 only 0 or 1 accepted Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
http2 0 only 0 or 1 accepted Enable HTTP/2 protocol on the zone (requires SSL)

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 access control (separated by space); prepending a referer with ! will block the referer from accessing the files on the zone; blocking and whitelisting referers cannot be activated at the same time
content_disposition Force files to download
sslshared Enable Shared SSL for your zone, so you can use HTTPS, using our SSL certificate for netdna-ssl.com
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
http2 Flag denoting if the zone has the HTTP/2 protocol enabled

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)
my $id = 55659;
my @params = ('compress=0');
$api->put("/zones/push.json/" . $id, @params);
$id = '97181';
$params = array("label"=>"Some other description");
$api->put('/zones/push.json/'.$id, $params);
var id = '97182'
api.put('/zones/push.json/' + id, { label: 'Some other description' }, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone id to edit: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Property to edit/change (label/compression...): \n");
string prop = Console.ReadLine();
Console.Write("New value: \n");
string val = Console.ReadLine();

api.Put("/zones/push.json/" + zoneID, prop + "=" + val);
String zoneId = "100200";
MaxCDNRequest data = MaxCDN.newRequest("label", "newpush");
MaxCDNObject response = api.put("/zones/push.json/"+zoneId, data); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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,
            "http2": 1
        }
    }
}

Delete Push Zone

Deletes a push zone specified by the {zone_id} parameter

DELETE https://rws.maxcdn.com/{companyalias}/zones/push.json/{zone_id}

Code Samples

id = '97793'
api.delete('/zones/push.json/'+id)
id = '96182'
api.delete('/zones/push.json/'+id)
my $id = 55659;
$api->delete("/zones/push.json/" . $id);
$id = '97181';
$api->delete('/zones/push.json/'.$id);
var id = '97181'
api.delete('/zones/push.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone id to delete: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/push.json/" + id);
String zoneId = "100200";
MaxCDNObject response = api.delete("/zones/push.json/"+zoneId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Enable Push Zone

Enables a push zone specified by the {zone_id} parameter

PUT https://rws.maxcdn.com/{companyalias}/zones/push/{zone_id}/enable.json

Code Samples

id = '97793'
api.put('/zones/push/'+id+'/enable.json')
id = '96182'
api.put('/zones/push/'+id+'/enable.json')
my $id = 55659;
$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)
})
Console.Write("Zone id to enable: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Put("/zones/push/" + id + "/enable.json");
String zoneId = "100200";
MaxCDNObject response = api.put("/zones/push/"+zoneId+"/enable.json"); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Disable Push Zone

Disables a push zone specified by the {zone_id} parameter

PUT https://rws.maxcdn.com/{companyalias}/zones/push/{zone_id}/disable.json

Code Samples

id = '97793'
api.put('/zones/push/'+id+'/disable.json')
id = '96182'
api.put('/zones/push/'+id+'/disable.json')
my $id = 55659;
$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)
})
Console.Write("Zone id to disable: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Put("/zones/push/" + id + "/disable.json");
String zoneId = "100200";
MaxCDNObject response = api.put("/zones/push/"+zoneId+"/disable.json"); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Push Zone Custom Domains API

List Custom Domains

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

GET https://rws.maxcdn.com/{companyalias}/zones/push/{zone_id}/customdomains.json

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')
my $id = 134458;
$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)
})
Console.Write("Zone Id: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());

Console.Write(api.Get("/zones/push/" + zoneID + "/customdomains.json"));
String zoneId = "100200";
MaxCDNObject response = api.get("/zones/push/"+zoneId+"/customdomains.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

POST https://rws.maxcdn.com/{companyalias}/zones/push/{zone_id}/customdomains.json

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)
my $id = 55659;
my @params = {custom_domain => 'idabic2.dom.net'};
$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)
})
Console.Write("Zone Id: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Domain: \n");
string dat = Console.ReadLine();

api.Post("/zones/push/" + zoneID + "/customdomains.json", dat="custom_domain=" + dat);
String zoneId = "100200";
MaxCDNRequest data = MaxCDN.newRequest("custom_domain", "cdnn.domain.com");
MaxCDNObject response = api.post("/zones/push/"+zoneId+"/customdomains.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/zones/push/{zone_id}/customdomains.json/{customdomain_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 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)
my $zid = 55659;
my $cid = 122211;
$api->get("/zones/push/" . $zid . "/customdomains.json/" . $cid);
$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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Domain Id: \n");
int domainId = Convert.ToInt32(Console.ReadLine());

api.Get("/zones/push/" + zoneID + "/customdomains.json/" + domainId);
String zoneId = "100200";
String domainId = "287434";
MaxCDNObject response = api.get("/zones/push/"+zoneId+"/customdomains.json/"+domainId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

PUT https://rws.maxcdn.com/{companyalias}/zones/push/{zone_id}/customdomains.json/{customdomain_id}

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)
my $zid = 55659;
my $cid = 122211;
my @params = ('custom_domain=idabic.domain.net');
$api->put("/zones/push/" . $zid . "/customdomains.json/" . $cid, @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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Doamin Id to Edit: \n");
int domainId = Convert.ToInt32(Console.ReadLine());
Console.Write("New Value for this custom domain: \n");
string cdname = Console.ReadLine();

api.Put("/zones/push/" + zoneID + "/customdomains.json/" + domainId, "custom_domain=" + cdname);
String zoneId = "100200";
String domainId = "288862";
MaxCDNRequest data = MaxCDN.newRequest("custom_domain", "cdn3.newdomain.com");
MaxCDNObject response = api.put("/zones/push/"+zoneId+"/customdomains.json/"+domainId, data);  
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

DELETE https://rws.maxcdn.com/{companyalias}/zones/push/{zone_id}/customdomains.json/{customdomain_id}

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)
my $zid = 55659;
my $cid = 122211;
$api->delete("/zones/push/" . $zid . "/customdomains.json/" . $cid);
$zoneId = '97181';
$domainId = '79188';
$api->delete('/zones/push/'.$zoneId.'/customdomains.json/'.$domainId);
var zoneId = '97181'
var domainId = '79188'
api.delete('/zones/push/' + zoneId + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Doamin Id to Edit: \n");
int domainId = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/push/" + zoneID + "/customdomains.json/" + domainId);
String zoneId = "100200";
String domainId = "287434";
MaxCDNObject response = api.delete("/zones/push/"+zoneId+"/customdomains.json/"+domainId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

VOD Zone API

List VOD Zones

Returns a list of all VOD zones on the specified account

GET https://rws.maxcdn.com/{companyalias}/zones/vod.json

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');
api.get('/zones/vod.json', function(err, response) {
  console.log('err', err, 'response', response)
})
api.Get("/zones/vod.json");
MaxCDNObject response = api.get("/zones/vod.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

POST https://rws.maxcdn.com/{companyalias}/zones/vod.json

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)
my @params = {name => 'perltest5', password => 'password'};
$api->post("/zones/vod.json", @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)
})
Console.Write("Zone Name: \n");
string ZoneName = Console.ReadLine();
Console.Write("Password: \n");
string password = Console.ReadLine();

api.Post("/zones/vod.json", "name=" + ZoneName + "&password=" + password);
MaxCDNRequest data = MaxCDN.newRequest("name", "newvod").append("password", "pass1234");
MaxCDNObject response = api.post("/zones/vod.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/zones/vod.json/count

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');
api.get('/zones/vod.json/count', function(err, response) {
  console.log('err', err, 'response', response)
})
api.Get("/zones/vod.json/count");
MaxCDNObject response = api.get("/zones/vod.json/count");
	  Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "count": "4"
    }
}

Get VOD Zone

Gets a VOD zone specified by the {zone_id} parameter

GET https://rws.maxcdn.com/{companyalias}/zones/vod.json/{zone_id}

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)
my $id = 75477;
$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)
})
Console.Write("Zone id: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Get("/zones/vod.json/" + id);
String zoneId = "100200";
MaxCDNObject response = api.get("/zones/vod.json/"+zoneId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

PUT https://rws.maxcdn.com/{companyalias}/zones/vod.json/{zone_id}

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)
my $id = 75477;
my @params = ('compress=0');
$api->put("/zones/vod.json/" . $id, @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)
})
Console.Write("Zone id to edit: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Property to edit/change (label...): \n");
string prop = Console.ReadLine();
Console.Write("New value: \n");
string val = Console.ReadLine();

api.Put("/zones/vod.json/" + zoneID, prop + "=" + val);
String zoneId = "100200";
MaxCDNRequest data = MaxCDN.newRequest("label", "cdn3.newdomain.com");
MaxCDNObject response = api.put("/zones/vod.json/"+zoneId, data);  
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

DELETE https://rws.maxcdn.com/{companyalias}/zones/vod.json/{zone_id}

Code Samples

id = '97794'
api.delete('/zones/vod.json/'+id)
id = '96187'
api.delete('/zones/vod.json/'+id)
my $id = 75477;
$api->delete("/zones/vod.json/" . $id);
$id = '97183';
$api->delete('/zones/vod.json/'.$id);
var id = '97183'
api.delete('/zones/vod.json/' + id, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone id to delete: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/vod.json/" + id);
String zoneId = "100200";
MaxCDNObject response = api.delete("/zones/vod.json/"+zoneId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Enable VOD Zone

Enables a VOD zone specified by the {zone_id} parameter

PUT https://rws.maxcdn.com/{companyalias}/zones/vod/{zone_id}/enable.json

Code Samples

id = '97794'
api.put('/zones/vod/'+id+'/enable.json')
id = '96187'
api.put('/zones/vod/'+id+'/enable.json')
my $id = 75477;
$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)
})
Console.Write("Zone id to enable: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Put("/zones/vod/" + id + "/enable.json");
String zoneId = "100200";
MaxCDNObject response = api.put("/zones/vod/"+zoneId+"/enable.json"); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Disable VOD Zone

Disables a VOD zone specified by the {zone_id} parameter

PUT https://rws.maxcdn.com/{companyalias}/zones/vod/{zone_id}/disable.json

Code Samples

id = '97794'
api.put('/zones/vod/'+id+'/disable.json')
id = '96187'
api.put('/zones/vod/'+id+'/disable.json')
my $id = 75477;
$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)
})
Console.Write("Zone id to disable: \n");
int id = Convert.ToInt32(Console.ReadLine());

api.Put("/zones/vod/" + id + "/disable.json");
String zoneId = "100200";
MaxCDNObject response = api.put("/zones/vod/"+zoneId+"/disable.json"); 
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

VOD Zone Custom Domains API

List Custom Domains

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

GET https://rws.maxcdn.com/{companyalias}/zones/vod/{zone_id}/customdomains.json

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')
my $id = 75477;
$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)
})
Console.Write("Zone Id: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());

Console.Write(api.Get("/zones/vod/" + zoneID + "/customdomains.json"));
String zoneId = "100200";
MaxCDNObject response = api.get("/zones/vod/"+zoneId+"/customdomains.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

POST https://rws.maxcdn.com/{companyalias}/zones/vod/{zone_id}/customdomains.json

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)
my $id = 75477;
my @params = {custom_domain => 'idabic3.dom.net', 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)
})
Console.Write("Zone Id: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Domain: \n");
string dat = Console.ReadLine();
Console.Write("Type: (vod-rtmp, vod-pseudo, vod-direct, or vod-ftp)\n");
string cdtype = Console.ReadLine();

api.Post("/zones/vod/" + zoneID + "/customdomains.json", dat="custom_domain=" + dat + "&type=" + cdtype);
String zoneId = "100200";
MaxCDNRequest data = MaxCDN.newRequest("custom_domain", "cdnn.domain.com").append("type", "vod-rtmp");
MaxCDNObject response = api.post("/zones/vod/"+zoneId+"/customdomains.json", data));
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/zones/vod/{zone_id}/customdomains.json/{customdomain_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 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)
my $zid = 75477;
my $cid = 173088;
my $data = $api->get("/zones/vod/" . $zid . "/customdomains.json/" . $cid);
$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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Domain Id: \n");
int domainId = Convert.ToInt32(Console.ReadLine());

api.Get"/zones/vod/" + zoneID + "/customdomains.json/" + domainId);
String zoneId = "100200";
String domainId = "287438";
MaxCDNObject response = api.get("/zones/vod/"+zoneId+"/customdomains.json/"+domainId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

PUT https://rws.maxcdn.com/{companyalias}/zones/vod/{zone_id}/customdomains.json/{customdomain_id}

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)
my $zid = 75477;
my $cid = 173088;
my @params = ('custom_domain=idabic.domain.net');
$api->put("/zones/vod/" . $zid . "/customdomains.json/" . $cid, @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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Doamin Id to Edit: \n");
int domainId = Convert.ToInt32(Console.ReadLine());
Console.Write("New Value for this custom domain: \n");
string cdname = Console.ReadLine();

api.Put("/zones/vod/" + zoneID + "/customdomains.json/" + domainId, "custom_domain=" + cdname);
String zoneId = "100200";
String domainId = "288865";
MaxCDNRequest data = MaxCDN.newRequest("custom_domain", "cdn5.newdomain.com");
MaxCDNObject response = api.put("/zones/vod/"+zoneId+"/customdomains.json/"+domainId, data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

DELETE https://rws.maxcdn.com/{companyalias}/zones/vod/{zone_id}/customdomains.json/{customdomain_id}

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)
my $zid = 75477;
my $cid = 173088;
$api->delete("/zones/vod/" . $zid . "/customdomains.json/" . $cid);
$zoneId = '97183';
$domainId = '79191';
$api->delete('/zones/vod/'.$zoneId.'/customdomains.json/'.$domainId);
var zoneId = '97183'
var domainId = '79191'
api.delete('/zones/vod/' + zoneId + '/customdomains.json/' + domainId, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Custom Domain Id to Delete: \n");
int domainId = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/vod/" + zoneID + "/customdomains.json/" + domainId);
String zoneId = "100200";
String domainId = "287434";
MaxCDNObject response = api.delete("/zones/vod/"+zoneId+"/customdomains.json/"+domainId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}

Zones SSL API

Get Zone’s SSL Information

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

GET https://rws.maxcdn.com/{companyalias}/zones/{zone_type}/{zone_id}/ssl.json

Code Samples

id = '96061'
type = 'pull'
api.get('/zones/'+type+'/'+id+'/ssl.json')
id = '96061'
type = 'pull'
api.get('/zones/'+type+'/'+id+'/ssl.json')
my $id = 236828;
my $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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();

api.Get("/zones/" + type + "/" + zoneID + "/ssl.json");
String zoneId = "100200";
String zoneType = "pull";
MaxCDNObject response = api.get("/zones/"+zoneType+"/"+zoneId+"/ssl.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":201,
  "data":{
    "ssl":{
      "id":1459,
      "ssl_id":1234
      "ssl_crt":"-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n",
      "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}.

POST https://rws.maxcdn.com/{companyalias}/zones/{zone_type}/{zone_id}/ssl.json

Accepted Request Parameters

Parameter Default Value Validation Description
ssl_id - digit id of previously created certificate (NOTE: This will become required in future revisions)
ssl_crt - - The SSL certificate you are installing. (NOTE: Not required if ssl_id specified)
ssl_key - - The key for the SSL certificate you are installing.
ssl_cabundle - - The CA Bundle for the SSL Certificate you are installing.
ssl_sni 0 only 0 or 1 accepted If this flag is set to 1 your zone will use SNI to identify your certificate, rather than requiring a dedicated IP.

Response Parameters

Parameter Description
id The SSL Certificate ID.
ssl_crt The SSL certificate.
ssl_cabundle The CA Bundle for the certificate.
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)
my $id = 236828;
my $type = 'pull';
my $ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n";
my $ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----";
my @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)
})
var cert = "";
var key = "";
Console.Write("Zone id: \n");
int zoneId = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();
using (StreamReader sr = new StreamReader("cert.txt"))
{
	cert = sr.ReadToEnd();               
}
using (StreamReader sr = new StreamReader("key.txt"))
{
	key = sr.ReadToEnd();
}
var dat = "";
cert = "-----BEGIN CERTIFICATE-----\n" + cert + "\n-----END CERTIFICATE-----\n";
key = "-----BEGIN RSA PRIVATE KEY-----\n" + key + "\n-----END RSA PRIVATE KEY-----\n";

api.Post("/zones/" + type + "/" + zoneId + "/ssl.json", dat="ssl_crt=" + cert + "&ssl_key=" + key);
String zoneId = "100200";
String zoneType = "pull";
String ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n";
String ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----";
MaxCDNRequest data = MaxCDN.newRequest("ssl_crt", "ssl_crt").append("ssl_key", "ssl_key");
MaxCDNObject response = api.post("/zones/"+zoneType+"/"+zoneId+"/ssl.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":201,
  "data":{
    "ssl":{
      "id":1459,
      "ssl_crt":"-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n",
      "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}.

PUT https://rws.maxcdn.com/{companyalias}/zones/{zone_type}/{zone_id}/ssl.json

Accepted Request Parameters

Parameter Default Value Validation Description
ssl_id - digit id of previously created certificate (NOTE: This will become required in future revisions)
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.  
ssl_sni 0 only 0 or 1 accepted If this flag is set to 1 your zone will use SNI to identify your certificate, rather than requiring a dedicated IP.

Response Parameters

Parameter Description
id The SSL Certificate ID.
ssl_crt The SSL certificate.
ssl_cabundle The CA Bundle for the certificate.
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)
my $id = 236828;
my $type = "pull";
my @params = ('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-----');
$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 = 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)
})
var cert = "";
var key = "";
Console.Write("Zone id: \n");
int zoneId = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();
using (StreamReader sr = new StreamReader("cert.txt"))
{
	cert = sr.ReadToEnd();               
}
using (StreamReader sr = new StreamReader("key.txt"))
{
	key = sr.ReadToEnd();
}
var dat = "";
cert = "-----BEGIN CERTIFICATE-----\n" + cert + "\n-----END CERTIFICATE-----\n";
key = "-----BEGIN RSA PRIVATE KEY-----\n" + key + "\n-----END RSA PRIVATE KEY-----\n";

api.Put("/zones/" + type + "/" + zoneId + "/ssl.json", dat="ssl_crt=" + cert + "&ssl_key=" + key);
String zoneId = "100200";
String zoneType = "pull";
String ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n";
String ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----";
MaxCDNRequest data = MaxCDN.newRequest("ssl_crt", "ssl_crt").append("ssl_key", "ssl_key");
MaxCDNObject response = api.put("/zones/"+zoneType+"/"+zoneId+"/ssl.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":201,
  "data":{
    "ssl":{
      "id":1459,
      "ssl_crt":"-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n",
      "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}.

DELETE https://rws.maxcdn.com/{companyalias}/zones/{zone_type}/{zone_id}/ssl.json

Code Samples

id = '96061'
type = 'pull'
api.delete('/zones/'+type+'/'+id+'/ssl.json')
id = '96061'
type = 'pull'
api.delete('/zones/'+type+'/'+id+'/ssl.json')
my $id = 236828;
my $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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();

api.Delete("/zones/" + type + "/" + zoneID + "/ssl.json");
String zoneId = "100200";
String zoneType = "pull";
MaxCDNObject response = api.delete("/zones/"+zoneType+"/"+zoneId+"/ssl.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "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}.

GET https://rws.maxcdn.com/{companyalias}/zones/{zone_type}/{zone_id}/upstream.json

Code Samples

type = 'pull'
id = '96061'
api.get('/zones/'+type+'/'+id+'/upstream.json')
type = 'pull'
id = '96061'
api.get('/zones/'+type+'/'+id+'/upstream.json')
my $id = 236828;
my $type = "pull";
$api->get("/zones/" . $type . "/" . $id . "/upstream.json");
$type = 'pull';
$id = '96061';
$api->get('/zones/'.$type.'/'.$id.'/upstream.json');
var type = 'pull'
var id = '96061'
api.get('/zones/' + type + '/' + id + '/upstream.json', function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();

api.Get("/zones/" + type + "/" + zoneID + "/upstream.json");
String zoneId = "100200";
String zoneType = "pull";
MaxCDNObject response = api.get("/zones/"+zoneType+"/"+zoneId+"/upstream.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{u'code': 200, u'data': {u'total': 1, u'upstreams': [{u'weight': u'1', u'id': u'121', u'bucket_id': u'96061', u'server': u'http://cdn.somedomain.com', u'backup': u'0', u'port': u'80'}]}}

Enable Upstream on Zone

Create and enable Upstream for a specific {zone_id}.

POST https://rws.maxcdn.com/{companyalias}/zones/{zone_type}/{zone_id}/upstream.json

Accepted Request Parameters

Parameter Default Value Validation Description
server - 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 The server URL or IP
port The port it uses to call the server

Code Samples

type = 'pull'
id = '96061'
params = {"server"=> "http://cdn.somedomain.com","port"=> "80"}
api.post('/zones/'+type+'/'+id+'/upstream.json', params)
type = 'pull'
id = '96061'
params = {"server": "http://cdn.somedomain.com","port": "80"}
api.post('/zones/'+type+'/'+id+'/upstream.json', params)
my $id = 96061;
my $type = "pull";
my @params = {server => 'http://cdn.somedomain.com', port => '80'};
$api->post("/zones/" . $type . "/" . $id . "/upstream.json", @params);
$type = 'pull';
$id = '96061';
$params = array("server"=>"http://cdn.somedomain.com","port"=>"80");
$api->post('/zones/'.$type.'/'.$id.'/upstream.json', $params);
var type = 'pull'
var id = '96061'
api.post('/zones/' + type + '/' + id + '/upstream.json', {server: 'http://cdn.somedomain.com', port: '80' }, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();

api.Post("/zones/" + type + "/" + zoneID + "/upstream.json", "server=http://cdn.somedomain.com&port=80");
String zoneId = "100200";
String zoneType = "pull";
MaxCDNRequest data = MaxCDN.newRequest("server", "http://cdn.somedomain.com").append("port", "80");
MaxCDNObject response = api.post("/zones/"+zoneType+"/"+zoneId+"/upstream.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);

  

Update Zone’s Upstream Information

Update the Upstream information for the specified {zone_id}.

PUT https://rws.maxcdn.com/{companyalias}/zones/{zone_type}/{zone_id}/upstream.json

Accepted Request Parameters

Parameter Default Value Validation Description
upstream_id - required
The Upstream Information you’re modifying
server - required
The server URL or IP
port - required
The port used to call the server

Response Parameters

Parameter Description
id The Upstream ID.
bucket_id The bucket_id it belongs to
server The server URL or IP
port The port it uses to call the server

Code Samples

type = 'pull'
id = '96061'
upstream_id = '123'
params = {"upstream_id"=> "93013","server"=> "http://somedomain.com","port"=> "80"}
api.put('/zones/'+type+'/'+id+'/upstream.json/'+upstream_id, params)
type = 'pull'
id = '96061'
upstream_id = '123'
params = {"upstream_id": "93013","server": "http://somedomain.net","port": "80"}
api.put('/zones/'+type+'/'+id+'/upstream.json/'+upstream_id, params)
my $id = 96061;
my $type = "pull";
my $upstream_id = "123";
my @params = ('upstream_id=93013', 'server=http://somedomain.net', 'port=80');
$api->put("/zones/" . $type . "/" . $id . "/upstream.json/" . $upstream_id, @params);
$type = 'pull';
$id = '96061';
$upstream_id = '123';
$params = array("upstream_id"=>"93013","server"=>"http://somedomain.net","port"=>"80");
$api->put('/zones/' . $type . '/' . $id . '/upstream.json/' . $upstream_id, $params);
var type = 'pull'
var id = '96061'
var upstream_id = '123'
api.put('/zones/' + type + '/' + id + '/upstream.json/' + upstream_id, { upstream_id: '93013', server: 'http://somedomain.net', port: '80' }, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();
Console.Write("Upstream ID: \n");
int upstreamID = Convert.ToInt32(Console.ReadLine());
Console.Write("Upstream ID: \n");
int upstream_id = Convert.ToInt32(Console.ReadLine());

api.Put("/zones/" + type + "/" + zoneID + "/upstream.json/" + upstream_id, "upstream_id=" + upstreamID + "&server=http://somedomain.com&port=80");
String zoneId = "100200";
String zoneType = "pull";
String upstreamId = "123";
MaxCDNRequest data = MaxCDN.newRequest("upstream_id", "9203").append("server", "http://cdn.somedomain.com").append("port", "80");
MaxCDNObject response = api.put("/zones/"+zoneType+"/"+zoneId+"/upstream.json"+upstreamId, data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);

  

Remove Zone’s Upstream Information

Remove the Upstream Information for the specified {zone_id}.

DELETE https://rws.maxcdn.com/{companyalias}/zones/{zone_type}/{zone_id}/upstream.json

Code Samples

type = 'pull'
id = '96061'
upstream_id = '123'
api.delete('/zones/'+type+'/'+id+'/upstream.json/'+upstream_id)
type = 'pull'
id = '96061'
upstream_id = '123'
api.delete('/zones/'+type+'/'+id+'/upstream.json/'+upstream_id)
my $id = 96061;
my $type = "pull";
my $upstream_id = "123";
$api->delete("/zones/" . $type . "/" . $id . "/upstream.json/" . $upstream_id);
$type = 'pull';
$id = '96061';
$upstream_id = '123';
$api->delete('/zones/' . $type . '/' . $id . '/upstream.json/' . $upstream_id);
var type = 'pull'
var id = '96061'
var upstream_id = '123'
api.delete('/zones/' + type + '/' + id + '/upstream.json/' + upstream_id, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();
Console.Write("Upstream ID: \n");
int upstream_id = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/" + type + "/" + zoneID + "/upstream.json/" + upstream_id);
String zoneId = "100200";
String zoneType = "pull";
String upstreamId = "123";
MaxCDNObject response = api.delete("/zones/"+zoneType+"/"+zoneId+"/upstream.json/"+upstreamId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);

  

Reports API

Get Account Stats

Gets the total usage statistics for your account, optionally broken up by {report_type}. If no {report_type} is given the request will return the total usage on your account.

GET https://rws.maxcdn.com/{companyalias}/reports/stats.json/{report_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
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)
my $reportType = ""; #Vaild 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)
})
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/stats.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/stats.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "stats": {
            "cache_hit": "0",
            "hit": "20",
            "noncache_hit": "20",
            "size": "0"
        },
        "total": "1"
    }
}

Get All Zone Stats

Gets the total usage statistics for each of your zones, optionally broken up by {report_type}. If no {report_type} is given the timestamp response parameter will be omitted.

GET https://rws.maxcdn.com/{companyalias}/reports/statsbyzone.json/{report_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
bucket_id The Zone ID that corresponds to this set of stats
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/statsbyzone.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statsbyzone.json'+reportType)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
$api->get("/reports/statsbyzone.json" . $reportType);
$reportType = ''; //Vaild input includes '/daily', '/hourly', '/monthly' or ''
$api->get('/reports/statsbyzone.json/'.$reportType);
var reportType = '' //Vaild input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statsbyzone.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/statsbyzone.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/statsbyzone.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code": 200,
  "data": {
    "page": 1,
    "pages": 262,
    "page_size": 50,
    "current_page_size": 50,
    "total": 13097,
    "stats": [
      {
        "zone_id": "4816",
        "size": "20318527",
        "hit": "280",
        "cache_hit": "15",
        "noncache_hit": "265"
      },
      {
        "zone_id": "5023",
        "size": "18032138",
        "hit": "119120",
        "cache_hit": "0",
        "noncache_hit": "119120"
      },
      {
        "zone_id": "5045",
        "size": "10656749286",
        "hit": "950640",
        "cache_hit": "838432",
        "noncache_hit": "112208"
      },

      ....

    ],
    "summary": {
      "size": 5.7138288549144e+14,
      "hit": 17093013874,
      "cache_hit": 14815205275,
      "noncache_hit": 2277808599
    }
  }
}

Get a Zone’s Stats

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.

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/stats.json/{report_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
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $id = 96061;
$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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneID + "/stats.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
String zoneId = "100200";
MaxCDNObject response = api.get("/reports/"+zoneId+"/stats.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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)

GET https://rws.maxcdn.com/{companyalias}/reports/nodes.json

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');
api.get('/reports/nodes.json', function(err, response) {
  console.log('err', err, 'response', response)
})
api.Get("/reports/nodes.json");
MaxCDNObject response = api.get("/reports/nodes.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/nodes.json

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')
my $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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());

api.Get("/reports/" + zoneID + "/nodes.json");
String nodeId = "2";
MaxCDNObject response = api.get("/reports/"+nodeId+"/nodes.json"));
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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.

GET https://rws.maxcdn.com/{companyalias}/reports/nodes.json/stats/{report_type}

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 not empty
pop_description Full node name, only returned when {report_type} is not empty
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)
my $reportType = ""; #Vaild 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)
})
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/nodes.json/stats" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/nodes.json/stats"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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.

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/nodes.json/stats/{report_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
pop_id Node Id
pop_name Node 3 letter code, only returned when {report_type} is not empty
pop_description Full node name, only returned when {report_type} is not empty
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $id = 96061;
$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)
})
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneID + "/nodes.json/stats" + reportType);
String nodeId = "2";
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/"+nodeId+"/nodes.json/stats"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

GET https://rws.maxcdn.com/{companyalias}/reports/nodes.json/{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)
my $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)
})
Console.Write("Node ID: \n");
int nodeID = Convert.ToInt32(Console.ReadLine());

api.Get("/reports/nodes.json/" + nodeID);
String nodeId = "2";
MaxCDNObject response = api.get("/reports/nodes.json/"+nodeId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/nodes.json/{node_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)
my $zoneId = 96061;
my $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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Node ID: \n");
int nodeID = Convert.ToInt32(Console.ReadLine());

api.Get("/reports/" + zoneID + "/nodes.json/" + nodeID);
String zoneId = "100200";
String nodeId = "2";
MaxCDNObject response = api.get("/reports/"+zoneId+"/nodes.json/"+nodeId);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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.

GET https://rws.maxcdn.com/{companyalias}/reports/nodes.json/{node_id}/stats/{report_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
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $id = 1;
$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)
})
Console.Write("Node ID: \n");
int nodeID = Convert.ToInt32(Console.ReadLine());
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/nodes.json/" + nodeID + "/stats" + reportType);
String nodeId = "2";
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/nodes.json/"+nodeId+"/stats"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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.

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/nodes.json/{node_id}/stats/{report_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
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $zoneId = 96061;
my $nodeId = 1;
$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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Node ID: \n");
int nodeID = Convert.ToInt32(Console.ReadLine());
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneID + "/nodes.json/" + nodeID + "/stats" + reportType);
String zoneId = "100200";
String nodeId = "2";
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/"+zoneId+"/nodes.json/"+nodeId+"/stats"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "stats": [
            {
                "cache_hit": null,
                "hit": null,
                "noncache_hit": null,
                "size": null
            }
        ],
        "total": "0"
    }
}

Reports by Popular Files API

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

GET https://rws.maxcdn.com/{companyalias}/reports/popularfiles.json

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 UTC timestamp of the request

Code Samples

api.get('/reports/popularfiles.json')
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)
})
api.Get("/reports/popularfiles.json");
MaxCDNObject response = api.get("/reports/popularfiles.json");
	  Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "popularfiles": [],
        "summary": {
            "hit": null,
            "size": null
        },
        "total": "0"
    }
}

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

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_type}/popularfiles.json

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 UTC timestamp of the request

Code Samples

type='pull'
api.get('/reports/'+type+'/popularfiles.json')
type='pull'
api.get('/reports/'+type+'/popularfiles.json')
my $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)
})
Console.Write("Zone type: \n");
string type = Console.ReadLine();
	
api.Get("/reports/" + type + "/popularfiles.json");
String zoneType = "pull";
MaxCDNObject response = api.get("/reports/"+zoneType+"/popularfiles.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/reports/statuscodes.json/{report_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 ''
api.get('/reports/statuscodes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/statuscodes.json'+reportType)
my $reportType = ""; #Vaild 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)
})
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/statuscodes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/statuscodes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/statuscodes.json/{report_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 ''
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $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)
})
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n"); 
string reportType = Console.ReadLine();
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());

api.Get("/reports/" + zoneID + "/statuscodes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
String zoneId = "100200";
MaxCDNObject response = api.get("/reports/"+zoneId+"/statuscodes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_type}/statuscodes.json/{report_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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $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)
})
Console.Write("Zone type: \n");
string zoneType = Console.ReadLine();
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneType + "/statuscodes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
String zoneType = "pull";
MaxCDNObject response = api.get("/reports/"+zoneType+"/statuscodes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "statuscodes": [
            {
                "definition": "Not Found",
                "hit": "20",
                "status_code": "404"
            }
        ],
        "summary": {
            "hit": "20"
        },
        "total": "1"
    }
}

List Status Codes by Zone Id and Zone Type

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

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_type}/{zone_id}/statuscodes.json/{report_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'
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $id = 96061;
my $zoneType = "pull";
$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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string zoneType = Console.ReadLine();
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneType + "/" + zoneID + "/statuscodes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
String zoneType = "pull";
String zoneId = "100200";
MaxCDNObject response = api.get("/reports/"+zoneType+"/"+zoneId+"/statuscodes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "statuscodes": [],
        "summary": {
            "hit": null
        },
        "total": "0"
    }
}

Reports by File Types API

List File Types

Gets file type statistics for your account

GET https://rws.maxcdn.com/{companyalias}/reports/filetypes.json/{report_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
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', '/monthly' or ''
api.get('/reports/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/monthly' or ''
api.get('/reports/filetypes.json'+reportType)
my $reportType = ""; #Vaild input includes /daily, /monthly or ""
$api->get("/reports/filetypes.json" . $reportType);
$reportType = ''; //Vaild input includes '/daily', '/monthly' or ''
$api->get('/reports/filetypes.json'.$reportType);
var reportType = '' //Valid input includes '/daily', '/monthly' or ''
api.get('/reports/filetypes.json', function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Report type (/daily, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/filetypes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/monthly" or ""
MaxCDNObject response = api.get("/reports/filetypes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/filetypes.json/{report_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
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', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/monthly' or ''
id = '96061'
api.get('/reports/'+id+'/filetypes.json'+reportType)
my $reportType = ""; #Vaild input includes /daily, /monthly or ""
my $id = 96061;
$api->get("/reports/" . $id . "/filetypes.json" . $reportType);
$reportType = ''; //Vaild input includes '/daily', '/monthly' or ''
$id = '96061';
$api->get('/reports/'.$id.'/filetypes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/monthly' or ''
var id = '96061'
api.get('/reports/' + id + '/filetypes.json/' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Report type (/daily, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneID + "/filetypes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/monthly" or ""
String zoneId = "100200";
MaxCDNObject response = api.get("/reports/"+zoneId+"/filetypes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_type}/filetypes.json/{report_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', '/monthly' or ''
zoneType = 'pull'
api.get('/reports/'+zoneType+'/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/monthly' or ''
zoneType = 'pull'
api.get('/reports/'+zoneType+'/filetypes.json'+reportType)
my $reportType = ""; #Vaild input includes /daily, /monthly or ""
my $zoneType = "pull";
$api->get("/reports/" . $zoneType . "/filetypes.json" . $reportType);
$reportType = ''; //Vaild input includes '/daily', '/monthly' or ''
$zoneType = 'pull';
$api->get('/reports/'.$zoneType.'/filetypes.json'.$reportType);
var reportType = '' //Valid input includes '/daily', '/monthly' or ''
var zoneType = 'pull'
api.get('/reports/' + zoneType + '/filetypes.json' + reportType, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone type: \n");
string zoneType = Console.ReadLine();
Console.Write("Report type (/daily, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneType + "/filetypes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/monthly" or ""
String zoneType = "pull";
MaxCDNObject response = api.get("/reports/"+zoneType+"/filetypes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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}

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_type}/{zone_id}/filetypes.json/{report_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
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', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/filetypes.json'+reportType)
reportType = '' #Valid input includes '/daily', '/monthly' or ''
zoneType = 'pull'
id = '96061'
api.get('/reports/'+zoneType+'/'+id+'/filetypes.json'+reportType)
my $reportType = ""; #Vaild input includes /daily, /monthly or ""
my $zoneType = "pull";
my $id = 96061;
$api->get("/reports/" . $zoneType . "/" . $id . "/filetypes.json" . $reportType);
$reportType = ''; //Vaild input includes '/daily', '/monthly' or ''
$zoneType = 'pull';
$id = '96061';
$api->get('/reports/'.$zoneType.'/'.$id.'/filetypes.json/'.$reportType);
var reportType = '' //Valid input includes '/daily', '/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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string zoneType = Console.ReadLine();
Console.Write("Report type (/daily, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneType + "/" + zoneID + "/filetypes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/monthly" or ""
String zoneType = "pull";
String zoneId = "100200";
MaxCDNObject response = api.get("/reports/"+zoneType+"/"+zoneId+"/filetypes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/reports/filesizes.json/{report_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
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 ''
api.get('/reports/filesizes.json' + reportType)
reportType = '' #Valid input includes '/daily', '/hourly', '/monthly' or ''
api.get('/reports/filesizes.json'+reportType)
my $reportType = ""; #Vaild 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)
})
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();
     
api.Get("/reports/filesizes.json/" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/filesizes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/filesizes.json/{report_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
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();
     
api.Get("/reports/" + zoneID + "/filesizes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
String zoneId = "100200";
MaxCDNObject response = api.get("/reports/"+zoneId+"/filesizes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_type}/filesizes.json/{report_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
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 = ''; #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)
})
Console.Write("Zone type: \n");
string zoneType = Console.ReadLine();
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();
     
api.Get("/reports/" + zoneType + "/filesizes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
String zoneType = "pull";
MaxCDNObject response = api.get("/reports/"+zoneType+"/filesizes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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 Type and Zone ID

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

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_type}/{zone_id}/filesizes.json/{report_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
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $zoneType = "pull";
my $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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string zoneType = Console.ReadLine();
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneType + "/" + zoneID + "/filesizes.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
String zoneType = "pull";
String zoneId = "100200";
MaxCDNObject response = api.get("/reports/"+zoneType+"/"+zoneId+"/filesizes.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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 our sales department)

GET https://rws.maxcdn.com/{companyalias}/reports/statsbydir.json/{report_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
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)
my $reportType = ""; #Vaild 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)
})
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/statsbydir.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
MaxCDNObject response = api.get("/reports/statsbydir.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "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 our sales department)

GET https://rws.maxcdn.com/{companyalias}/reports/{zone_id}/statsbydir.json/{report_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
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)
my $reportType = ""; #Vaild input includes /daily, /hourly, /monthly or ""
my $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)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());
Console.Write("Report type (/daily, /hourly, /monthly or empty string): \n");
string reportType = Console.ReadLine();

api.Get("/reports/" + zoneID + "/statsbydir.json" + reportType);
String reportType = ""; //Valid input includes "/daily", "/hourly", "/monthly" or ""
String zoneId = "100200";
MaxCDNObject response = api.get("/reports/"+zoneId+"/statsbydir.json"+reportType);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "current_page_size": 0,
        "page": 1,
        "page_size": "50",
        "pages": 0,
        "statsbydir": [],
        "summary": {
            "hit": null,
            "size": null
        },
        "total": "0"
    }
}

Raw Logs API

Get Raw Logs

Retrieve up to five days of raw log data

GET https://rws.maxcdn.com/{companyalias}/v3/reporting/logs.json

Accepted Request Parameters

Parameter Default Value Validation Description
start now() - 1 hour ISO-8601 formatted date/time The start of the range for requests to pull.
end now() ISO-8601 formatted date/time The end of the range for requests to pull
zones - CSV of ints The specific zones whose requests you want to pull. Separate multiple zone ids by comma
uri - string Use this filter to view requests made for a specific resource (or group of resources). You can do a literal match or regular expression in this field (i.e. ‘/images/header.png’ or ‘regex:/images/’)
status - CSV of ints The specific HTTP status code responses you want to pull. Separate multiple HTTP status codes by comma (i.e. 200,201,304)
ssl both enum(nossl, ssl, both) Use this filter to distinguish between SSL and non-SSL traffic (choose nossl, ssl or both)
user_agent - string Filter logs by specific user agents. You can do a literal match or regular expression in this field (i.e. ‘Python MaxCDN API Client’ or ‘regex:Chrome’)
referer - string Filter logs by a specific referer. You can do a literal match or regular expression in this field (i.e. ‘www.maxcdn.com’ or ‘regex:maxcdn.com’)
pop - CSV of strings Filter logs by specific POPs (Points Of Presence), use comma separation for multiple POPs. Possible values: ams, atl, aus, chi, dal, den, fra, hkg, jfk, lax, lhr, mia, sea, sfo, sin, sjc, slc, tko, vir
query_string - string Filter logs by a specific query string. You can do a literal match or regular expression in this field (i.e. ‘width=600’ or ‘regex:width’)
limit 100 int How many records should be retrieved per page. Maximum is 1000
start_key - string String-based key for next page of records to return, for easy pagination or streaming. This key will be provided in the “next_page_key” from a response.
sort recent enum(recent, oldest) Display records sorted by newest first or oldest first

Response Parameters

Parameter Description
limit The maximum number of records retrieved
page The current page of records retrieved
request_time Time in milliseconds for request to complete
next_page_key Number string that can be used to load the next page
records Total records displayed
bytes Total bytes of request
client_asn Visitor’s “access network” (ISP)
client_city Visitor’s city
client_continent Visitor’s continent
client_country Visitor’s country
client_dma Visitor’s “designated market area”
client_ip Visitor’s public IP
client_latitude Visitor’s geographical latitude (roughly)
client_longitude Visitor’s geographical longitude (roughly)
client_state Visitor’s state
company_id Your company ID
cache_status CDN status of the file (HIT, MISS)
hostname Domain name that was visited
method HTTP request method
origin_time How long it takes MaxCDN to retrieve the file (if cache status was a MISS)
pop Point Of Presence that was hit (LAX, LHR, TYO, etc.)
protocol HTTP protocol used
query_string Query string attached to a file (ex. ver=1.2)
referer Referring site
scheme HTTP or HTTPS
status HTTP status code (200, 404, 302, etc.)
time UTC timestamp of the request
uri File requested
user_agent Text identifying the visitor’s browser
zone_id ID of the Push/Pull/VOD zone hit

Code Samples

api.get('/v3/reporting/logs.json?start=2014-01-30&end=2014-01-31&status=200')
params = {"start":"2014-01-30", "end":"2014-01-31", "status":"200"}
api.get('/v3/reporting/logs.json', data=params)
$api->get("/v3/reporting/logs.json?start=2014-01-30&end=2014-01-31&status=200");
$params = array("start"=>"2014-01-30", "end"=>"2014-01-31", "status"=>"200")
$api->get('/v3/reporting/logs.json', $params)
api.get('/v3/reporting/logs.json?start=2014-01-30&end=2014-01-31&status=200', function(err, response) {
  console.log(response);
});
api.Get("/v3/reporting/logs.json?start=2014-01-30&end=2014-01-31&status=200");
Console.log(api.get("/v3/reporting/logs.json?start=2015-12-01&end=2015-12-02&status=200"));
{
  "limit":1000,
  "page":1,
  "total":3,
  "next_page_key":"1234abcdef",
  "records":[
    {
      "bytes":175953,
      "asn":"AS4804 Microplex PTY LTD",
      "city":"Brisbane",
      "continent":"OC",
      "country":"AU",
      "dma":"0",
      "ip":"127.0.0.1",
      "latitude":0,
      "longitude":1.2345,
      "cache_status":"HIT",
      "hostname":"cdn.example.com",
      "method":"GET",
      "origin_time":"0",
      "pop":"lax",
      "protocol":"HTTP/1.1",
      "query_string":"",
      "scheme":"https",
      "status_code":200,
      "request_time":"2014-01-30T17:00:12Z",
      "uri":"/content.png",
      "user_agent":"Opera/9.80 (Windows NT 5.1; Edition DriverPack) Presto/2.12.388 Version/12.16",
      "zone":"example"
    },
    {
      "bytes":175953,
      "asn":"AS4804 Microplex PTY LTD",
      "city":"Brisbane",
      "continent":"OC",
      "country":"AU",
      "dma":"0",
      "ip":"127.0.0.1",
      "latitude":0.0,
      "longitude":0.12345,
      "cache_status":"HIT",
      "hostname":"cdn.example.com",
      "method":"GET",
      "origin_time":"0",
      "pop":"lax",
      "protocol":"HTTP/1.1",
      "query_string":"ver=1.2",
      "scheme":"https",
      "status_code":200,
      "request_time":"2014-01-30T17:00:12Z",
      "uri":"/sample/test.swf",
      "user_agent":"Opera/9.80 (Windows NT 5.1; Edition DriverPack) Presto/2.12.388 Version/12.16",
      "zone":"example"
    }
  ]
}

Origin Shield API

Enable Origin Shield

Enable an Origin Shield on your Pull Zone

POST https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/zoneshields.json

Accepted Request Parameters

Parameter Description
location Possible values: sjc for San Jose, vir for Virginia

Response Parameters

Parameter Description
id The numerical ID of your request
zone_id Your Pull Zone ID
reporting_code The chosen geographical location of the Origin Shield

Code Samples

id = '97167'
params = {"location"=>"sjc"}
api.post('/zones/pull/'+id+'/zoneshields.json', params)
id = '97167'
params = {"location":"sjc"}
api.post('/zones/pull/'+id+'/zoneshields.json', params)
my $id = 123502;
my @params = {location => 'sjc'};
$api->post("/zones/pull/" . $id . "/zoneshields.json", @params);
$id = '97167';
$params = array("location"=>"sjc");
$api->post('/zones/pull/'.$id.'/zoneshields.json', $params)
var id = '96167'
api.post('/zones/pull/' + id + '/zoneshields.json', { location: 'sjc' }, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());

api.Post("/zones/pull/" + zoneID + "/zoneshields.json", "location=sjc");
String zoneId = "100200";
MaxCDNRequest data = MaxCDN.newRequest("location", "sjc");
MaxCDNObject response = api.post("/zones/pull/"+zoneId+"/zoneshields.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "data": {
    "zoneshields": [
      {
        "id": 26,
        "zone_id": "97167",
        "reporting_code": "sjc",
      },
    ]
  },
  "code": 201
}

Update Origin Shield

Update the active Origin Shield for your Pull Zone

PUT https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/zoneshields.json

Accepted Request Parameters

Parameter Description
location Possible values: sjc for San Jose, vir for Virginia

Response Parameters

Parameter Description
id The numerical ID of your request
zone_id Your Pull Zone ID
reporting_code The chosen geographical location of the Origin Shield

Code Samples

id = '97167'
params = {"location"=>"sjc"}
api.put('/zones/pull/'+id+'/zoneshields.json', params)
id = '97167'
params = {"location":"sjc"}
api.put('/zones/pull/'+id+'/zoneshields.json', params)
my $id = 123502;
my @params = ('location=sjc');
$api->put("/zones/pull/" . $id . "/zoneshields.json", @params);
$id = '97167';
$params = array("location"=>"sjc");
$api->put('/zones/pull/'.$id.'/zoneshields.json', $params)
var id = '96167'
api.put('/zones/pull/' + id + '/zoneshields.json', { location: 'sjc' }, function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());

api.Put("/zones/pull/" + zoneID + "/zoneshields.json", "location=sjc");
String zoneId = "100200";
MaxCDNRequest data = MaxCDN.newRequest("location", "vir");
MaxCDNObject response = api.put("/zones/pull/"+zoneId+"/zoneshields.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "data": {
    "zoneshields": [
      {
        "id": 26,
        "zone_id": "97167",
        "reporting_code": "sjc",
      },
    ]
  },
  "code": 201
}

Delete Origin Shield

Remove the active Origin Shield from your Pull Zone

DELETE https://rws.maxcdn.com/{companyalias}/zones/pull/{zone_id}/zoneshields.json

Code Samples

id = '97167'
api.delete('/zones/pull/'+id+'/zoneshields.json')
id = '97167'
api.delete('/zones/pull/'+id+'/zoneshields.json')
my $id = 123502;
$api->delete("/zones/pull/" . $id . "/zoneshields.json");
$id = '97167';
$api->delete('/zones/pull/'.$id.'/zoneshields.json')
var id = '96167'
api.delete('/zones/pull/' + id + '/zoneshields.json', function(err, response) {
  console.log('err', err, 'response', response)
})
Console.Write("Zone ID: \n");
int zoneID = Convert.ToInt32(Console.ReadLine());

api.Delete("/zones/pull/" + zoneID + "/zoneshields.json");
String zoneId = "100200";
MaxCDNObject response = api.delete("/zones/pull/"+zoneId+"/zoneshields.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code); 
{
  "code": 200
}

SSL Certificate API

List Certificates

Returns a list of all certificates on the specified account

GET https://rws.maxcdn.com/{companyalias}/ssl.json

Response Parameters

Parameter Description
certificates An array of certificates for the given user

Code Samples

api.get('/ssl.json')
api.get('/ssl.json')
$api->get("/ssl.json");
$api->get('/ssl.json');
api.get('/ssl.json', callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
api.Get("/ssl.json");
MaxCDNObject response = api.get("/ssl.json");
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "current_page_size": 1,
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "total": 1,
        "certificates": [
            {
                "id": "1234",
                "company_id": "42",
                "domain": "*.example.com",
                "zone_count": "5",
                "date_updated": "2013-05-15 17:33:09",
                "date_expiration": "2015-11-15",
                "ssl_cabundle": "",
                "globalsign": "0",
                "wilcard": "1",
                "ssl_crt": "-----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----",
                "name": "auto_*.example.com_2015-11-15_2013-05-15:173309"
            }
        ]
    }
}

Create Certificate

Creates a new SSL Certificate on the specified account

POST https://rws.maxcdn.com/{companyalias}/ssl.json

Accepted Request Parameters

Parameter Default Value Validation Description
ssl_crt - required
length: text;
Certificate
ssl_key - required
length: text
Certificate Private Key
ssl_cabundle - length: text Certificate Authority Intermediate Bundle
name auto_{domain}{expiration}{update} length: 1-255 Use descriptive name

Response Parameters

Parameter Description
ssl The information about the certificate (see List Certificates response)

Code Samples

params={"ssl_crt"=>"-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----","ssl_key"=>"-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----","ssl_cabundle"=>"-----BEGIN CERTIFICATE.....", "name"=>"Our *.example.com wildcard"}
api.post('/ssl.json',params )
params = array("ssl_crt": "-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----","ssl_key": "-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----","ssl_cabundle": "-----BEGIN CERTIFICATE.....", "name": "Our *.example.com wildcard");
api.post('/ssl.json',data=params )
my @params = {ssl_crt => '-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----', ssl_key => '-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----","ssl_cabundle"=>"-----BEGIN CERTIFICATE.....", "name"=>"Our .example.com wildcard');
$api->post("/ssl.json", @params );
  
$params = array("ssl_crt"=>"-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----","ssl_key"=>"-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----","ssl_cabundle"=>"-----BEGIN CERTIFICATE.....", "name"=>"Our *.example.com wildcard");
$api->post('/ssl.json',$params );
api.post('/ssl.json', { ssl_crt:"-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----",ssl_key:"-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----",ssl_cabundle:"-----BEGIN CERTIFICATE.....",name:"Our *.example.com wildcard" }, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
var cert = "";
var key = "";
Console.Write("Zone id: \n");
int zoneId = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();
using (StreamReader sr = new StreamReader("cert.txt"))
{
cert = sr.ReadToEnd();               
}
using (StreamReader sr = new StreamReader("key.txt"))
{
key = sr.ReadToEnd();
}
var dat = "";
cert = "-----BEGIN CERTIFICATE-----\n" + cert + "\n-----END CERTIFICATE-----\n";
key = "-----BEGIN RSA PRIVATE KEY-----\n" + key + "\n-----END RSA PRIVATE KEY-----\n";

api.Post("/ssl.json", dat="ssl_crt=" + cert + "&ssl_key=" + key);
String ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n";
String ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----";
String name = "Our *.example.com wildcard";
MaxCDNRequest data = MaxCDN.newRequest("ssl_crt", "ssl_crt").append("ssl_key", "ssl_key").append("name", "name");
MaxCDNObject response = api.post("/ssl.json", data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
        "current_page_size": 1,
        "page": 1,
        "page_size": "50",
        "pages": 1,
        "total": 1,
        "ssl": 
            {
                "id": "1234",
                "company_id": "42",
                "domain": "*.example.com",
                "zone_count": "5",
                "date_updated": "2013-05-15 17:33:09",
                "date_expiration": "2015-11-15",
                "ssl_cabundle": "",
                "globalsign": "0",
                "wilcard": "1",
                "ssl_crt": "-----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----",
                "name": "Our *.example.com wildcard"
            }
    }
}

Get SSL Certificate

Gets a specific SSL certificate by the {ssl_id} parameter

GET https://rws.maxcdn.com/{companyalias}/ssl.json/{ssl_id}

Response Parameters

Parameter Description
ssl The information about the certificate (see List Certificates response)

Code Samples

id = '1234'
api.get('/ssl.json/'+id)
id = '1234'
api.get('/ssl.json/'+id)
my $id = 1234;
$api->get("/ssl.json/" . $id);
$id = '1234';
$api->get('/ssl.json/'.$id);
var id = '1234'
api.get('/ssl.json/' + id, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
String sslId = "1234";
MaxCDNObject response = api.get("/ssl.json/"+sslId));
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
       "ssl": 
            {
                "id": "1234",
                "company_id": "42",
                "domain": "*.example.com",
                "zone_count": "5",
                "date_updated": "2013-05-15 17:33:09",
                "date_expiration": "2015-11-15",
                "ssl_cabundle": "",
                "globalsign": "0",
                "wilcard": "1",
                "ssl_crt": "-----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----",
                "name": "Our *.example.com wildcard"
            }
        }
    }
}

Update SSL Certificate

Updates an SSL Certificate

PUT https://rws.maxcdn.com/{companyalias}/ssl.json

Accepted Request Parameters

Parameter Default Value Validation Description
ssl_crt - required
length: text;
Certificate
ssl_key - required
length: text
Certificate Private Key
ssl_cabundle - length: text Certificate Authority Intermediate Bundle
name auto_{domain}{expiration}{update} length: 1-255 Use descriptive name
force 0 digit Override check to ensure that the domain has not changed

Response Parameters

Parameter Description
ssl The information about the certificate (see List Certificates response)

Code Samples

id = '1234'
params={"ssl_crt"=>"-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----","ssl_key"=>"-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----","ssl_cabundle"=>"-----BEGIN CERTIFICATE.....", "name"=>"Our *.example.com wildcard"}
api.put('/ssl.json/'+id,params)
api.put('/ssl.json/'+id,params={ 'ssl_crt':"-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----",'ssl_key':"-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----",'ssl_cabundle':"-----BEGIN CERTIFICATE.....",'name':"Our new *.example.com wildcard" })
my $id = 1234;
my @params = ('ssl_crt=-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----', 'ssl_key=-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----","ssl_cabundle"=>"-----BEGIN CERTIFICATE.....', 'name=Our.example.com-wildcard');
$api->put("/ssl.json/" . $id, @params);
$id = '1234';
$params = array("ssl_crt"=>"-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----","ssl_key"=>"-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----","ssl_cabundle"=>"-----BEGIN CERTIFICATE.....", "name"=>"Our *.example.com wildcard");
$api->put('/ssl.json/'.$id,$params);
var id = '1234'
api.put('/ssl.json/' + id, { ssl_crt:"-----BEGIN CERTIFICATE-----\n{ you certificate info }\n-----END CERTIFICATE-----",ssl_key:"-----BEGIN RSA PRIVATE KEY-----\n{ your private key info}\n-----END RSA PRIVATE KEY-----",ssl_cabundle:"-----BEGIN CERTIFICATE.....",name:"Our *.example.com wildcard" }, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
var cert = "";
var key = "";
Console.Write("Zone id: \n");
int zoneId = Convert.ToInt32(Console.ReadLine());
Console.Write("Zone type: \n");
string type = Console.ReadLine();
using (StreamReader sr = new StreamReader("cert.txt"))
{
cert = sr.ReadToEnd();               
}
using (StreamReader sr = new StreamReader("key.txt"))
{
key = sr.ReadToEnd();
}

var dat = "";
cert = "-----BEGIN CERTIFICATE-----\n" + cert + "\n-----END CERTIFICATE-----\n";
key = "-----BEGIN RSA PRIVATE KEY-----\n" + key + "\n-----END RSA PRIVATE KEY-----\n";

api.Put("/ssl.json/" + zoneID, dat="ssl_crt=" + cert + "&ssl_key=" + key);
String sslId = "1234";
String ssl_crt = "-----BEGIN CERTIFICATE-----\n{ ... your certificate ... }\n-----END CERTIFICATE-----\n";
String ssl_key = "-----BEGIN RSA PRIVATE KEY-----\n{ ... your key ... }\n-----END RSA PRIVATE KEY-----";
MaxCDNRequest data = MaxCDN.newRequest("ssl_crt", "ssl_crt").append("ssl_key", "ssl_key");
MaxCDNObject response = api.put("/ssl.json"+sslId, data);
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
    "code": 200,
    "data": {
      "ssl": 
            {
                "id": "1234",
                "company_id": "42",
                "domain": "*.example.com",
                "zone_count": "5",
                "date_updated": "2013-05-15 17:33:09",
                "date_expiration": "2015-11-15",
                "ssl_cabundle": "",
                "globalsign": "0",
                "wilcard": "1",
                "ssl_crt": "-----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----",
                "name": "Our *.example.com wildcard"
            }
    }
}

Delete SSL Certificiate

Deletes a certificate specified by the {ssl_id} parameter

DELETE https://rws.maxcdn.com/{companyalias}/ssl.json/{ssl_id}

Code Samples

id = '1234'
api.delete('/ssl.json/'+id)
id = '1234'
api.delete('/ssl.json/'+id)
my $id = 1234;
$api->delete("/ssl.json/" . $id);
$id = '1234';
$api->delete('/ssl.json/'.$id);
var id = '1234'
api.delete('/ssl.json/' + id, callback)
function callback(err, response) {
  if (err) return console.log(err)
  console.log(response)
}
Console.Write("Zone id: \n");
int zoneId = Convert.ToInt32(Console.ReadLine());

api.Delete("/ssl.json/" + zoneId);
String sslId = "1234";
MaxCDNObject response = api.delete("/ssl.json/"+sslId));
Console.log(response.error ? "Error " + response.getErrorMessage()  : response.code);
{
  "code":200
}