API

Remote Upload

Create

URL: http(s)://alfafile.net/api/v1/remote/create
Description: Create a remote upload job.
Method: (GET|POST)
Required params:
  • token - Access Token to authenticate the user's current session
  • url - Remote URL. You can also specify multiple URL separated by comma
Optional params:
  • folder_id - The key that identifies the folder. If the folder_id is not specified, will be used as destination the root folder
Request example: /api/v1/remote/create?url=http%3A%2F%2Fcdimage.debian.org%2Fdebian-cd%2F7.8.0%2Famd64%2Fiso-cd%2Fdebian-7.8.0-amd64-netinst.iso&folder_id=7&token=arsd4h37ecfkdqd16uolf5nai1
Success response example:
        
{
    "response":{
        "jobs":[
            {
                "job_id":"b",
                "type":0,
                "type_label":"Free",
                "folder_id":"7",
                "url":"http:\/\/cdimage.debian.org\/debian-cd\/7.8.0\/amd64\/iso-cd\/debian-7.8.0-amd64-netinst.iso",
                "name":null,
                "size":null,
                "state":0,
                "state_label":"Waiting",
                "file":[

                ],
                "dl_size":0,
                "speed":0,
                "created":1426839928,
                "updated":1426839928
            }
        ]
    },
    "status":200,
    "details":null
}
        
    

Info

URL: http(s)://alfafile.net/api/v1/remote/info
Description: Returns a remote upload job's details
Method: (GET|POST)
Required params:
  • token - Access Token to authenticate the user's current session
Optional params:
  • job_id - The key that identifies the remote upload job. You can also specify multiple job keys separated by comma. If the job_id is not specified, will be return all remote upload job details
Possible values of the State property:
  • 0 - Waiting
  • 1 - Starting
  • 2 - Downloading
  • 3 - Done
  • 4 - Fail
Request example: api/v1/remote/info?&job_id=btoken=arsd4h37ecfkdqd16uolf5nai1
Success response example:
        
{
    "response":{
        "jobs":[
            {
                "job_id":"b",
                "type":0,
                "type_label":"Free",
                "folder_id":"7",
                "url":"http:\/\/cdimage.debian.org\/debian-cd\/7.8.0\/amd64\/iso-cd\/debian-7.8.0-amd64-netinst.iso",
                "name":null,
                "size":null,
                "state":1,
                "state_label":"Starting",
                "file":[

                ],
                "dl_size":0,
                "speed":0,
                "created":1426839928,
                "updated":1426839928
            }
        ]
    },
    "status":200,
    "details":null
}
        
    
        
{
    "response":{
        "jobs":[
            {
                "job_id":"b",
                "type":0,
                "type_label":"Free",
                "folder_id":"7",
                "url":"http:\/\/cdimage.debian.org\/debian-cd\/7.8.0\/amd64\/iso-cd\/debian-7.8.0-amd64-netinst.iso",
                "name":"debian-7.8.0-amd64-netinst.iso",
                "size":232783872,
                "state":2,
                "state_label":"Downloading",
                "file":[

                ],
                "dl_size":"184549376",
                "speed":"56627682",
                "created":1426839928,
                "updated":1426839929
            }
        ]
    },
    "status":200,
    "details":null
}
        
    
        
 {
    "response":{
        "jobs":[
            {
                "job_id":"b",
                "type":0,
                "type_label":"Free",
                "folder_id":"7",
                "url":"http:\/\/cdimage.debian.org\/debian-cd\/7.8.0\/amd64\/iso-cd\/debian-7.8.0-amd64-netinst.iso",
                "name":"debian-7.8.0-amd64-netinst.iso",
                "size":232783872,
                "state":3,
                "state_label":"Done",
                "file":{
                    "file_id":"GR",
                    "mode":1,
                    "mode_label":"Public",
                    "folder_id":"7",
                    "name":"debian-7.8.0-amd64-netinst.iso",
                    "hash":"a91fba5001cf0fbccb44a7ae38c63b6e",
                    "size":232783872,
                    "url":"http:\/\/alfafile.net\/file\/GR",
                    "created":1426839934
                },
                "dl_size":0,
                "speed":0,
                "created":1426839928,
                "updated":1426839934
            }
        ]
    },
    "status":200,
    "details":null
}
        
    
Error response example:
        
{
    "response":{
        "jobs":[
            {
                "job_id":"m",
                "type":0,
                "type_label":"Free",
                "folder_id":"7",
                "url":"http:\/\/example.com\/file.zip",
                "name":null,
                "size":null,
                "state":4,
                "state_label":"Fail",
                "file":[

                ],
                "dl_size":0,
                "speed":0,
                "created":1426841080,
                "updated":1426841081,
                "error":{
                    "code":3,
                    "message":"Not Found"
                }
            }
        ]
    },
    "status":200,
    "details":null
}
        
    

Delete

URL: http(s)://alfafile.net/api/v1/remote/delete
Description: Delete a remote upload job.
Method: (GET|POST)
Required params:
  • token - Access Token to authenticate the user's current session
  • job_id - The key that identifies the remote upload job. You can also specify multiple job keys separated by comma
Optional params:
Request example: /api/v1/remote/delete?job_id=m&token=arsd4h37ecfkdqd16uolf5nai1
Success response example:
        
{
    "response":{
        "result":{
            "success":1,
            "success_ids":[
                "m"
            ],
            "fail":0,
            "fail_ids":[

            ],
            "errors":[

            ]
        }
    },
    "status":200,
    "details":null
}