API

One time download

Create

URL: http(s)://alfafile.net/api/v1/one_time_download/create
Description: Create one time download link.
Method: (GET|POST)
Required params:
  • token - Access Token to authenticate the user's current session
  • file_id - The key that identifies the file
Optional params:
  • url - Callback URL. A callback URL will be invoked when file will be downloaded
  • notify - Send notification letter when file will be downloaded
Request example: /api/v1/one_time_download/create?url=http%3A%2F%2Fexample.com%2Fnotify%2F¬ify=true&file_id=Gu&token=arsd4h37ecfkdqd16uolf5nai1
Success response example:
        
{
    "response":{
        "download":{
            "download_id":"8r",
            "file":{
                "file_id":"Gu",
                "mode":1,
                "mode_label":"Public",
                "folder_id":"7",
                "name":"file_1.zip",
                "hash":"03a8b5ceb55d9be5ec57aea62d6628d6",
                "size":2010338,
                "url":"http:\/\/alfafile.net\/file\/Gu",
                "created":1426764700
            },
            "url":"http:\/\/alfafile.net\/otdl\/8r\/5c502fdbcb163da7e0434633e28dc86503eb580a",
            "state":0,
            "state_label":"Waiting",
            "call_back_url":"http:\/\/example.com\/notify\/",
            "notify":true,
            "created":1426843101,
            "updated":1426843101
        }
    },
    "status":200,
    "details":null
}
        
    

Info

URL: http(s)://alfafile.net/api/v1/one_time_download/info
Description: Returns a one time downloads details
Method: (GET|POST)
Required params:
  • token - Access Token to authenticate the user's current session
Optional params:
  • download_id - The key that identifies the one time download. You can also specify multiple download keys separated by comma. If the download_id is not passed, will return all one time download details
Possible values of the State property:
  • 0 - Waiting
  • 1 - Running (downloading)
  • 2 - Done
  • 3 - Fail
Request example: /api/v1/one_time_download/info?download_id=8r&token=arsd4h37ecfkdqd16uolf5nai1
Success response example:
        
{
    "response":{
        "downloads":[
            {
                "download_id":"8r",
                "file":{
                    "file_id":"Gu",
                    "mode":1,
                    "mode_label":"Public",
                    "folder_id":"7",
                    "name":"file_1.zip",
                    "hash":"03a8b5ceb55d9be5ec57aea62d6628d6",
                    "size":2010338,
                    "url":"http://alfafile.net/file/Gu",
                    "created":1426764700
                },
                "url":"http://alfafile.net/otdl/8r/5c502fdbcb163da7e0434633e28dc86503eb580a",
                "state":2,
                "state_label":"Done",
                "call_back_url":"http://example.com/notify/",
                "notify":true,
                "created":1426843101,
                "updated":1426843549
            }
        ]
    },
    "status":200,
    "details":null
}