MAXXO

Maxxo Rest API

Rest API URL:

Rest API URL: https://www.maxxo.com/api/<version>/<resource>
<version> is API version that will be used. Version is integer i for now it is always 1.

Resources:

Response is always in JSON.

GET /auth/token

Authentificate and returns token for any further authorization and using REST API.

Parameters:

email required
Email that is used for Maxxo registration.
password required
User's password.

Response:

token
Token which is used for any further authorization. Token is handing over HTTP header "token".
Example: "token: TheuOs4wqmms1RnIW0jc4GL7Kfpdeup9O5SeLfBdYaAOh7inBnoWU6GG4IHGeVNC"
Every client has unique token.
Token is required to be sent on every further request below or API will respond with error NO_PERMISSION.
error
AUTH_FAILED - authentification failed.
TOKEN_CANNOT_BE_GENERATED - unable to generate token.
ERR_UNKNOWN - application error (it should never happen).

Examples:

Request
GET http:/www.maxxo.com/api/1/auth/token?email=user@maxxo.com&password=password
Response
{"token":"ypqlsCu6nFQrCEN8yHZKYt8PfZfA6taqi96HOKcfskGkA5F8ei2MkHgacUWVvAez"}

Request
GET http:/www.maxxo.com/api/1/auth/token?email=user@maxxo.com&password=wrongpassword
Response
{"error":"AUTH_FAILED"}

POST /ops/send

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
source required
Source of file / folder which is sent. source parameter is in JSON format. source parameter is array of objects which every object contains:
path - path to file / folder which is sending
files - array of all files
folder - true if sending folder. Not mandatory if sending file, not folder.
JSON example.
[
{"path":"path\/to\/folder1","files":["file1.ext"]},
{"path":"path\/to\/folder2","files":["file1.ext"]},
{"path":"path\/to\/folder3","files":["file1.ext","sub-folder1\/file2.ext","file3.ext"],"folder":true},
{"path":"path\/to\/folder4","files":["file1.ext","file2.ext","file3.ext"],"folder":true},
...
]
to required
E-mail of receiver.

Response:

error
METHOD_BAD_REQUEST - Request has wrong parameter(s) or user does not exist
ERR_UNKNOWN - application error (it should never happen)

GET /ops/list

List contents of a folder inside Maxxo folder

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
path required
Path to folder.

Response:

JSON array - type
- size
- file
List of files and their size. Every row contains:
type - f (regular file) or d (directory / folder)
size - size of file in bytes
file - path to file
JSON example:
[
{"file":"path\/to\/file1.ext", "size":10240, "type":"f"},
{"file":"path\/to\/folder", "size":4096, "type":"d"},
...
]
error
ERR_UNKNOWN - application error (it should never happen)

POST /ops/move

Move file or folder inside Maxxo folder

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
source required
Source path of file.
destination required
Destination path.

Response:

error
ERR_UNKNOWN - application error (it should never happen)

POST /ops/delete

Delete files from Maxxo folder

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
file[] required
Path to files/folders which will be deleted.

Response:

error
ERR_UNKNOWN - application error (it should never happen)

POST /ops/filesize

Get size of files from Maxxo folder. If file size is -1, file does not exist.

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
files[] required
List of files to get their size.

Response:

JSON array - file
- size
List of files and their size. Every row contains:
file - path to file
size - size of file in bytes, -1 if file does not exist
JSON example:
[
{"file":"path\/to\/file1.ext", "size":10240},
{"file":"path\/to\/does-not-exist.ext", "size":-1},
...
]
error
ERR_UNKNOWN - application error (it should never happen)

GET /slice

Returns IP of server on which is user located and his login.

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.

Response:

ip
IP addres of server where user is located.
tracker
Torrent tracker url
login
Login of user on server
rsync
Cloudstore password
error
ERR_UNKNOWN - application error (it should never happen)

POST /contacts/add

Parameters

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
email[]
E-mails of contact who you want to add.

Response:

error
USER_NOT_FOUND - contact is not found.
ERR_UNKNOWN - application error (it should never happen).

GET /contacts/list

Returns all contacts.

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
filter optional
Return contacts that contains keyword from filter.

Response:

list of contacts - fullname
- email
- photo
Array of contacts which every element contains:
fullname - Full name of contact
email - email of contact
photo - URL to contact's photo
JSON example:
[
{"fullname": "John Doe", "email":"john.doe@example.com", "photo":"http://www.maxxo.com/photos/photo1.jpg"},
{"fullname": "Jane Doe", "email":"jane.doe@example.com", "photo":"http://www.maxxo.com/photos/photo2.jpg"},
...
]
error
ERR_UNKNOWN - application error (it should never happen)

POST /contacts/remove

Removes contact from contacts list.

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
email required
E-mail of contact who you want to delete.

Response:

error
CONTACT_NOT_FOUND - contact not found
ERR_UNKNOWN - application error (it should never happen)

GET /account/quota

Returns user quota info.

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.

Response:

quota
The user's total storage quota
normal
The user's used quota
receiving_quota
The user's total receive quota per month
received
The user's receive quota spent this month
error
ERR_UNKNOWN - application error (it should never happen)

GET /settings/list

Returns user settings parameters.

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.

Response:

email
Email o user
fullname
Full name of user
photo
Photo URL
accept_all
boolean (true / false). Automatically accept or not all receiving files.
package
subcscribe package type
storage
storage in megabytes (integer)
error
ERR_UNKNOWN - application error (it should never happen)

POST /settings/update

