API Documentation

Are you using postman while developing?
We've created a sample postman collection for you to explore our API's.


Upload

You can upload files with POST requests. We'll store the file and return a response in JSON format.

Request example:
curl -F "file=@file.txt" https://api.aboo.se/upload

Successful response
{
    "status": true,
    "data": {
        "file": {
            "url": {
                "minimal": "https://aboo.se/ul/r0kLWWVeBUaMML3ozgoI2woo",
                "full": "https://aboo.se/ul/r0kLWWVeBUaMML3ozgoI2woo/file.txt"
            },
            "metadata": {
                "id": "r0kLWWVeBUaMML3ozgoI2woo",
                "name": "file.txt",
                "mimetype": "text/plain",
                "size": {
                    "bytes": 3626049,
                    "readable": "3.5 MB"
                }
            }
        }
    }
}
Error response
{
    "status": false,
    "error": {
        "message": "Invalid file name",
        "type": "ERROR_FILE_INVALID",
        "code": 12
    }
}
Error codes & types
(10) ERROR_FILE_NOT_PROVDED
(11) ERROR_FILE_EMPTY
(12) ERROR_FILE_INVALID
(13) ERROR_FILE_SIZE_EXCEEDED
(20) ERROR_USER_MAX_FILES_PER_HOUR_REACHED
(21) ERROR_USER_MAX_MB_PER_HOUR_REACHED
(30) ERROR_INTERNAL_SYSTEM_FAILURE
(40) ERROR_INVALID_REQUEST
(41) ERROR_INVALID_REQUEST_TO_MANY_FILES


File information

You can get information about a file with a GET request. Note that you can use the status (true/false) flag to check if a file exist or not. If the file doesn't exist in the system, we'll responde with a 404 error object.

URL pattern:
https://api.aboo.se/file/{id}/info

Request example:
curl https://api.aboo.se/file/f3YZ6AoJ40CTYdJlD2JIzwoo/info

Successful response
{
    "status": true,
    "data": {
        "file": {
            "url": {
                "minimal": "https://aboo.se/ul/f3YZ6AoJ40CTYdJlD2JIzwoo",
                "full": "https://aboo.se/ul/f3YZ6AoJ40CTYdJlD2JIzwoo/image.png"
            },
            "metadata": {
                "id": "f3YZ6AoJ40CTYdJlD2JIzwoo",
                "name": "image.png",
                "mimetype": "image/png",
                "size": {
                    "bytes": "70432",
                    "readable": "68.8 KB"
                },
                "downloads": 1,
                "uploaded": "2018-09-14T19:16:40.6932490Z",
                "latestDownloaded": "2018-09-14T19:20:42.9571122Z",
                "scheduledForDelete": "2018-10-15T00:00:00Z"
            }
        }
    }
}
Error response
{
    "status": false,
    "error": {
        "message": "No file found with id d3YZ6AoR41CTYwJlD2JIzwoo",
        "type": "FILE_NOT_FOUND",
        "code": 404
    }
}


System information

You can get information about our back end system with a GET request.

Request example:
curl https://api.aboo.se/statistics

Response
{
    "status": true,
    "data": {
        "uploads": 853,
        "downloads": 83,
        "ingressDataGB": 6.07416213583247
        "egressDataGB": 2.14782916009425,
    }
}