API Documentation

API Credentials

You need an Account to get an API Key. Just register on MirrorAce to get one.

Register

API Documentation

Overview

The file upload API is an interface which can be used in your own applications to securely upload, manage and download files externally from this website.

API compatibility

This API will evolve over time when access to other data within the system is made available. However, none of the current endpoints or response values will change. You can write your integration code knowing that it will not be affected by future updates unless there is a bug or security fix.

More functionalities will be added soon.

SSL/HTTPS recommended

All requests to the API requires SSL.

UTF-8 encoding

Every string passed to and from the API needs to be UTF-8 encoded.

HTTP Method

All methods are done using POST unless otherwise stated.

Date format

All date/times are based on UTC timezone.

All date/times in the API are strings in the following format:

Y-m-d H:i:s

For example:

2024-04-20 10:36:34
File size

All file sizes are provided in bytes.

1024 Bytes is equal to 1 Megabytes in our system.

API Path

All requests are sent to the follow API host:

https://1cloudfile.com/api/v2/ 

Error handling

Errors are returned using standard HTTP error code syntax. Any additional information is included in the body of the return call, JSON-formatted.

Standard API errors
Error Code: Description:
400 Bad input parameter. Response error should show which one and why.
401 Bad or expired token. To fix, you should re-authenticate the user.
404 File not found at the provided path.
405 Request method not expected (generally should be GET or POST).
429 Maximum API request limit reached. Try to reduce the amount of requests or look at raising this via your web server configuration.
5xx Server error. See full list here.

Sample JSON Response:

{
    "status": "error",
    "response": "Could not authenticate user. The username and password may be invalid or your account may be locked from too many failed logins.",
    "_datetime": "2024-04-20 10:36:34"
}

Authorize

Provides an access_token and account_id to make further requests into the API.

All requests to the API must be done with a valid access_token and account_id. The same 'access_token' can be used multiple times in the same session, so you shouldn't generate a new access_token for each request.

URL Structure
https://1cloudfile.com/api/v2/ authorize
Parameters
Name Description Example Required
key1 The API key 1. Expected 64 characters in length. 0123456789abcdefabcdefabcdefabcd Yes
key2 The API key 2. Expected 64 characters in length. 0123456789abcdefabcdefabcdefabcd Yes
Response

A JSON-encoded string including an access token (access_token) and account id (account_id).

Name Description Example
access_token Access token needed for each request to the API X3Xp6cUcue22Q3AlpCiZz3mJQWPT2..............
account_id Account id needed for each request to the API. 158642

Sample Successful JSON Response:

{
    "data": {
            "access_token": "X3Xp6cUcue22Q3AlpCiZz3mJQWPT2v10zZqGblSGz.............",
            "account_id": "158642"
    },
    "_status": "success",
    "_datetime": "2024-04-20 10:36:34"
}

Disable Access Token

Disables an active access_token.

URL Structure
https://1cloudfile.com/api/v2/ disable_access_token
Parameters
Name Description Example Required
access_token The access token created previously by /authorize. X3Xp6cUcue22Q3AlpCiZz3mJQWPT2.............. Yes
account_id The account id returned by /authorize. 158642 Yes
Response

A JSON-encoded string with the response message

response:
"Token removed or no longer available", "Please provide the access_token param", "Please provide the account_id param" or "Could not validate access_token and account_id, please reauthenticate or try again"

Sample Successful JSON Response:

{
    "response": "Token removed or no longer available.",
    "_status": "success",
    "_datetime": "2024-04-20 10:36:34"
}

Files Upload

Provides an interface to upload files. Note: There is currently no support for chunked uploads, this will be added at a later stage.

URL Structure
https://1cloudfile.com/api/v2/ file/upload
Parameters
Name Description Example Required
access_token The access token created previously by /authorize. X3Xp6cUcue22Q3AlpCiZz3mJQWPT2.............. Yes
account_id The account id returned by /authorize. 158642 Yes
upload_file The uploaded file. - Yes
folder_id A folder id within the users account. If left blank the file will be added to the root folder. 1 No
Response

A JSON-encoded string with the response message

Name Description Example
name File Name. Exemple name
size File size. 9999
type File type. application/octet-stream
error there is an error in uploading or not null
url Url to access file. https://1cloudfile.com.com/2Vv
delete_url Url to delete file. https://1cloudfile.com.com/2Vv~d?41ef.....
info_url Url to access file informations. https://1cloudfile.com.com/2Vv~i?41ef......
delete_type type of delete DELETE
delete_hash delete hash used to delete file. 41efa710444abad11a8f4b5a90e4d746
hash hash code for file 2f4105bc2c626232544275c2d890168b
stats_url The account selected language as an ID. 2
short_url Short URL of file. 2Vv
file_id File ID in database. 149084
unique_hash Unique hash code for file. 60b0be7e3b18de9a3f00d940a8e....
url_html Maximum stokage fo this account. <a href="https://1cloudfile.com/2Vv" target="_blank" title="View image on 1Cloud File">view sample4_l (1).jpg on 1Cloud File</a>
url_bbcode BBCode for forum. [url]https://1cloudfile.com.com/2Vv[/url]

