CDN Resources

Available endpoints:
NameMethodPath
get/v3/cdn
post/v3/cdn
get/v3/cdn/{id}
patch/v3/cdn/{id}
delete/v3/cdn/{id}
get/v3/cdn/{id}/cname
post/v3/cdn/{id}/cname
put/v3/cdn/{id}/datacenters
get/v3/cdn/{id}/datacenters

List of CDN Resources

gethttps://api.cdn77.com/v3/cdn

Responses

200List of CDN Resources
// response
[
  {
    "id": 1234567890,
    "cnames": [
      {
        "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
        "cname": "cname.your-domain.com"
      }
    ],
    "creation_time": "2021-11-26T13:56:53.212Z",
    "label": "My cdn",
    "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
    "origin_protection": {
      "enabled": true
    },
    "url": "1234567890.rsc.cdn77.org",
    "cache": {
      "max_age": 1440,
      "requests_with_cookies_enabled": true
    },
    "secure_token": {
      "token": "T9WQQX4SV5",
      "type": "parameter"
    },
    "query_string": {
      "parameters": [
        "utm"
      ],
      "ignore_type": "all"
    },
    "headers": {
      "cors_enabled": true,
      "host_header_forwarding_enabled": true
    },
    "https_redirect": {
      "code": 301,
      "enabled": true
    },
    "instant_ssl": {
      "enabled": true
    },
    "mp4_pseudo_streaming": {
      "enabled": true
    },
    "quic": {
      "enabled": true
    },
    "waf": {
      "enabled": true
    },
    "hotlink_protection": {
      "domains": [
        "some-domain.com"
      ],
      "type": "passlist",
      "empty_referer_denied": true
    },
    "ip_protection": {
      "ips": [
        "8.8.8.8"
      ],
      "type": "passlist"
    },
    "geo_protection": {
      "countries": [
        "UK"
      ],
      "type": "passlist"
    }
  }
]

Add CDN Resource

posthttps://api.cdn77.com/v3/cdn

Request bodyrequired

// request body
{
  "cnames": [
    "cname.your-domain.com"
  ],
  "label": "My cdn",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736"
}
cnames
array of strings

All CNAMEs should be mapped via DNS to CDN URL. Otherwise it's not possible to generate SSL certificate. Maximum number of CNAMEs is "10". To add more, contact our support.

label
requiredstring

The label helps you to identify your CDN Resource.

origin_id
requiredstring

ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.

Responses

201CDN Resource created.
// response
{
  "id": 1234567890,
  "cnames": [
    {
      "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
      "cname": "cname.your-domain.com"
    }
  ],
  "creation_time": "2021-11-26T13:56:53.212Z",
  "label": "My cdn",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "origin_protection": {
    "enabled": true
  },
  "url": "1234567890.rsc.cdn77.org",
  "cache": {
    "max_age": 1440,
    "requests_with_cookies_enabled": true
  },
  "secure_token": {
    "token": "T9WQQX4SV5",
    "type": "parameter"
  },
  "query_string": {
    "parameters": [
      "utm"
    ],
    "ignore_type": "all"
  },
  "headers": {
    "cors_enabled": true,
    "host_header_forwarding_enabled": true
  },
  "https_redirect": {
    "code": 301,
    "enabled": true
  },
  "instant_ssl": {
    "enabled": true
  },
  "mp4_pseudo_streaming": {
    "enabled": true
  },
  "quic": {
    "enabled": true
  },
  "waf": {
    "enabled": true
  },
  "hotlink_protection": {
    "domains": [
      "some-domain.com"
    ],
    "type": "passlist",
    "empty_referer_denied": true
  },
  "ip_protection": {
    "ips": [
      "8.8.8.8"
    ],
    "type": "passlist"
  },
  "geo_protection": {
    "countries": [
      "UK"
    ],
    "type": "passlist"
  }
}
422Unable to create CDN Resource.

Detail of CDN Resource

gethttps://api.cdn77.com/v3/cdn/{id}

Request parameters

id
requiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Responses

200Detail of the given CDN Resource returned.
// response
{
  "id": 1234567890,
  "cnames": [
    {
      "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
      "cname": "cname.your-domain.com"
    }
  ],
  "creation_time": "2021-11-26T13:56:53.213Z",
  "label": "My cdn",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "origin_protection": {
    "enabled": true
  },
  "url": "1234567890.rsc.cdn77.org",
  "cache": {
    "max_age": 1440,
    "requests_with_cookies_enabled": true
  },
  "secure_token": {
    "token": "T9WQQX4SV5",
    "type": "parameter"
  },
  "query_string": {
    "parameters": [
      "utm"
    ],
    "ignore_type": "all"
  },
  "headers": {
    "cors_enabled": true,
    "host_header_forwarding_enabled": true
  },
  "https_redirect": {
    "code": 301,
    "enabled": true
  },
  "instant_ssl": {
    "enabled": true
  },
  "mp4_pseudo_streaming": {
    "enabled": true
  },
  "quic": {
    "enabled": true
  },
  "waf": {
    "enabled": true
  },
  "hotlink_protection": {
    "domains": [
      "some-domain.com"
    ],
    "type": "passlist",
    "empty_referer_denied": true
  },
  "ip_protection": {
    "ips": [
      "8.8.8.8"
    ],
    "type": "passlist"
  },
  "geo_protection": {
    "countries": [
      "UK"
    ],
    "type": "passlist"
  }
}
404CDN Resource not found.