Updates single or all user settings parameters.

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
fullname optional
New full name of user.
current_password optional
Current password.
new_password optional
New password. Current password must be provided.
accept_all optional
boolean (0 / 1). Set accept or not automatically receiving files.

Response:

error
ERR_UNKNOWN - application error (it should never happen)
INVALID_EMAIL - invalid email
WRONG_CURRENT_PASSWORD - entered wrong current password
INVALID_NEW_PASSWORD - new password is invalid, to short, etc.

POST /user-photo/update

Uploads user photo.

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
photo
User's photo

Response

error
ERR_UNKNOWN - application error (it should never happen)
INVALID_PHOTO - if photo is not PNG or JPEG or is bigger than 2MB or is larger than 1600x1200

POST /user-photo/remove

Removes user photo.

Parameters:

token required (HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.

Response:

error
ERR_UNKNOWN - application error (it should never happen)

GET /notifications/list

Return all notifications.

Parameters:

token required (HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.

Response:

list of notifications - id
- type
- email
Array of notifications which every element contains:
- id - unique ID o notification
- type - always CONTACT_REQUEST
- email - email of contact who add you to contact list
error
ERR_UNKNOWN - application error (it should never happen)

POST /notifications/update

Mark notifications as read.

Parameters:

token required (HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
id[] required
IDs of notifications which to mark as read

Response:

JSON array - id
- error
List of notifications that failed to be marked as read. Every row contains:
id - id of notification
error - error messages
NOTIFICATION_NOT_FOUND - notification not found.
NOTIFICATION_ALREADY_READ - noticification already marked s read
JSON example:
[
{"id":123, "error":"NOTIFICATION_NOT_FOUND",
{"id":456, "error":"NOTIFICATION_ALREADY_READ"},
...
]
If some of notifications failed to be mark as read HTTP status code will be 202
error
ERR_UNKNOWN - application error (it should never happen)

POST /invite

Invites friend to Maxxo. Maxxo sends email to people you invites.

Parameters:

token required (HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
email[] required
List of people emails who you want to invite to maxxo.

Response:

error
ERR_UNKNOWN - application error (it should never happen)

GET /inbox/list

Returns messages. Currently, there are only messages to accept or decline files someone sends to you.

Parameters:

token required (HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.

Response:

list of notifications - id
- type
- destination
- timestamp
- sender_name
- sender_email
Array of messages of which every message contains:
id - unique ID of message
type - always "SEND"
destination - file or folder name which will be received
size - total size of folder or file size in bytes
timestamp - notification timestamp
sender_name - name of sender
sender_email - email of sender
JSON example:
[
{"id":18,"type":"SEND","size":"1002400","destination":"path\/to\/file1.ext", "timestamp":"2011-11-28 16:12:11.008021+01","sender_name":"Maxxo user full name","sender_email":"user@maxxo.com"},
{"id":8,"type":"SEND","size":"1002400","destination":"path\/to\/folder1", "timestamp":"2011-11-28 15:39:11.008021+01","sender_name":"Maxxo user full name","sender_email":"user@maxxo.com"},
...
]
error
ERR_UNKNOWN - application error (it should never happen)

POST /inbox/update

Accept or decline files that someone sends to you.

Parameters:

token required
(HTTP header)
Token for authorization. Token is sent via HTTP header "token", not HTTP parameters.
messages required
IDs of messages to accept or decline files that someone sends to you. messages parameter is in JSON format. messages parameter is array of objects which every object contains:
id - ID of message which will accept / decline send.
accept - Possible values: YES (accept) or NO (decline). If not specified, defaults to NO (decline).
JSON example.
[
{"id":123, "accept":"YES"},
{"id":456, "accept":"NO"},
{"id":789},
...
]

Response:

JSON array - id
- error
List of messages that failed to be processed. Every row contains:
id - id of message
error - error messages
QUOTA_EXCEEDED - monthly receiving quota reached or not enough storage space
FILE_NOT_FOUND - file(s) does not exist(s)
MESSAGE_NOT_FOUND - message not found
MESSAGE_ALREADY_READ - message is already read
JSON example:
[
{"id":123, "error":"QUOTA_EXCEEDED",
{"id":456, "error":"MESSAGE_ALREADY_READ"},
...
]
If some of messages failed to be processed HTTP status code will be 202
error
ERR_UNKNOWN - application error (it should never happen)

Error Codes & Responses:

Error Codes & Responses.

ERR_UNKNOWN
HTTP status code: 500
ALREADY_CONTACT
HTTP status code: 202
USER_NOT_FOUND
HTTP status code: 404
CONTACT_NOT_FOUND
HTTP status code: 404
METHOD_NOT_ALLOWED
HTTP status code: 405
NO_PERMISSION
HTTP status code: 401
AUTH_FAILED
HTTP status code: 403
TOKEN_CANNOT_BE_GENERATED
HTTP status code: 500
NOTIFICATION_NOT_FOUND
HTTP status code: 404
NOTIFICATION_ALREADY_READ
HTTP status code: 202
METHOD_BAD_REQUEST
HTTP status code: 400
MESSAGE_NOT_FOUND
HTTP status code: 404
MESSAGE_ALREADY_PROCESSED
HTTP status code: 202
INVALID_PHOTO
HTTP status code: 400
INVALID_EMAIL
HTTP status code: 400
EMAIL_ALREADY_EXIST
HTTP status code: 400
WRONG_CURRENT_PASSWORD
HTTP status code: 400
INVALID_NEW_PASSWORD
HTTP status code: 400
QUOTA_EXCEEDED
HTTP status code: 403
FILE_NOT_FOUND
HTTP status code: 404