API

User

Login

URL: http(s)://alfafile.net/api/v1/user/login
Description: Generates a Access Token to be used in upcoming API requests.
Method: (GET|POST)
Required params:
  • login- The Emails Address of the user's account,
  • password- The Password of the user's account
Optional params:
Request example: /api/v1/user/login?login=john@example.com&password=my_password
Success response example:
        
{
    "response":{
        "token":"arsd4h37ecfkdqd16uolf5nai1",
        "user":{
            "email":"john@example.com",
            "is_premium":false,
            "premium_end_time":null,
            "state":1,
            "state_label":"Sign up",
            "traffic":{
                "total":2147483648,
                "left":2147483648
            },
            "storage":{
                "total":53687091200,
                "left":53687091200
            },
            "upload":{
                "max_file_size":53687091200,
                "nb_pipes":2
            },
            "remote_upload":{
                "max_nb_jobs":5,
                "refresh_time":1
            }
        }
    },
    "status":200,
    "details":null
}
        
    
Error response example:
        
{
    "response":null,
    "status":401,
    "details":"Unauthorized. Wrong login or password."
}
        
    

Info

URL: http(s)://alfafile.net/api/v1/user/info
Description: Returns a list of the user's personal information.
Method: (GET|POST)
Required params:
  • token- Access Token to authenticate the user's current session
Optional params:
Request example: /api/v1/user/info?token=arsd4h37ecfkdqd16uolf5nai1
Success response example:
        
{
    "response":{
        "user":{
            "email":"john@example.com",
            "is_premium":false,
            "premium_end_time":null,
            "state":1,
            "state_label":"Sign up",
            "traffic":{
                "total":2147483648,
                "left":2147483648
            },
            "storage":{
                "total":53687091200,
                "left":53687091200
            },
            "upload":{
                "max_file_size":53687091200,
                "nb_pipes":2
            },
            "remote_upload":{
                "max_nb_jobs":5,
                "refresh_time":1
            }
        }
    },
    "status":200,
    "details":null
}
        
    
Error response example:
        
{
    "response":null,
    "status":401,
    "details":"Unauthorized. Token doesn't exist"
}