Edit CDN Resource

patchhttps://api.cdn77.com/v3/cdn/{id}

Request parameters

id
requiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Request bodyrequired

// request body
{
  "cache": {
    "max_age": 1440,
    "requests_with_cookies_enabled": true
  },
  "cnames": [
    "cname.your-domain.com"
  ],
  "geo_protection": {
    "countries": [
      "UK"
    ],
    "type": "passlist"
  },
  "headers": {
    "cors_enabled": true,
    "host_header_forwarding_enabled": true
  },
  "hotlink_protection": {
    "domains": [
      "some-domain.com"
    ],
    "type": "passlist",
    "empty_referer_denied": true
  },
  "https_redirect": {
    "code": 301,
    "enabled": true
  },
  "instant_ssl": {
    "enabled": true
  },
  "ip_protection": {
    "ips": [
      "8.8.8.8"
    ],
    "type": "passlist"
  },
  "label": "My cdn",
  "mp4_pseudo_streaming": {
    "enabled": true
  },
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "query_string": {
    "parameters": [
      "utm"
    ],
    "ignore_type": "all"
  },
  "quic": {
    "enabled": true
  },
  "secure_token": {
    "token": "T9WQQX4SV5",
    "type": "parameter"
  },
  "waf": {
    "enabled": true
  }
}
cache
object

Your files will remain cached for the specified duration, after which your origin will be checked for an updated version of your files. Expiry/cache-control headers override this setting.

cnames
array of strings

All CNAMEs should be mapped via DNS to CDN URL. Otherwise it's not possible to generate SSL certificate.Maximum number of CNAMEs is "10". To add more, contact our support.

geo_protection
object

Geo protection enables you to control which countries can access your content directly.

headers
object
hotlink_protection
object

Hotlink protection enables you to control which hostnames/domains can link to and access your content directly.

https_redirect
object

If enabled, all requests via HTTP are redirected to HTTPS. Verify HTTPS availability of CNAMEs before activating, if applicable.

instant_ssl
object

All CNAMEs will be accessible via HTTPS. The certificates are generated via Let's Encrypt. Make sure all CNAMEs are pointed to your CDN Resource URL, otherwise we cannot generate a certificate for any CNAME.

ip_protection
object

IP protection enables you to control which networks can access your content directly.

label
string

The label helps you to identify your CDN Resource.

mp4_pseudo_streaming
object

Turn this option on if using a flash-based video player with MP4 files. Pseudo-streaming is used mainly in flash players. HTML5 players use range-requests. When enabled the "query_string" option must be set to ignore all parameters.

origin_id
string

ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.

query_string
object

Enabling this feature will ignore the query string, allowing URLs with query strings to cache properly. This is particularly useful if you tag your URLs with tracking/marketing parameters, for example.

quic
object

gQUIC is a protocol created by Google. It works with chromium-based browsers and was originally designed for the transmission of HTTP/2 frames. It incentivised a new standardised transport protocol called QUIC.

secure_token
object

This feature allows you to serve your content using signed URLs. You can enable your users to download secured content from the CDN Resource with a valid hash. Note: When you check this option, make sure to generate secured links to access your content. Maximum length is 50 characters.

waf
object

Protect your website against XSS, SQL injection and more with our SmartWAF. We're using OWASP Core Rule Set (CRS) to protect your data against the most exploited vulnerabilities.

Responses

204CDN Resource details were edited.
404CDN Resource not found.

Delete CDN Resource

deletehttps://api.cdn77.com/v3/cdn/{id}

Request parameters

id
requiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Responses

204CDN Resource was deleted.
404CDN Resource not found.

List of CNAMEs

gethttps://api.cdn77.com/v3/cdn/{id}/cname

Request parameters

id
requiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Responses

200List of CNAMEs returned.
// response
[
  {
    "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
    "cname": "cname.your-domain.com"
  }
]
404CDN Resource not found.

Add CNAME

posthttps://api.cdn77.com/v3/cdn/{id}/cname

Request parameters

id
requiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Request bodyrequired

// request body
{
  "cname": "test.cname.com"
}
cname
requiredstring

CNAME should be mapped via DNS to CDN URL. Otherwise it's not possible to generate SSL certificate for any CNAME assigned to CDN Resource.

Responses

204CNAME added.
404CDN Resource not found.

Enable Datacenters

puthttps://api.cdn77.com/v3/cdn/{id}/datacenters

Request parameters

id
requiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Request bodyrequired

// request body
[
  "65b63934-2278-40aa-affa-f4c0d1e7c029"
]
[uuid]
array of strings, format uuid

Responses

204CDN Resource datacenters were updated.

List of Datacenters

gethttps://api.cdn77.com/v3/cdn/{id}/datacenters

Request parameters

id
requiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Responses

200List of datacenters for CDN Resource.
// response
[
  {
    "location_id": "2713c722-7882-4c50-bb61-b663dadd885b",
    "city": "Los Angeles",
    "continent_code": "EU",
    "country": "Germany",
    "is_enabled": true,
    "latitude": 48.5833,
    "longitude": 7.75
  }
]
404CDN Resource not found.