Sample Successful JSON Response:

{
    "response": "File uploaded",
    "data": [
            {
                    "name": "sample4_l.jpg",
                    "size": "149084",
                    "type": "application/octet-stream",
                    "error": null,
                    "url": "https://1cloudfile.com.com/2Vv",
                    "delete_url": "https://1cloudfile.com.com/2Vv~d?41efa710444abad11a8f4b5a90e4d746",
                    "info_url": "https://1cloudfile.com.com/2Vv~i?41efa710444abad11a8f4b5a90e4d746",
                    "delete_type": "DELETE",
                    "delete_hash": "41efa710444abad11a8f4b5a90e4d746",
                    "hash": "2f4105bc2c626232544275c2d890168b",
                    "stats_url": "https://1cloudfile.com/2Vv~s",
                    "short_url": "2Vv",
                    "file_id": "1253",
                    "unique_hash": "60b0be7e3b18de9a3f00d940a8e5a9834c6cdc0f49d40af64973be5ca504c4fd",
                    "url_html": "<a href="https://1cloudfile.com/2Vv" target="_blank" title="View image on 1Cloud File">view sample4_l (1).jpg on 1Cloud File</a>",
                    "url_bbcode": "[url]https://1cloudfile.com.com/2Vv[/url]"
            }
    ],
    "_status": "success",
    "_datetime": "2024-04-20 10:36:34"
}

File Info

Provides meta data and urls of a file within a users account.

URL Structure
https://1cloudfile.com/api/v2/ file/info
Parameters
Name Description Example Required
access_token The access token created previously by /authorize. X3Xp6cUcue22Q3AlpCiZz.............. Yes
account_id The account id returned by /authorize. 158642 Yes
file_id The file id to get information on. 158642 Yes
Response

A JSON-encoded string with the response message.

Name Description Example
id File ID. 1253
filename File Name. Exemple name
shortUrl Short URL of file. 2Vv
more....

Sample Successful JSON Response:

{
    "data": {
            "id": "1253",
            "filename": "sample4_l.jpg",
            "shortUrl": "2Vv",
            ...
    },
    "_status": "success",
    "_datetime": "2024-04-20 10:36:34"
}

Folders Create

Create a new folder.

URL Structure
https://1cloudfile.com/api/v2/ folder/create
Parameters
Name Description Example Required
access_token The access token created previously by /authorize. X3Xp6cUcue22Q3AlpCiZz3mJQWPT2.............. Yes
account_id The account id returned by /authorize. 158642 Yes
folder_name Folder Name. Folder Example Yes
parent_id The folder parent id. 158642 No
is_public Whether a folder is available publicly or private only. 0 = Private, 1 = Unlisted, 2 = Public in site search. Default Private. 0 No
access_password An MD5 hash of an access password. Expects 32 characters in length. passw No
Response

A JSON-encoded string with the response message.

Name Description Example
id Package ID. 123
label Plan label. abc
max_upload_size max upload size for this pakage. 10000000
more....

Sample Successful JSON Response:

{
    "response": "Folder successfully created.",
    "data": {
            "id": "125",
            "parentId": null,
            "folderName": "My New Folder",
            "totalSize": "0",
            "isPublic": "2",
            "accessPassword": "d9729feb74992cc3482b350163a1a010",
            "date_added": "2017-02-18 12:26:06",
            "date_updated": null,
            "url_folder": "https://1cloudfile.com/folder/125/My_New_Folder",
            "total_downloads": 0,
            "child_folder_count": 0,
            "file_count": 0
    },
    "_status": "success",
    "_datetime": "2024-04-20 10:36:34"
}

Folders Listing

Provides the account restrictions inherited from the package associated to the account.

URL Structure
https://1cloudfile.com/api/v2/ account/package
Parameters
Name Description Example Required
access_token The access token created previously by /authorize. X3Xp6cUcue22Q3AlpCiZz3mJQWPT2.............. Yes
account_id The account id returned by /authorize. 158642 Yes
Response

A JSON-encoded string including a label (label), max upload size (max_upload_size) and more.

Name Description Example
id Package ID. 123
label Plan label. abc
max_upload_size max upload size for this pakage. 10000000
more....

Sample Successful JSON Response:

{
"data": {
        "id": "20",
        "label": "Premium Account",
        "max_upload_size": "1073741824",
        "can_upload": "1",
        "wait_between_downloads": "0",
        "download_speed": "0",
        "max_storage_bytes": "0",
        "show_site_adverts": "0",
        "show_upgrade_screen": "1",
        "days_to_keep_inactive_files": "0",
        "concurrent_uploads": "100",
        "concurrent_downloads": "0",
        "downloads_per_24_hours": "0",
        "max_download_filesize_allowed": "0",
        "max_remote_download_urls": "50",
        "level_type": "paid user",
        "on_upgrade_page": "0"
},
"_status": "success",
"_datetime": "2024-04-20 10:36:34"
}

Upload, share and manage your files for free.

'Upload, share and manage your files for free with unique features that allows you to upload and sharing your files with highest possible speed and quality

© 2024 1Cloud File. Copyright

1Cloud File

Explore

Talk to us