API documentation

Data Management

Manage your cached data by purging and prefetching your files. In addition to 2000 URLs per request, users are limited to 20 purge/prefetch requests per 5 minutes. This limitation is per-user and not per-system.

In case you need to work with filenames with special characters, use their encoded version (see example section at purge method.

Purge and prefetch requests are proceeded in queues. Please be aware that receiving a successful response from these methods doesn't mean the purge/prefetch itself was successful. It means that the request was successfully accepted to our queue. Don't forget to use the following methods from our Data Queue section to retrieve detailed information about the request.

Available methods

Prefetch
Purge
Purge All

Prefetch

POST
https://api.cdn77.com/v2.0/data/prefetch
Allows new HTTP Pull content to be pre-populated to your CDN data centers.

Object in standard response: url and request_id

Parameters

Parameter Example Description
Parameter: login string* Example: info@domain.com Your login (email) to CDN77 control panel
Parameter: passwd string* Example: 8vL4BpXbRqgPTKA0h Your API password.
Parameter: cdn_id int* Example: CDN Id. See how to retrieve a list of your CDNs including their Ids.
Parameter: url array* Example: "/path/to/file.jpg" Array of paths.
* Parameter required.

Return Values

Return Value Description
url Array of paths.
request_id Request ID.

Examples

                                
                                                                            
# POST request - prefetching of single file
curl --data "cdn_id=xxx&login=name@domain.com&passwd=your_api_password&url[]=/images/hello.jpg" https://api.cdn77.com/v2.0/data/prefetch # response {"status": "ok", "description": "Prefetch is accepted. It can take few minutes to upload all files to all datacentres.", "url": ["\/images\/hello.jpg"], "request_id": XXX} # POST request - prefetching of multiple files at once curl --data "cdn_id=xxx&login=name@domain.com&passwd=your_api_password&url[]=\/images\/hello.jpg&url[]=anotherimage.jpg" https://api.cdn77.com/v2.0/data/prefetch # response {"status": "ok", "description": "Prefetch is accepted. It can take few minutes to upload all files to all datacentres.", "url": ["\/images\/hello.jpg", "anotherimage.jpg"], "request_id": XXX}

Purge

POST
https://api.cdn77.com/v2.0/data/purge
Instant removal of HTTP Pull cache content from all datacenters, if newly updated content has not yet been reflected.

Object in standard response: url and request_id

Parameters

Parameter Example Description
Parameter: login string* Example: info@domain.com Your login (email) to CDN77 control panel
Parameter: passwd string* Example: 8vL4BpXbRqgPTKA0h Your API password.
Parameter: cdn_id int* Example: CDN Id. See how to retrieve a list of your CDNs including their Ids.
Parameter: url array* Example: "/path/to/file.jpg" Array of paths.
* Parameter required.

Return Values

Return Value Description
url Array of paths.
request_id Request ID.

Examples

                                
                                                                            
# POST request - purging of multiple files at once
curl --data "cdn_id=xxx&login=name@domain.com&passwd=your_api_password&url[]=/path/to/file.jpg&url[]=/path/to/file2.jpg&url[]=/path/to/file3.jpg" https://api.cdn77.com/v2.0/data/purge # response {"status": "ok", "description": "Purge is accepted. It can take few minutes to process the request at all datacentres.", "url": ["\/path\/to\/file.jpg", "\/path\/to\/file2.jpg", "\/path\/to\/file3.jpg"], "request_id": XXX}    
# POST request - purging of single file
curl --data "cdn_id=xxx&login=name@domain.com&passwd=your_api_password&url[]=/images/hello.jpg" https://api.cdn77.com/v2.0/data/purge # response {"status": "ok", "description": "Purge is accepted. It can take few minutes to process the request at all datacentres.", "url": ["\/images\/hello.jpg"], "request_id": XXX}    
# POST request - purge paths with special symbols (use encoded URL)
curl --data "cdn_id=ID of cdn&login=sample@account.com&passwd=your_api_password& url[]=%2FfileWith%20whitespace.jpg%3FmyParam%3D123" https://api.cdn77.com/v2.0/data/purge # response {"status": "ok", "description": "Purge is accepted. It can take few minutes to process the request at all datacentres.", "url": ["%2FfileWith%20whitespace.jpg%3FmyParam%3D123"], "request_id": XXX}    

Purge All

POST
https://api.cdn77.com/v2.0/data/purge-all
Instant removal of all HTTP content.

Parameters

Parameter Example Description
Parameter: login string* Example: info@domain.com Your login (email) to CDN77 control panel
Parameter: passwd string* Example: 8vL4BpXbRqgPTKA0h Your API password.
Parameter: cdn_id int* Example: CDN Id. See how to retrieve a list of your CDNs including their Ids.
* Parameter required.

Return Values

This method provides only standard response.

Examples

                                
                                                                            
# POST request
curl --data "cdn_id=xxx&login=name@domain.com&passwd=your_api_password" https://api.cdn77.com/v2.0/data/purge-all # response {"status": "ok", "description": "Purge of all files is accepted. It can take few minutes to process the request at all datacentres."}