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.
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 now be affected by future updates.
We recommend SSL is used for all requests. You can require SSL by forcing it via your web server.
Every string passed to and from the API needs to be UTF-8 encoded.
All methods are done using POST unless otherwise stated.
All date/times in the API are strings in the following format:
Y-m-d H:i:s
For example:
2024-12-05 16:58:15
All requests are sent to the follow API host:
https://sqzfile.com/api/v2/
Errors are returned using standard HTTP error code syntax. Any additional information is included in the body of the return call, JSON-formatted.
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 Error 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-12-05 16:58:15" }
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.
Your external application should make API requests in the following order:
/authorize
.Example Response:
{ "data": { "access_token": "lGoVSof0VRwq1Gaza8fODfIxQ4pu6j6rZvnRUCRPunfw4q5ezk3dALLqQbUWu1ntxKkrnbgSzwoDWtSwOVJoHuPxFKt9LRCjCXK081SIxgmuJe1y9KXQfMoVwS4iJHBm", "account_id": "158642" }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
/account/info
./disable_access_token
.Disables an active access_token.
https://sqzfile.com/api/v2/disable_access_token
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "Token removed or no longer available.", "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
Provides details of an account based on the account_id.
https://sqzfile.com/api/v2/account/info
/authorize
./authorize
.A JSON-encoded string including a username (username
), account level id (level_id
), email address (email
) and more.
Sample Successful JSON Response
{ "data": { "id": "158642", "username": "admin", "level_id": "20", "email": "[email protected]", "lastlogindate": "2017-02-18 11:43:39", "lastloginip": "192.168.33.1", "status": "active", "title": "Mr", "firstname": "Admin", "lastname": "User", "languageId": "1", "datecreated": null, "lastPayment": "2011-12-27 13:45:22", "paidExpiryDate": null, "storageLimitOverride": null }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
Provides the account restrictions inherited from the package associated to the account.
https://sqzfile.com/api/v2/account/package
/authorize
./authorize
.A JSON-encoded string including a label (label
), max upload size (max_upload_size
) and 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", "download_size_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-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
Provides an interface to upload files. Note: There is currently no support for chunked uploads, this will be added at a later stage.
https://sqzfile.com/api/v2/file/upload
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "File uploaded", "data": [ { "name": "sample4_l.jpg", "size": "149084", "type": "application/octet-stream", "error": null, "url": "http://yoursite.com/2Vv", "delete_url": "http://yoursite.com/2Vv~d?41efa710444abad11a8f4b5a90e4d746", "info_url": "http://yoursite.com/2Vv~i?41efa710444abad11a8f4b5a90e4d746", "delete_type": "DELETE", "delete_hash": "41efa710444abad11a8f4b5a90e4d746", "hash": "2f4105bc2c626232544275c2d890168b", "stats_url": "http://yoursite.com/2Vv~s", "short_url": "2Vv", "file_id": "1253", "unique_hash": "60b0be7e3b18de9a3f00d940a8e5a9834c6cdc0f49d40af64973be5ca504c4fd", "url_html": "<a href="http://yoursite.com/2Vv" target="_blank" title="View image on File Upload Script">view sample4_l (1).jpg on File Upload Script</a>", "url_bbcode": "[url]http://yoursite.com/2Vv[/url]" } ], "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Did not receive uploaded file. |
200 | Filesize received was zero. |
200 | PHP Curl module does not exist on your server/web hosting. It will need to be enable to use this upload feature. |
200 | Error uploading file. No response received from: |
Note: Account upload restrictions are still in place, so you may also receive the same errors as shown on the site uploader.
Generates a unique download url for a file.
https://sqzfile.com/api/v2/file/download
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "data": { "file_id": "1253", "filename": "sample4_l.jpg", "download_url": "http://yoursite.com/2Vv?download_token=c3e6289a23e9819d8663569da96087d0760ccc46d0f3ddbe3f6930b261777067" }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the file_id param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find file based on file_id. |
200 | Could not generate download url. |
Provides meta data and urls of a file within a users account.
https://sqzfile.com/api/v2/file/info
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "data": { "id": "1253", "filename": "sample4_l.jpg", "shortUrl": "2Vv", ... }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the file_id param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find file based on file_id. |
Provides meta data and urls of a file within a users account.
https://sqzfile.com/api/v2/file/edit
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "File successfully updated.", "data": { "id": "1253", "filename": "sample4.jpg", "shortUrl": "2Vv", ... }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the file_id param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find file based on file_id. |
Delete an active file.
https://sqzfile.com/api/v2/file/delete
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "File successfully set as deleted.", "data": { "id": "1253", "filename": "sample4.jpg", "shortUrl": "2Vv", "status": "trash", ... }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the file_id param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find file based on file_id. |
Move an active file to another folder.
https://sqzfile.com/api/v2/file/move
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "File successfully moved.", "data": { "id": "1162", "filename": "button_back_over.gif", "shortUrl": "2U2", ... }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the file_id param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find file based on file_id. |
200 | Please provide the new_parent_folder_id param. |
200 | Could not find the destination folder id defined by new_parent_folder_id. |
Copy an active file to another folder.
https://sqzfile.com/api/v2/file/copy
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "File successfully copyied.", "original_file": { "data": { "id": "1162", "filename": "button_back_over.gif", "shortUrl": "2U2", ... } }, "new_file": { "data": { "id": "1254", "filename": "button_back_over.gif", "shortUrl": "2Vw", ... } }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the file_id param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find file based on file_id. |
200 | Please provide the copy_to_folder_id param. |
200 | Could not find the destination folder id defined by copy_to_folder_id. |
Create a new folder.
https://sqzfile.com/api/v2/folder/create
/authorize
./authorize
.A JSON-encoded string with the response message.
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": "http://yoursite.com/folder/125/My_New_Folder", "total_downloads": 0, "child_folder_count": 0, "file_count": 0 }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the folder_name param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
Returns a list of folders and files within the passed parent_folder_id. If this value is blank the root folder/file listing is returned.
https://sqzfile.com/api/v2/folder/listing
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "data": { "folders": [ { "id": "123", "parentId": null, "folderName": "My Folder 1", "totalSize": "868689", "isPublic": "1", "date_added": "2017-02-15 20:02:05", "date_updated": null, "url_folder": "http://yoursite.com/folder/123/My_Folder_1", "total_downloads": 5864, "child_folder_count": 1, "file_count": 0 }, { "id": "107", "parentId": null, "folderName": "My Folder 2", ... }, { "id": "108", "parentId": null, "folderName": "My Folder 3", .... } ], "files": [ { "id": "1161", "filename": "button_back.gif", "shortUrl": "2U1", "fileType": "image/gif", "extension": "gif", "fileSize": "1116", "status": "active", "downloads": "5865", "folderId": null, "keywords": "button,back,gif", "url_file": "http://yoursite.com/2U1" }, { "id": "1163", "filename": "button_cancel.gif", "shortUrl": "2U3", ... }, { "id": "1164", "filename": "button_cancel_over.gif", "shortUrl": "2U4", ... } ] }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
Provides information for a specific folder id.
https://sqzfile.com/api/v2/folder/info
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "data": { "id": "123", "parentId": null, "folderName": "My Folder 1", "totalSize": "868689", "isPublic": "1", "accessPassword": null, "date_added": "2017-02-15 20:02:05", "date_updated": null, "url_folder": "http://yoursite.com/folder/123/My_Folder_1", "total_downloads": 5864, "child_folder_count": 1, "file_count": 0 }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find folder based on folder_id. |
Provides an interface to edit a folder.
https://sqzfile.com/api/v2/folder/edit
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "Folder successfully updated.", "data": { "id": "118", "parentId": "117", "folderName": "My New Folder Name", "totalSize": "1024538", "isPublic": "1", "accessPassword": null, "date_added": null, "date_updated": null, "url_folder": "http://yoursite.com/folder/118/My_New_Folder_Name", "total_downloads": 0, "child_folder_count": 0, "file_count": 11 }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find folder based on folder_id. |
Provides an interface to delete a folder.
https://sqzfile.com/api/v2/folder/delete
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "Folder successfully set as deleted.", "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Could not find folder based on folder_id. |
Provides an interface to move a folder.
https://sqzfile.com/api/v2/folder/move
/authorize
./authorize
.A JSON-encoded string with the response message.
Sample Successful JSON Response
{ "response": "Folder successfully moved.", "data": { "id": "117", "parentId": "99", "folderName": "layered_png_files", ... }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |
200 | Please provide the folder_id param. |
200 | Could not find folder based on folder_id. |
Provides details of an account based on the account_id.
https://sqzfile.com/api/v2/account/info
/authorize
./authorize
.A JSON-encoded string including a username (username
), account level id (level_id
), email address (email
) and more.
Sample Successful JSON Response
{ "data": { "id": "158642", "username": "admin", "level_id": "20", "email": "[email protected]", "lastlogindate": "2017-02-18 11:43:39", "lastloginip": "192.168.33.1", "status": "active", "title": "Mr", "firstname": "Admin", "lastname": "User", "languageId": "1", "datecreated": null, "lastPayment": "2011-12-27 13:45:22", "paidExpiryDate": null, "storageLimitOverride": null }, "_status": "success", "_datetime": "2024-12-05 16:58:15" }
200 | Please provide the access_token param. |
200 | Please provide the account_id param. |
200 | Could not validate access_token and account_id, please reauthenticate or try again. |