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-09-17T10:52:31.213Z",
    "label": "My cdn",
    "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
    "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

cnamesarray 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.

labelrequiredstring

The label helps you to identify your CDN Resource.

origin_idrequiredstring

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-09-17T10:52:31.214Z",
  "label": "My cdn",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "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

idrequiredinteger 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-09-17T10:52:31.214Z",
  "label": "My cdn",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "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

idrequiredinteger in path

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

Request bodyrequired

cacheobject

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.

cnamesarray 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_protectionobject

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

headersobject
hotlink_protectionobject

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

https_redirectobject

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

instant_sslobject

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_protectionobject

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

labelstring

The label helps you to identify your CDN Resource.

mp4_pseudo_streamingobject

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_idstring

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

query_stringobject

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.

quicobject

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_tokenobject

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.

wafobject

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

idrequiredinteger 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

idrequiredinteger 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

idrequiredinteger in path

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

Request bodyrequired

cnamerequiredstring

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

idrequiredinteger in path

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

Request bodyrequired

[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

idrequiredinteger 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": "4fd53c85-f6c8-48ed-9126-ed204ffdad0d",
    "city": "Los Angeles",
    "continent_code": "EU"
  }
]
404CDN Resource not found.