Recent modifications
21/07/2023
- API : add file size into public folder
04/04/2023
- API : call to /api/user/files now accepts 3 additional parameters (exactSearch, currentFolderSearch, oldSearch)
Introduction
Welcome to the Uptobox API ! You can use our API to access Uptobox services.
We have language bindings in Shell and JS! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Authentication
Uptobox uses token to allow access to the API. There are no endpoints to trigger an authentication, you just need to provide the token in all your call
The token is expected in the request body and will fallback to query params otherwise. If the token is not found, an error is returned.
How to find my API token ?
You can retrieve your API token by going to the page "My account" then click on the icon right after "token" to copy your token into the clipboard.
My account
Some options in my account page can also be modified by using the API. Please find below a quick description of the feature and how to change it.
Retrieve user data
<?php
$url = 'https://uptobox.com/api/user/me?token=[USR_TOKEN]';
$result = file_get_contents($url);
?>
import axios from 'axios'
axios({
method: 'get',
url: 'https://uptobox.com/api/user/me?token=[USR_TOKEN]',
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": {
"login": "my_login",
"email": "my_email@gmail.com",
"point": "8.00000",
"premium_expire": "2018-05-24 11:40:25",
"securityLock": 0,
"directDownload": 1,
"sslDownload": 1,
"token": "USR_TOKEN",
"premium": 1,
}
}
But triggers an error if the token is wrong. For instance :
{
"statusCode": 13,
"message": "Invalid token"
}
You can retrieve all your account's informations anytime.
To do so, send a GET request to : https://uptobox.com/api/user/me
Query params expected :
Parameter | Description |
---|---|
token | your user token |
Return values :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (User) your infos |
(on error) | (String) Error message |
User :
Name | Description |
---|---|
login | (string) Your username |
(string) Your email | |
point | (string) Your fidelity points |
premium_expire | (string) Premium time expire date |
securityLock | (bool) Security lock state |
directDownload | (bool) Direct download state |
sslDownload | (bool) Ssl download state |
token | (string) Your token |
premium | (bool) Is premium |
SSL Download
<?php
$url = 'https://uptobox.com/api/user/settings';
$data = [
'token' => 'USER_TOKEN',
'ssl' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/settings',
data: {
token: [USR_TOKEN],
ssl: 1
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success"
}
But triggers an error if ssl parameter is wrong. For instance :
{
"statusCode": 7,
"message": "Invalid parameter",
"data": "Expect a bool"
}
This feature allows you to force the https when downloading file on Uptobox.
To enable or disable SSL Download, send a PATCH request to : https://uptobox.com/api/user/settings
Request body expected :
Parameter | Description |
---|---|
token | your user token |
ssl | a boolean. can be 1 or 0 |
Return values :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (string - optional) The error message |
Direct Download
<?php
$url = 'https://uptobox.com/api/user/settings';
$data = [
'token' => 'USER_TOKEN',
'directDownload' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/settings',
data: {
token: [USR_TOKEN],
directDownload: 1
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success"
}
But triggers an error if directDownload parameter is wrong. For instance :
{
"statusCode": 7,
"message": "Invalid parameter",
"data": "Expect a bool"
}
This feature, if enabled, will trigger your download immediately when visiting an Uptobox download link.
To enable or disabled Direct download, send a PATCH request to : https://uptobox.com/api/user/settings
Request body expected :
Parameter | Description |
---|---|
token | your user token |
directDownload | a boolean. can be 1 or 0 |
Return values :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (string - optional) The error message |
Miniature UTS
<?php
$url = 'https://uptobox.com/api/user/settings';
$data = [
'token' => 'USER_TOKEN',
'miniatureUts' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/settings',
data: {
token: [USR_TOKEN],
miniatureUts: 1
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success"
}
But triggers an error if directDownload parameter is wrong. For instance :
{
"statusCode": 7,
"message": "Invalid parameter",
"data": "Expect a bool"
}
This feature, if enabled, will show the UTS player miniature when visiting an Uptobox download link.
To enable or disabled Miniature UTS, send a PATCH request to : https://uptobox.com/api/user/settings
Request body expected :
Parameter | Description |
---|---|
token | your user token |
miniatureUts | a boolean. can be 1 or 0 |
Return values :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (string - optional) The error message |
Miniature UTS
<?php
$url = 'https://uptobox.com/api/user/settings';
$data = [
'token' => 'USER_TOKEN',
'notifDeletions' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/settings',
data: {
token: [USR_TOKEN],
notifDeletions: 1
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success"
}
But triggers an error if directDownload parameter is wrong. For instance :
{
"statusCode": 7,
"message": "Invalid parameter",
"data": "Expect a bool"
}
This feature, if enabled, will send you an email when your files are removed from Uptobox.
To enable or disabled Miniature UTS, send a PATCH request to : https://uptobox.com/api/user/settings
Request body expected :
Parameter | Description |
---|---|
token | your user token |
notifDeletions | a boolean. can be 1 or 0 |
Return values :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (string - optional) The error message |
Security Lock
<?php
$url = 'https://uptobox.com/api/user/securityLock';
$data = [
'token' => 'USER_TOKEN',
'securityLock' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/securityLock',
data: {
token: [USR_TOKEN],
securityLock: 1
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success"
}
But triggers an error if securityLock parameter is wrong. For instance :
{
"statusCode": 7,
"message": "Invalid parameter",
"data": "Expect a bool"
}
This feature, if enabled, enforce your account safety by preventing login from another country.
To enable or disabled Security Lock, send a PATCH request to : https://uptobox.com/api/user/securityLock
Request body expected :
Parameter | Description |
---|---|
token | your user token |
securityLock | a boolean. can be 1 or 0 |
Return values :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (string - optional) The error message |
Point conversion
<?php
$url = 'https://uptobox.com/api/user/requestPremium';
$data = [
'token' => 'USER_TOKEN',
'points' => 10
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'POST',
url: 'https://uptobox.com/api/user/requestPremium',
data: {
token: [USR_TOKEN],
points: 10
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": {
"moneyLeft": 0,
"newExpirationDate": "2019-07-18 13:24:19"
}
}
But triggers an error if the parameter is wrong. For instance :
{
"statusCode": 15,
"message": "Unsupported conversion"
}
This endpoint allows you to convert your points into additional premium time. Here are the supported values :
Point | Premium days |
---|---|
10 | 30 |
25 | 90 |
50 | 180 |
100 | 365 |
To convert your points, send a POST request to https://uptobox.com/api/user/requestPremium
Request body expected :
Parameter | Description |
---|---|
token | your user token |
points | points to convert |
Return values :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (Object) Money left and expire premium date |
(on error) | (string) Error message |
Reseller
Create voucher
We provide 2 different methods to create a voucher. One using user token (recommended) and the other using login/password for authentication (deprecated).
Recommended
<?php
$url = 'https://uptobox.com/api/user/createVoucher';
$data = [
'token' => 'USER_TOKEN',
'time' => '30d',
'quantity' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'POST',
url: 'https://uptobox.com/api/user/createVoucher',
data: {
token: [USR_TOKEN],
time: '30d',
quantity: 1
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": [
{
"key_code": "21307H4hKVS0daljIPt",
"key_time": "30",
"key_created": 1524611887,
"activated": false,
"key_activated": "0000-00-00 00:00:00"
}
]
}
But triggers an error if the parameter is not correct. For instance :
{
"statusCode": 7,
"message": "Invalid parameter",
}
This is the recommended way to create a voucher using our API. You can specify what type of voucher you want as well as the quantity.
To create some vouchers, send a POST request to : https://uptobox.com/api/user/createVoucher
Request body expected :
Parameter | Description |
---|---|
token | your user token |
time | the duration for the voucher |
quantity | the number of voucher to generate |
Return values :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (Array of Voucher) Created vouchers |
(on error) | (string) Error message |
Voucher :
Name | Description |
---|---|
key_code | (string) The keycode |
key_time | (string) Voucher type |
key_created | (timestamp) Created at |
activated | (bool) Is activated |
key_activated | (timestamp) Activation date |
Deprecated
<?php
$url = "https://uptobox.com/api_reseller?u=[login]&p=[password]&t=[time]";
$return = file_get_contents($url);
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api_reseller?u=[login]&p=[password]&t=[time]',
})
The above request returns the keycode :
21308FyuiyP4qDuRoU7
But triggers an error if a parameter is missing. For instance :
{
"statusCode": 6,
"message": "Missing parameter",
"data": "u (login) is missing",
}
Alternatively, you can use our api_reseller route to create a
voucher.
This particular endpoint doesn't expect a token but you need to provide
your login and password for authentication.
To create a voucher, send a GET request to : https://uptobox.com/api_reseller
Request body expected :
Parameter | Description |
---|---|
token | your user token |
u | your login |
p | your password |
t | 30d, 365d, 730d |
Return values :
On success, returns the key code in plain text format.
On error, return a JSON object :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (string - optional) Error message |
Generate a download link
You can generate a download link by using our API. As a free member, you need to wait 30 seconds before each download and 30 minutes between downloads. The API response is different depending on which step you're in.
What is a file code ?
For example, in this link : https://uptobox.com/m5f0ce9h197j
The string m5f0ce9h197j is the file code. A unique identifier for a file hosted on Uptobox.
You need to provide the file_code as well as your user token in order to generate a download link.
JSON response on error :
{
"statusCode": "[statusCode]",
"message": "[Status message]",
"data": "[Error object]"
}
If an error happens, here is the returned value :
Parameter | Description |
---|---|
statusCode | (Int) Status Code |
message | (String) Status message |
data | (Object or String) Error |
Get a waiting token
<?php
$url = "https://uptobox.com/api/link?token=[USR_TOKEN]&file_code=[FILE_CODE]";
$return = file_get_contents($url);
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api/link?token=[USR_TOKEN]&file_code=[FILE_CODE]',
})
The above request returns a JSON structured like this :
{
"statusCode": 16,
"message": "Waiting needed",
"data": {
"waiting": 30,
"waitingToken": "5901651ef57c0b2fa336ad7f7f029986p7qsjf-p7rpv5"
}
}
But triggers an error if the file_code is wrong. For instance :
{
"statusCode": 7,
"message": "Invalid parameter",
"data": "bad file code"
}
To generate the download link, first send a GET request to : https://uptobox.com/api/link
Query params expected :
Parameter | Description |
---|---|
token | (string) your user token |
file_code | (string) the file code |
password | (string) File password |
The 30 seconds countdown will start and the call returns a waitingToken which is a unique identifier for this download link generation attempt.
If you have downloaded a file recently. You need to wait about 30 minutes before generating a link again. In this case, the call will return a 39 response status code and the waitingToken will be set to null.
Return values :
Parameter | Description |
---|---|
waiting | (string) n seconds to wait |
waitingToken | (string) a unique identifier to generate a download link |
Get the download link
<?php
$url = "https://uptobox.com/api/link?token=[USR_TOKEN]&file_code=[FILE_CODE]&waitingToken=[WAITING_TOKEN]";
$return = file_get_contents($url);
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api/link?token=[USR_TOKEN]&file_code[FILE_CODE]&waitingToken=[WAITING_TOKEN]',
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": {
"dlLink": "[DL_LINK]",
}
}
After getting the waitingToken in the previous step and after waiting 30 seconds,
send a GET request to : https://uptobox.com/api/link
Query params expected :
Parameter | Description |
---|---|
token | (string) your user token |
file_code | (string) the file code |
waitingToken | (string) the waiting token |
Return values :
Parameter | Description |
---|---|
dlLink | (string) the generated download link |
Files
Retrieve file informations
<?php
$url = "https://uptobox.com/api/link/info?fileCodes=[FILE_CODE]";
$return = file_get_contents($url);
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api/link/info?fileCodes=[FILE_CODE]',
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": {
"list": [
{
"file_code": "[FILE_CODE]",
"file_name": "[FILE_NAME]",
"file_size": "[FILE_SIZE]",
"available_uts": true,
"need_premium": false
},
{
"file_code": "[FILE_CODE]",
"error": {
"code": "[ERROR_CODE]",
"message": "[ERROR_MESSAGE]"
}
}
]
}
}
You can retrieve file's informations by providing the file codes.
Send a GET request to https://uptobox.com/api/link/info
Query params expected :
Parameter | Description |
---|---|
fileCodes | (string) One or multiple file codes separated by ',' (up to 100 items) |
You can check that a password protected file have been provided with the right password.
For each file code provided, you can add a password separated by ':' For example : filecode1:password1,filecode2:password2
The File Object will have an error property if the password is invalid
Return values :
Parameter | Description |
---|---|
list | (array) A list of file object or file error |
File Object
Parameter | Description |
---|---|
file_code | (string) File code |
file_name | (string) File name |
file_size | (number) File size |
available_uts | (boolean) Available in uptostream |
need_premium | (boolean) Require a premium account |
error | (Object) An error object if any |
File Error
Parameter | Description |
---|---|
file_code | (string) file code |
error | (object) An error object |
Error Object
Parameter | Description |
---|---|
code | (number) The error code |
message | (string) The error message |
Retrieve files in public folder
<?php
$url = "https://uptobox.com/api/user/public?folder=[FOLDER]&hash=[HASH]&limit=[LIMIT]&offset=[OFFSET]";
$return = file_get_contents($url);
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api/user/public?folder=[FOLDER]&hash=[HASH]&limit=[LIMIT]&offset=[OFFSET]',
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": {
"list": [
{
"file_name": "[FILE_NAME]",
"file_created": "[FILE_CREATED]",
"file_code": "[FILE_CODE]"
},
{
"file_name": "[FILE_NAME]",
"file_created": "[FILE_CREATED]",
"file_code": "[FILE_CODE]"
}
]
}
}
You can retrieve a public folder content by providing a folder id and a hash.
Send a GET request to https://uptobox.com/api/user/public
Query params expected :
Parameter | Description |
---|---|
folder | (int) folder id |
hash | (string) folder hash |
limit | (int) Number of files to retrieve |
offset | (int) Retrieve from the specified offset |
Return values :
Parameter | Description |
---|---|
list | (array) Array of File Object |
File Object
Parameter | Description |
---|---|
file_name | (string) file name |
file_created | (string) file created date |
file_code | (string) file code |
file_size_user | (int) file size |
File Management
In this section, we will see how you can use the API to manage your files.
Your files are organized with a similar structure as a filesystem. You have folders, that can contain files as well as subfolders.
Retrieve files and folders
<?php
$url = "https://uptobox.com/api/user/files?token=[USR_TOKEN]&path=[PATH]&limit=[LIMIT]&offset=[OFFSET]&orderBy=[ORDER_BY]&dir=[DIR]";
$return = file_get_contents($url);
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api/user/files?token=[USR_TOKEN]&path=[PATH]&limit=[LIMIT]&offset=[OFFSET]&orderBy=[ORDER_BY]&dir=[DIR]',
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": {
"currentFolder": {
"fileCount": 0,
"fld_id": "XXX",
"fld_name": "//Hollydays/beach/movies",
"fld_parent_id": "XXF",
"hash": "XXHDXXH",
"name": "movies",
"totalFileSize": "1234",
},
"folders": [{
"fld_id": "XXX1",
"fld_name": "//Hollydays/beach/movies/action",
"hash": "XXDHXXF",
"name": "action",
}],
"files": [{
"file_code": "aaaaaaaaaaaa",
"file_created": "2018-05-22 10:46:30",
"file_descr": "",
"file_downloads": 1,
"file_last_download": "2018-05-22 10:46:30",
"file_name": "test",
"file_password": "",
"file_public": false,
"file_size": 11111,
"id": 34243532,
"last_stream": "0000-00-00 00:00:00",
"nb_stream": 0,
"transcoded": 0,
}],
"pageCount": 1,
"totalFileCount": 1,
"totalFileSize": 11111,
}
}
To retrieve your files and folders, you need to specify a path to look at.
for example, a path could be //Hollydays/beach/movies
To get the files, send a GET request to : https://uptobox.com/api/user/files
You can customize your request by providing one or multiple parameters described right below.
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
path | (string) The folder path |
limit | (Int) Number of files to retrieve |
orderBy | (string) Sort the result by a column name |
dir | (string) Sort direction if orderBy is provided (ASC , DESC ) default : 'ASC' |
offset | (Int) Retrieve from the specified offset |
searchField | (string) The search field column name (ex: file_name) |
search | (string) Search content if searchField is provided |
exactSearch | (bool) Should match with the exact value only |
currentFolderSearch | (bool) Search in current folder only |
oldSearch | (bool) Use old search engine |
Return values :
Parameter | Description |
---|---|
currentFolder | (Object) The current folder object |
folders | (Array of Object) List of Folders |
files | (Array of object) List of Files |
pageCount | (Int) Number of page calculated |
totalFileCount | (Int) Total file number associated to your account |
totalFileSize | (Int) Total file size associated to your account |
Folders :
Parameter | Description |
---|---|
name | (String) Folder name |
fld_name | (String) Folder full path |
fld_descr | (String) Folder description |
fld_id | (Int) Unique folder idenfier |
fld_password | (String) Folder password |
Files :
Parameter | Description |
---|---|
id | (String) File unique identifier |
file_code | (String) File code |
file_created | (Date) Date of creation |
file_descr | (String) File description |
file_downloads | (Int) Download count |
file_last_download | (Date) Last download date |
file_name | (String) File name |
file_password | (String) File password |
file_public | (Bool) File is public |
file_size | (Int) File size |
last_stream | (Date) Last stream date |
nb_stream | (Int) Stream count |
transcoded | (Int) Transcoding status |
Update file informations
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'file_code' => 'xxxxxxxxxxxx',
'new_name' => 'New file name',
'description' => 'New description',
'password' => 'New password',
'public' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
file_code: 'xxxxxxxxxxxx',
new_name: 'New file name',
description: 'New description',
password: 'New password',
public: 1
}
})
The above request returns a JSON structured like this :
{
"data": {
"updated": 1
},
"message": "Success",
"statusCode": 0
}
The following informations can be updated. Filename, Description, Password, Public
To modiy the data, send a PATCH request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
file_code | (string) The file code |
new_name | (string - optional) New file name value |
description | (string - optional) New description vale |
password | (string - optional) New password value |
public | (string - optional) New public status |
Return values :
Parameter | Description |
---|---|
updated | (int) Number of item updated (Should be 1) |
Update multiple file's public option
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'file_codes' => 'xxxxxxxxxxxx,xxxxxxxxxxxx',
'public' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
file_codes: 'xxxxxxxxxxxx,xxxxxxxxxxxx',
public: 1
}
})
The above request returns a JSON structured like this :
{
"data": {
"updated": 2
},
"message": "Success",
"statusCode": 0
}
To modify multiple file's public status, send a PATCH request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
file_codes | (string) A list of file code |
public | (string) New public status |
Return values :
Parameter | Description |
---|---|
updated | (int) Number of item updated |
Move a folder to another location
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'fld_id' => 42345,
'destination_fld_id' => 3433,
'action' => 'move'
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
fld_id: 42345,
destination_fld_id: 1,
action: 'move'
}
})
The above request returns a JSON structured like this :
{
"data": "The selected folder have successfully been moved to the folder",
"message": "Success",
"statusCode": 0
}
To move a folder, send a PATCH request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
fld_id | (int) Folder id to move |
destination_fld_id | (int) Destination folder id |
action | (string) The action to perform ('move') |
Return values :
Parameter | Description |
---|---|
data | (string) Success or Error message if any |
Move one or multiple files to another location
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'file_codes' => "356134398,356134397,356134396",
'destination_fld_id' => 3433,
'action' => 'move'
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
fld_ids: "356134398,356134397,356134396",
destination_fld_id: 1,
action: 'move'
}
})
The above request returns a JSON structured like this :
{
"data": {
"updated": 3
},
"message": "Success",
"statusCode": 0
}
To move some files, send a PATCH request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
file_codes | (string) List of file code to be moved |
destination_fld_id | (int) Destination folder id |
action | (string) The action to perform ('move') |
Return values :
Parameter | Description |
---|---|
updated | (int) Number of item updated |
Copy one or multiple files to another location
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'file_codes' => 'xxxxxxxxxxxx, xxxxxxxxxxxx',
'destination_fld_id' => 3433,
'action' => 'copy'
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
file_codes: 'xxxxxxxxxxxx, xxxxxxxxxxxx',
destination_fld_id: 1,
action: 'copy'
}
})
The above request returns a JSON structured like this :
{
"data": {
"updated": 2
},
"message": "Success",
"statusCode": 0
}
To copy some files, send a PATCH request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
file_codes | (int) List of file code to be copied |
fld_id | (int) Destination folder id |
action | (string) The action to perform ('copy') |
Return values :
Parameter | Description |
---|---|
data | (string) Success or Error message if any |
Rename a folder
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'fld_id' => 356134398,
'new_name' => 'new folder name'
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'patch',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
fld_id: 356134398,
new_name: 'new folder name'
}
})
The above request returns a JSON structured like this :
{
"data": "folder has been renamed",
"message": "Success",
"statusCode": 0
}
To do so, send a PATCH request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
fld_id | (int) Folder Id |
new_name | (int) New folder name |
Return values :
Parameter | Description |
---|---|
data | (string) Success or Error message if any |
Create a folder
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'path' => '//Hollydays/beach/movies',
'name' => 'newFolder'
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'PUT',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
path: '//Hollydays/beach/movies',
name: 'newFolder'
}
})
The above request returns a JSON structured like this :
{
"data": "Folder created successfully",
"message": "Success",
"statusCode": 0
}
To create a folder, send a PUT request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
path | (int) Path location |
name | (int) New folder name |
Return values :
Parameter | Description |
---|---|
data | (string) Success or Error message if any |
Delete one or multiple files
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'file_codes' => 'xxxxxxxxxxxx, xxxxxxxxxxxx',
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'DELETE',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
file_codes: 'xxxxxxxxxxxx, xxxxxxxxxxxx',
}
})
The above request returns a JSON structured like this :
{
"data": "The selected files have been removed successfully",
"message": "Success",
"statusCode": 0
}
To delete some files, send a DELETE request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
file_codes | (int) List of file code to remove |
Return values :
Parameter | Description |
---|---|
data | (string) Success or Error message if any |
Delete a folder
<?php
$url = 'https://uptobox.com/api/user/files';
$data = [
'token' => 'USER_TOKEN',
'fld_id' => 356134505,
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'DELETE',
url: 'https://uptobox.com/api/user/files',
data: {
token: 'USR_TOKEN',
fld_id: 356134505,
}
})
The above request returns a JSON structured like this :
{
"data": "The selected folder(s) have been removed successfully",
"message": "Success",
"statusCode": 0
}
To delete a folder, send a DELETE request to : https://uptobox.com/api/user/files
Query params expected :
Parameter | Description |
---|---|
token | (string) Your user token |
fld_id | (int) Folder id to remove |
Return values :
Parameter | Description |
---|---|
data | (string) Success or Error message if any |
Upload
You have the possibility to trigger uploads by using our API instead of the website. To do that, you will need to retrieve an upload url.
Retrieve an upload url
<?php
$url = 'https://uptobox.com/api/upload';
$data = [
'token' => 'USER_TOKEN'
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api/upload',
data: {
token: 'USR_TOKEN'
}
})
The above request returns a JSON structured like this :
{
"data": {
"uploadLink": "//www42.uptobox.com/upload?sess_id=RHEgojX9QJygPzh1rMd3",
"maxUpload": "200 GB"
},
"message": "Success",
"statusCode": 0
}
To get an upload url, send a GET request to : https://uptobox.com/api/upload
Query params expected :
Parameter | Description |
---|---|
token | (string - optional) Your user token |
Return values :
Parameter | Description |
---|---|
uploadLink | (string) The upload link |
maxUpload | (string) The upload limit of your account |
Uptostream
Uptostream is a service that allows you to stream video content hosted on Uptobox directly in your browser.
Use a remote subtitle
You can load a streaming link with a remote subtitle.
To do that, modify your url so it look like this: https://uptostream.com/xxxxxxxxx?sub=[subtitle_url]
'
Uptostream will then look at [subtitle_url] and will load the subtitle for you.
Pin authentication
Users may need to authenticate to Uptobox through your application and filling a login form can be cumbersome especially if your app runs on TV.
To ease your user's experience, we provide the possibility for your application to use a PIN-auth system.
How it works ? Every time you need to authenticate a user we send you a PIN code that needs to be validated by the user. They can visit a page on our website using their credentials to link the PIN code to their account at this address:
https://uptobox.com/pin
.
It can be done using a phone, a tablet or a computer and since their devices are most of the time already logged in, the whole process is seamless.
Implementation
You can use the pin auth system in two different scenarios:
Authenticate a user to stream a file on Uptobox
If a user request to stream a file, your application should retrieve the streaming links. To do that, you will provide us the file_code and we will perform internal check to determine if the file is available for streaming.
We then generate and return a unique PIN code that needs to be validated by the user on our dedicated page :
https://uptobox.com/pin
Once the user has submitted the PIN, you can call our API providing the PIN code and it will return the streaming links.
Authenticate a user and retrieve auth token
You may need the user authentication token to perform action on your user's behalve. To do that, we generate an API code that needs to be validated by the user on our dedicated page. Once the user has submitted the PIN, you can call our API providing the PIN code and it will return the authentication token.
In summary
- Get a pin code and display it to the user
- The user submits the pin code on the Uptobox pin page
- Once submitted, the auth token will be available on the api
Get a pin
<?php
$url = 'https://uptobox.com/api/streaming';
$data = [
'file_code' => 'e80u28854phh'
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api/streaming',
data: {
file_code: 'e80u28854phh'
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": {
"pin": "POVT",
"checkHash": "c2af9d9dece0dc699cd042cfd52d0846",
"expired_in": 600,
"user_url": "https://uptobox.com/pin?pin=POVT",
"base_url": "https://uptobox.com/pin",
"check_url": "https://uptobox.com/api/streaming?check=c2af9d9dece0dc699cd042cfd52d0846&pin=POVT"
}
}
To get a PIN code, send a GET request to : https://uptobox.com/api/streaming
Query params expected :
Parameter | Description |
---|---|
file_code | (string) The file code |
token | (string - optional) User authentication token |
Return values :
Parameter | Description |
---|---|
pin | (string) A four digit code |
checkHash | (string) A hash to verify a PIN code |
expired_in | (integer) The number of seconds left before expiration |
user_url | (string) A url to submit the PIN |
base_url | (string) A url to the PIN page |
check_url | (string) The API call to retrieve check the PIN status |
Check the pin status
<?php
$url = 'https://uptobox.com/api/streaming';
$data = [
'pin' => 'AAAA',
'check' => 'b3b496fed300112d294f91c9e331c995'
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
import axios from 'axios'
axios({
method: 'GET',
url: 'https://uptobox.com/api/streaming',
data: {
pin: 'AAAA',
check: 'b3b496fed300112d294f91c9e331c995'
}
})
The above request returns a JSON structured like this :
{
"statusCode": 0,
"message": "Success",
"data": {
"token": "[User token]",
"streamLinks": {
"360": {
"fre": "[Streaming link in 360p]"
},
"720": {
"fre": "[Streaming link in 720p]"
}
},
"subs": [
{
"type": "[TYPE]",
"src": "[SRC]",
"label": "[LABEL]",
"srcLang": "[LANG]"
}
]
}
}
To check a PIN code and retrieve the data, send a GET request to : https://uptobox.com/api/streaming
Query params expected :
Parameter | Description |
---|---|
pin | (string) A four digit code (ex: "TCGW"), |
checkHash | (string) A hash to verify a PIN code |
Return values :
Parameter | Description |
---|---|
token | (string) The user authentication token (Premium only), |
streamLinks | (array) The streaming links |
subs | (array) An array of Subtitle Object |
Subtitle Object
Parameter | Description |
---|---|
type | (string) Subtitle type (vtt, ass) |
src | (string) Subtitle source |
label | (string) Subtitle name |
scrLang | (string) Subtitle language |
Status Code
Here is the list of statusCode currently supported in uptobox API calls.
Code | Description |
---|---|
0 | Success |
1 | An error occured |
2 | Invalid Credentials |
3 | Expect at least one value |
4 | Wrong format |
5 | Need premium account |
6 | Missing Parameter |
7 | Invalid Parameter |
8 | Insufficient credit |
9 | Unsupported field |
10 | Unprocessable request |
11 | Too much fail attempt |
12 | Missing token |
13 | Invalid token |
14 | Voucher is already used |
15 | Unsupported conversion |
16 | Waiting needed |
17 | Password required |
18 | Data unchanged |
19 | Invalid voucher |
20 | Not available |
21 | Permission denied |
22 | Permission granted |
23 | Request has failed |
24 | Request has succeeded partially |
25 | Server temprorarily unavailable |
26 | Invalid password |
27 | Require an authenticated user |
28 | File not found |
29 | You have reached the streaming limit for today |
30 | Folder not found |
31 | Expect a numeric value |
32 | Limit reached |
34 | Invalid data |
35 | File will be available soon |
36 | No subscription found |
37 | Stream is not available |
38 | Filesize need premium |
39 | You need to wait before requesting a new download link |
Changelog
04/04/2023
- API : call to /api/user/files now accepts 3 additional parameters (exactSearch, currentFolderSearch, oldSearch)
13/02/2023
- API : call to /api/user/requestPremium now returns an object with moneyLeft and newExpirationDate
- DOC : add two possible value for /user/settings (notifDeletions, miniatureUts)
24/02/2021
- API : call to /api/link can now returns status code 39 in case there is a delay between downloads
09/04/2020
- API : The endpoint /api/link/info now returns a list of object and support multiple fileCodes
08/04/2020
- DOC : add 10 statusCode for the API
05/03/2020
- DOC : add a section for upload
16/09/2019
- DOC : add a session under authentication that explains how to retrieve the API token
28/08/2019
- DOC : Fix wrong translation in Pin auth
21/02/2019
- DOC : In "Retrieve files and folders" section. we added a missing example for searchField parameter.
25/12/2018
- API : add a missing parameter 'action' in move and copy requests.
- API : fix a mistake in "Move one or multiple files to another location". The parameter "fld_ids" has be replaced by "file_codes"
20/12/2018
- API : fix some incoherence in the response of status messages. In case of a success call, the message should always be "Success"
- API : Generating a download link now expects "file_code" parameter instead of "id"
11/12/2018
- API : add files section
- API : add uptostream section
23/05/2018
- API : add new error status
- /api/user/me : update response data
- Add a changelog