CDN Resources
Name | Method | Path |
---|---|---|
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
200 – List of CDN Resources
// example of the response
[
{
"id": 1234567890,
"cnames": [
{
"id": "9880280c-0507-46d1-88f3-71cfee83fa57",
"cname": "cname.your-domain.com"
}
],
"creation_time": "2024-09-12T08:14:02.415Z",
"label": "My cdn",
"note": "Note for my CDN",
"origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
"url": "1234567890.rsc.cdn77.org",
"mp4_pseudo_streaming": {
"enabled": true
}
}
]
Add CDN Resource
Posthttps://api.cdn77.com/v3/cdn
Request bodyrequired
// example of the request body
{
"cnames": [
"cname.your-domain.com"
],
"label": "My cdn",
"note": "Note for my CDN",
"origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736"
}
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.
The label helps you to identify your CDN Resource.
Optional note for the CDN Resource.
ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.
Responses
201 – CDN Resource created.
// example of the response
{
"id": 1234567890,
"cnames": [
{
"id": "9880280c-0507-46d1-88f3-71cfee83fa57",
"cname": "cname.your-domain.com"
}
],
"creation_time": "2024-09-12T08:14:02.416Z",
"label": "My cdn",
"note": "Note for my CDN",
"origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
"url": "1234567890.rsc.cdn77.org",
"mp4_pseudo_streaming": {
"enabled": true
}
}
422 – Unable to create CDN Resource.
Detail of CDN Resource
Gethttps://api.cdn77.com/v3/cdn/{id}
Request parameters
Responses
200 – Detail of the given CDN Resource returned.
// example of the response
{
"id": 1234567890,
"cnames": [
{
"id": "9880280c-0507-46d1-88f3-71cfee83fa57",
"cname": "cname.your-domain.com"
}
],
"creation_time": "2024-09-12T08:14:02.417Z",
"label": "My cdn",
"note": "Note for my CDN",
"origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
"url": "1234567890.rsc.cdn77.org",
"cache": {
"max_age": 1440,
"max_age_404": 1,
"requests_with_cookies_enabled": true
},
"secure_token": {
"token": "2Xod4tW8Ln4BDg23",
"type": "parameter"
},
"query_string": {
"parameters": [
"utm"
],
"ignore_type": "all"
},
"headers": {
"cors_enabled": true,
"cors_timing_enabled": true,
"cors_wildcard_enabled": true,
"host_header_forwarding_enabled": true,
"content_disposition": {
"type": "parameter"
}
},
"https_redirect": {
"code": 301,
"enabled": true
},
"mp4_pseudo_streaming": {
"enabled": true
},
"waf": {
"enabled": true
},
"ssl": {
"type": "SNI",
"ssl_id": "9880280c-0507-46d1-88f3-71cfee83fa57"
},
"stream": {
"origin_url": "prg-1.s.cdn77.com",
"password": "P4ssw0rd123456",
"query_key": "123456789",
"protocol": "rtmp",
"port": 1936,
"path": "static"
},
"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"
},
"rate_limit": {
"enabled": false
},
"origin_headers": {
"custom": {
"additionalProp1": "default-src 'self' *.example.com; img-src *",
"additionalProp2": "default-src 'self' *.example.com; img-src *",
"additionalProp3": "default-src 'self' *.example.com; img-src *"
}
}
}
404 – CDN Resource not found.
Edit CDN Resource
Patchhttps://api.cdn77.com/v3/cdn/{id}
Request parameters
Request bodyrequired
// example of the request body
{
"cache": {
"max_age": 1440,
"max_age_404": 1,
"requests_with_cookies_enabled": true
},
"cnames": [
"cname.your-domain.com"
],
"geo_protection": {
"countries": [
"UK"
],
"type": "passlist"
},
"headers": {
"cors_enabled": true,
"cors_timing_enabled": true,
"cors_wildcard_enabled": true,
"host_header_forwarding_enabled": true,
"content_disposition": {
"type": "parameter"
}
},
"hotlink_protection": {
"domains": [
"some-domain.com"
],
"type": "passlist",
"empty_referer_denied": true
},
"https_redirect": {
"code": 301,
"enabled": true
},
"ip_protection": {
"ips": [
"8.8.8.8"
],
"type": "passlist"
},
"label": "My cdn",
"note": "Note for my CDN",
"mp4_pseudo_streaming": {
"enabled": true
},
"origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
"origin_headers": {
"custom": {
"additionalProp1": "default-src 'self' *.example.com; img-src *",
"additionalProp2": "default-src 'self' *.example.com; img-src *",
"additionalProp3": "default-src 'self' *.example.com; img-src *"
}
},
"query_string": {
"parameters": [
"utm"
],
"ignore_type": "all"
},
"rate_limit": {
"enabled": false
},
"secure_token": {
"token": "2Xod4tW8Ln4BDg23",
"type": "parameter"
},
"ssl": {
"type": "SNI",
"ssl_id": "9880280c-0507-46d1-88f3-71cfee83fa57"
},
"waf": {
"enabled": true
}
}
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.
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 enables you to control which countries can access your content directly.
Hotlink protection enables you to control which hostnames/domains can link to and access your content directly.
If enabled, all requests via HTTP are redirected to HTTPS. Verify HTTPS availability of CNAMEs before activating, if applicable.
IP protection enables you to control which networks can access your content directly.
The label helps you to identify your CDN Resource.
Optional note for the CDN Resource.
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.
ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.
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.
When enabled, this feature limits the data transfer rate by setting "limit_rate" based on the "rs" URL parameter and "limit_rate_after" by the value from the "ri" URL parameter.
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 64 characters.
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
204 – CDN Resource details were edited.
404 – CDN Resource not found.
422 – Unable to edit CDN Resource.
Delete CDN Resource
Deletehttps://api.cdn77.com/v3/cdn/{id}
Request parameters
Responses
204 – CDN Resource was deleted.
404 – CDN Resource not found.
List of CNAMEs
Gethttps://api.cdn77.com/v3/cdn/{id}/cname
Request parameters
Responses
200 – List of CNAMEs returned.
// example of the response
[
{
"id": "9880280c-0507-46d1-88f3-71cfee83fa57",
"cname": "cname.your-domain.com"
}
]
404 – CDN Resource not found.
Add CNAME
Posthttps://api.cdn77.com/v3/cdn/{id}/cname
Request parameters
Request bodyrequired
// example of the request body
{
"cname": "test.cname.com"
}
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
204 – CNAME added.
404 – CDN Resource not found.
422 – Invalid input.
Enable data centers
Puthttps://api.cdn77.com/v3/cdn/{id}/datacenters
Request parameters
Request bodyrequired
// example of the request body
[
"65b63934-2278-40aa-affa-f4c0d1e7c029"
]
Responses
204 – CDN Resource datacenters were updated.
422 – Data centers could not be enabled.
List of data centers
Gethttps://api.cdn77.com/v3/cdn/{id}/datacenters
Request parameters
Responses
200 – List of datacenters for CDN Resource.
// example of the response
[
{
"location_id": "5831952e-72a3-4d0c-bd51-25537e6ea33b",
"city": "Los Angeles",
"continent_code": "EU",
"country": "Germany",
"country_iso": "DE",
"is_enabled": true,
"latitude": 48.5833,
"longitude": 7.75
}
]
404 – CDN Resource not found.
422 – Data centers list could not be resolved.