Help

API functions

Basics

Queries

URL for API queries http://pixcp.ahcdn.com/api/[module name]/[action name]/

In most cases you need to pass parameters. You could use GET or POST methods with no difference.

Be aware if you pass through the GET and POST methods parameters with the same names - API will proccess the one passed by POST

Requests limit - 100 per minute, 600 per hour, 2500 per day.

Authorization

While connecting to the API you need to identify yourself with Basic HTTP Authorization.

There is no difference amoung this authentication and logining through the login form. So login and password are the same.

Simplest inline HTTP Authorization providing user data example:

http://user:password@pixcp.ahcdn.com/api/pixcdn/action
Basic parameters
respond
  • plaintext - API response will be not encoded anyhow and return just plaintext
  • json - API response will be encoded in JSON format
  • xml (default) - API response will be represent as XML feed
Operation example written on SHELL
LOGIN=user PASS=password AUTH=`echo -n "$LOGIN:$PASS" | base64 -e` wget -qO - --header='Accept-Encoding: *,gzip' --header="Authorization: Basic $AUTH" 'http://pixcp.ahcdn.com/api/pixcdn/clear_cache?respond=plaintext&id[]=123&id[]=345'

Clear cache action

Action name

clear_cache

Parameters accepted
id (required)
This is ID of the source for which you want to clear cahce. It could be found on sources list page. Could be an array or a single value.
Queries examples
http://pixcp.ahcdn.com/api/pixcdn/clear_cache?id=123 http://pixcp.ahcdn.com/api/pixcdn/clear_cache?id[]=123&id[]=345&id[]=678

Bulk delete action

Action name

bulkdelete

Parameters accepted
source (required)
This is ID of the source for which you want to delete files. It could be found on sources list page. Could be only a single value.
bulk (optionaly required)
This is the list of files or/and directories you want to delete. Divided by new line (\n).
url (optionaly required)
This is URL to text file accessable form internet. The file must contain a list of files or/and directories you want to delete. Divided by new line (\n).
bulkfile UPLOAD (optionaly required)
This is name of parameter for text file you upload. The file must contain a list of files or/and directories you want to delete. Divided by new line (\n).
type
  • files (default) - system will kill files only. If in list will be found a directory - it will be ignored.
  • directories - system will kill files and directories.

ATTENTION! You have to provide only one "optionaly required" parameter.

Queries examples
http://pixcp.ahcdn.com/api/pixcdn/bulkdelete?source=123&type=directories&bulk=path/filename http://pixcp.ahcdn.com/api/pixcdn/bulkdelete?source=123&type=directories&bulk=path/filename1%0Apath/filename2%0Apath/filename3

RSYNC storage action

Action name

rsync

Parameters accepted
id (required)
This is ID of the storage to rsync. It could be found on storages list page. Could be an array or a single value.
Queries examples
http://pixcp.ahcdn.com/api/pixcdn/rsync?id=123 http://pixcp.ahcdn.com/api/pixcdn/rsync?id[]=123&id[]=345&id[]=678

RSYNC storage (check current status)

Action name

rsync_status

Parameters accepted
id (required)
This is ID of the storage you want to check rsync status. It could be found on storages list page. Could be an array or a single value.
Queries examples
http://pixcp.ahcdn.com/api/pixcdn/rsync_status?id=123 http://pixcp.ahcdn.com/api/pixcdn/rsync_status?id[]=123&id[]=345&id[]=678