File1.5
Configure One Time Key
Description : Configure or update the properties related to an existing one-time download link, such as 'duration', 'email_notification', 'success_callback_url', 'error_callback_url,'etc...
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- token : The one-time download token of an existing one-time download link. Token is assigned when requesting a one_time_download (1td) link. For example, in the link http://www.mediafire.com/?yuuib4pk0i0uf586ta6gil1r3j92f98, the token is yuuib4pk0i0uf586ta6gil1r3j92f98.
Relative Parameters:
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- duration : The number of minutes this link is valid. If not passed the API uses 43200(30 days).
- email_notification : Whether or not to send an email notification to the file owner when the file is downloaded. Signify 'yes' or 'no. If no selection is made, default response is set to "no".
- success_callback_url : An absolute URL which is called when the user successfully downloads the file.
- error_callback_url : An absolute URL which is called when the download fails.
- bind_ip : An IP mask/range, or comma-separated list of IP masks/ranges, which restrict the downloading to only matching user IP addresses. (e.g. '68.154.11.5/8, 145.230.230.115-145.230.240.33, 78.192.10.10').
- burn_after_use : Whether or not to invalidate the one-time link after it's used. This parameter is ignored if bind_ip is not passed. 'yes' or 'no' (default 'yes').
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
one_time_key_request_count | The amount of one-time links the session user has requested in a 24-hour period | integer | |
new_device_revision | The new revision number of the device | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 129 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - duration, email_notification=yes, and burn_after_use=yes):
HTTPS://www.mediafire.com/api/1.1/file/configure_one_time_key.php?session_token=&token=&duration=30&email_notification=yes&burn_after_use=yes&response_format=json&signature=
{
action: file/configure_one_time_key,
one_time_key_request_count: 0,
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 2 (Success with XML - success_callback_url):
HTTPS://www.mediafire.com/api/1.1/file/configure_one_time_key.php?session_token=&token=&success_callback_url=http%3A%2F%2Fexample.com%2Flog.php&response_format=xml&signature=
<action>file/configure_one_time_key</action>
<one_time_key_request_count>0</one_time_key_request_count>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Example 3 (Failure with XML - Error 129):
HTTPS://www.mediafire.com/api/file/configure_one_time_download.php?session_token=&token=&email_notification=&burn_after_use=&response_format=xml&signature=
<action>file/configure_one_time_download</action>
<message>One or more parameters for this request are invalid</message>
<error>129</error>
<result>Error</result>
<current_api_version>1.5</current_api_version>
Copy
Description : Copies a file.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- quick_key : The quickkey of the file to be copied. You can specify multiple quickkeys separated by a comma. Required if file_path is not passed. Takes precedence over file_path if both are passed.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- folder_key : The key that identifies the destination folder. If folder_key and folder_path are not passed, device 0's(cloud) root is used. Takes precedence over folder_path if both are passed. myfiles may be passed as a moniker for device 0's(cloud) root.
- folder_path : The absolute path to the destination folder in the session user's account. If folder_key and folder_path are not passed, device 0's(cloud) root is used.
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
new_quickkey | The file key created for a successful copy of the origin file. | string | |
skipped_count | The amount of files which were not copied due to a restriction preventing the copy. | integer | |
other_count | The amount of files which were not copied due to an error preventing the copy. | integer | |
new_device_revision | The new revision number of the device | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON):
http://www.mediafire.com/api/1.5/file/copy.php?quick_key=cu8pzeipcz2hhhn&folder_key=dd9cmgl746p4p&response_format=json&session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e
{
"response": {
"action": "file/copy",
"new_quickkeys": [
"jf4bcgrbrqz0185"
],
"skipped_count": "0",
"other_count": "0",
"new_device_revision": "123",
"result": "Success",
"current_api_version": "1.5"
}
}
Example 2 (Success with XML - skipped items):
HTTPS://www.mediafire.com/api/1.5/file/copy.php?session_token=&quick_key=pf6wpuz1nl6uoqj%2Cltqn9jaqtva0zx6&folder_key=b5brfb1s16fr0&response_format=xml&signature=
<action>file/copy</action>
<new_quickkeys>
<new_quickkey>h6jald8l4ar1dy4</new_quickkey>
</new_quickkeys>
<skipped_count>0</skipped_count>
<other_count>1</other_count>
<message>Unknown or Invalid QuickKey</message>
<error>110</error>
<result>Error</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
<new_device_revision>162659</new_device_revision>
Example 3 (Success with JSON - file_path and folder_path):
HTTPS://www.mediafire.com/api/1.5/file/copy.php?session_token=&file_path=Test004.zip&folder_path=Test%20002&response_format=json&signature=
{
action: file/copy,
new_quickkeys:[
lx8fb6gpizuuv9o,
]
skipped_count: 0,
other_count: 0,
result: Success,
new_key: yes,
current_api_version: 1.5,
new_device_revision: 162671,
}
Create
Description: Creates a new file.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- file_extension: The MIME extension of the file to be created. Required if filename is not passed. Ignored if filename is passed. txt.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- filename : The name and MIME extension of the file to be created. The name should be 3 to 255 characters in length. Extension values: txt.
- parent_key : The folder_key that identifies an existing folder in which the new file is to be created. Takes precedence over parent_path. If parent_key and parent_path are not passed, device 0's(cloud) root is used. myfiles may be passed as a moniker for device 0's(cloud) root.Alternatively, you may pass myfiles as a folderkey moniker for the root folder.
- parent_path : The absolute path to the destination folder in the session user's account. If parent_key and parent_path are not passed, device 0's(cloud) root is used.
- mtime : The date/time of the file's creation. If not set, the current server time will be used. If not set, the current server time will be used. Refer to the following document for valid date/time formats: http://www.php.net/manual/en/datetime.formats.php
- type : The type of file to be generated. Options are: "" (An empty string which will create an empty, 0 byte, file. This is the default) and 'text' which will create a 2 byte text file.
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
quickkey | The quickkey of the new file | string | |
filename | The name of the new file | string | |
created | The date and time the file was created | string timestamp | |
downloads | The amount of times the file has been downloaded | integer | |
description | The description of the file | string | |
size | The size of the file | integer | |
privacy | Indicates the security of the file. 'private' or 'public' | string | |
password_protected | Indicates of the file is password protected. [DEPRECATED] | flag | yes, no |
hash | The hash of the file | string | |
filetype | Type of file | string | application, archive, audio, development, data, document, image, presentation, spreadsheet, video |
mimetype | Mimetype of the file | string | |
flag | Information about the file | bitmask | 1 (File is owned by the session user), (File is supported for preview), 4 (File is editable), 8 (File is virus-flagged) |
revision | The revision number of the file | integer | |
view | Specifies if this file is viewable via MediaFire and, if so, by what system. Under subheading 'links' | integer | 0(Not Viewable, 1(PDF2HTMLex), 2(Syntax Highlighting), 3(PHP Excel), 4(AbiWord), 5(PDF2HTMLex with GS PDF Split), 6(PlainText), 7(Image Gallery), 9(JPlayer Audio), 10(JPlayer Audio with Transcode), 11(JPlayer Video), 12(JPlayer Video with Transcode) |
edit | Specifies if this file can be edited via MediaFire and, if so, by what system. Under subheading 'links". | integer | 0(Not Editable), 1(ACE Editor) |
new_device_revision | The new revision number of the device | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 112 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Link Information
Name | Description | Type |
---|---|---|
view | The view link of the file (if applicable) | string |
read | The read only link of the file (if applicable) | string |
edit | The edit link of the file (if applicable) | string |
watch | A link to watch the file (if video) | string |
listen | A link to listen to the file (if audio) | string |
normal_download | The normal download link of the file | string |
direct_download | The direct download link of the file | string |
streaming | The streaming link of the file (if applicable) | string |
download | The download link of the file | string |
One-time Link Information
Name | Description | Type |
---|---|---|
download | A one-time link to download the file | string |
view | A one-time link to view the file (if applicable) | string |
watch | A one-time link to watch the file (if video) | string |
listen | A one-time link to listen to the file (if audio) | string |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML - file_extension=txt):
HTTPS://www.mediafire.com/api/1.5/file/create.php?session_token=&file_extension=txt&response_format=xml&signature=
<action>file/create</action>
<fileinfo>
<quickkey>71eg28hdna971t3</quickkey>
<filename>Untitled.txt</filename>
<created>2015-04-30 10:55:43</created>
<downloads>0</downloads>
<description></description>
<size>0</size>
<privacy>public</privacy>
<password_protected>no</password_protected>
<hash>e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855</hash>
<filetype>document</filetype>
<mimetype>text/plain</mimetype>
<flag>22</flag>
<revision>161658</revision>
<view>1</view>
<edit>1</edit>
<links>
<view>http://www.mediafire.com/view/71eg28hdna971t3/Untitled.txt</view>
<read>http://www.mediafire.com/view/71eg28hdna971t3/Untitled.txt</read>
<edit>http://www.mediafire.com/edit/71eg28hdna971t3/Untitled.txt</edit>
<normal_download>http://www.mediafire.com/file/71eg28hdna971t3/Untitled.txt</normal_download>
<direct_download>http://download844.mediafire.com/1zor91z6o0zg/71eg28hdna971t3/Untitled.txt</direct_download>
<streaming>http://transcode1.mediafire.com/37hfjs48m19g/71eg28hdna971t3/e3b0/Untitled.txt</streaming>
<one_time>
<download>http://www.mediafire.com/?hay15yrp7plob6l118j7v221psr64gl</download>
<view>http://www.mediafire.com/view/hay15yrp7plob6l118j7v221psr64gl</view>
</one_time>
</links>
</fileinfo>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
<new_device_revision>161658</new_device_revision>
Example 2 (Success with JSON - filename & parent_key):
HTTPS://www.mediafire.com/api/1.5/file/create.php?session_token=&filename=testing.txt&parent_key=2ynmtp05gd8p2&response_format=json&signature=
{
action: file/create,
fileinfo:{
quickkey: 3i1bt2jxvjdfxhw,
filename: testing.txt,
created: 2015-04-30 10:59:24,
downloads: 0,
description: ,
size: 0,
privacy: public,
password_protected: no,
hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,
filetype: document,
mimetype: text/plain,
flag: 22,
revision: 161659,
view: 1,
edit: 1,
links:{
view: http://www.mediafire.com/view/3i1bt2jxvjdfxhw/testing.txt,
read: http://www.mediafire.com/view/3i1bt2jxvjdfxhw/testing.txt,
edit: http://www.mediafire.com/edit/3i1bt2jxvjdfxhw/testing.txt,
normal_download: http://www.mediafire.com/file/3i1bt2jxvjdfxhw/testing.txt,
direct_download: http://download844.mediafire.com/tidfmvvdql4g/3i1bt2jxvjdfxhw/testing.txt,
streaming: http://transcode1.mediafire.com/1nc8rt8t97rg/3i1bt2jxvjdfxhw/e3b0/testing.txt,
one_time:{
download: http://www.mediafire.com/?32b7p2588odt7u1a9hk8o2k0qkcctn6,
view: http://www.mediafire.com/view/32b7p2588odt7u1a9hk8o2k0qkcctn6,
}
}
}
result: Success,
new_key: yes,
current_api_version: 1.5,
new_device_revision: 161659,
}
Example 3 (Success with JSON - file_extension=txt and filetype=text):
HTTPS://www.mediafire.com/api/1.5/file/create.php?session_token=&file_extension=txt&type=text&response_format=json&signature=
{
action: file/create,
fileinfo:{
quickkey: 67jbud5o51d8tsj,
filename: Untitled(2).txt,
created: 2015-04-30 11:00:47,
downloads: 0,
description: ,
size: 2,
privacy: public,
password_protected: no,
hash: 6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28,
filetype: document,
mimetype: text/plain,
flag: 22,
revision: 161660,
view: 1,
edit: 1,
links:{
view: http://www.mediafire.com/view/67jbud5o51d8tsj/Untitled(2).txt,
read: http://www.mediafire.com/view/67jbud5o51d8tsj/Untitled(2).txt,
edit: http://www.mediafire.com/edit/67jbud5o51d8tsj/Untitled(2).txt,
normal_download: http://www.mediafire.com/file/67jbud5o51d8tsj/Untitled(2).txt,
direct_download: http://download1644.mediafire.com/5fa7jzwu36xg/67jbud5o51d8tsj/Untitled%282%29.txt,
streaming: http://transcode1.mediafire.com/jlx9c28af9hg/67jbud5o51d8tsj/6c17/Untitled%282%29.txt,
one_time:{
download: http://www.mediafire.com/?akj0pq418bf35sb0hrdye0yb5ubx1bf,
view: http://www.mediafire.com/view/akj0pq418bf35sb0hrdye0yb5ubx1bf,
}
}
}
result: Success,
new_key: yes,
current_api_version: 1.5,
new_device_revision: 161660,
}
Example 4 (Success with XML - file_extension=txt, parent_path, and type=text):
HTTPS://www.mediafire.com/api/1.5/file/create.php?session_token=&file_extension=txt&parent_path=Test%20002&type=text&response_format=xml&signature=
<action>file/create</action>
<fileinfo>
<quickkey>akns2lffvinq5p7</quickkey>
<filename>Untitled(5).txt</filename>
<created>2015-05-06 16:48:07</created>
<description></description>
<privacy>public</privacy>
<password_protected>no</password_protected>
<hash>6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28</hash>
<filetype>document</filetype>
<mimetype>text/plain</mimetype>
<flag>22</flag>
<revision>162683</revision>
<view>1</view>
<edit>1</edit>
<links>
<view>http://www.mediafire.com/view/akns2lffvinq5p7/Untitled(5).txt</view>
<read>http://www.mediafire.com/view/akns2lffvinq5p7/Untitled(5).txt</read>
<edit>http://www.mediafire.com/edit/akns2lffvinq5p7/Untitled(5).txt</edit>
<normal_download>http://www.mediafire.com/file/akns2lffvinq5p7/Untitled(5).txt</normal_download>
<direct_download>http://download844.mediafire.com/40aq9ckm2qdg/akns2lffvinq5p7/Untitled(5).txt</direct_download>
<streaming>http://transcode1.mediafire.com/2nbksyittftg/akns2lffvinq5p7/e3b0/Untitled(5).txt</streaming>
<one_time>
<download>http://www.mediafire.com/?zs9hvbomkaqdwbqfdvedl11m881w4fb</download>
<view>http://www.mediafire.com/view/zs9hvbomkaqdwbqfdvedl11m881w4fb</view>
</one_time>
</links>
<created_utc>2015-05-06T21:48:07Z</created_utc>
</fileinfo>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
<new_device_revision>162683</new_device_revision>
Delete
Description: Deletes one or more session user files by setting the files' delete_date property and moving the files to the trash can. Once a file has been moved to the Trash Can it is still accessible through device/get_trash.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- quick_key : The quickkey that identifies the file. You can also specify multiple quickkeys separated by commas. Required if file_path is not passed. Takes precedence over file_path.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
Relative Parameters:
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
new_device_revision | The new revision number of the device | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.Examples:
Example 1 (Success with XML - file_path):
http://www.mediafire.com/api/1.5/file/delete.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb
<action>file/delete</action>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
<new_device_revision>162685</new_device_revision>
Example 2 (Success with JSON - quick_key):
HTTPS://www.mediafire.com/api/1.5/file/delete.php?session_token=&quick_key=ltqn9jaqtva0zx6&response_format=json&signature=
{
action: file/delete,
result: Success,
new_key: yes,
current_api_version: 1.5,
new_device_revision: 162684,
}
Get Info
Notes: New parameter file_path.
New response property skipped.
Description: Returns a list of the file's details. This call will return the quickkey, filename, creation date, description, status, size, flag ...etc.
Required Parameters:
- none
Relative Parameters:
- quick_key : The quickkey that identifies the file. You can also specify multiple quickkeys separated by commas. The maximum number of quickkeys allowed is 500. Responses for one-time keys will not include quickkey,
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
quickkey | The quickkey of the file | string | |
filename | The name of the file | string | |
ready | Indicates if a file is uploaded and ready to use | flag | yes, no |
created | The date and time the file was created | string timestamp | |
downloads | The amount of times the file has been downloaded | integer | |
description | The description of the file | string | |
size | The size of the file in bytes | integer | |
privacy | The status of the file | string | public, private |
password_protected | Indicates if the file is password protected [DEPRECATED] | flag | yes, no |
hash | The SHA256 hash of a file. In the case of older files it will be the MD5 hash of the file | string | |
revision | The revision number of the device | string | |
filetype | The file type | string | application, archive, audio, development, data, document, image, presentation, spreadsheet, video |
mimetype | The mimetype of the file | string | |
owner_name | The owner of the file | string | |
flag | Information about the file | bitmask | 1 (File is owned by the session user), 2(File is supported for preview), 4 (File is editable), 8 (File is virus flagged) |
shared_by_user | Present and set to 1 if the file owner has shared the file. | flag | 0, 1 |
permissions | An array of permission objects that is present if the user has permissions to the file. | object [] | |
permissions->value | The specific permission level the user has for the file | integer | 1(read), 2(read+write), 4(manage)[NOT IN USE] |
permissions->explicit | Specifies whether the file owner granted the permission | flag | yes, no |
permissions->read | Specifies whether the user has read access to the file | flag | yes, no |
permissions->write | Specifies whether the user has write access to the file | flag | yes, no |
parent_folderkey | The ID key of the folder containing this file | string | |
delete_date | he date and time the file was sent to the trash | string timestamp | |
view | Specifies if this file is viewable via MediaFire and, if so, by what tool | integer | 0(Not Viewable), 1(PDF2HTMLex), 2(Syntax Highlighting), 3(PHP Excel), 4(AbiWord), 5(PDF2HTMLex with GS PDF Split), 6(PlainText), 7(Image Gallery), 9(Web Player Audio), 10(Web Player Audio with Transcode), 11(Web Player Video), 12(Web Player Video with Transcode) |
edit | Specifies if this file can be edited via MediaFire and, if so, by what tool | integer | 0(Not Editable), 1(ACE Editor) |
links | An array of link objects | object [] | |
links->view | The view URL of the file (this is listed under "links") | string | |
links->read | The read only URL of the file (this is listed under "links") | string | |
links->direct_download | The direct download URL of the file (this is listed under "links") | string | |
links->normal_download | The download URL of the file (this is listed under "links) | string | |
one_time | An array of one_time_link objects | object [] | |
one_time->download | The one-time download URL of the file (this is listed under "links) | string | |
one_time->view | The one-time view URL of the file (this is listed under "links) | string | |
skipped | A comma-separated list of failed quickkeys | ||
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Examples 1 (Success with XML - File owned by session user):
http://www.mediafire.com/api/1.5/file/get_info.php?quick_key=uz9u9zqa0tlk6z7&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc
<response>
<action>file/get_info</action>
<file_info>
<quickkey>uz9u9zqa0tlk6z7</quickkey>
<filename>homer.jpg</filename>
<created>2014-09-03 10:18:50</created>
<downloads>0</downloads>
<description/>
<size>57659</size>
<privacy>public</privacy>
<password_protected>no</password_protected>
<hash>
90ab78b112924fdb4523c9d89707b19f48d7330f052e839c00af5da1f40ad75a
</hash>
<filetype>image</filetype>
<mimetype>image/jpeg</mimetype>
<owner_name>Vokation</owner_name>
<flag>6</flag>
<parent_folderkey>advabfwjax0w6</parent_folderkey>
<revision>3176</revision>
<view>2</view>
<edit>0</edit>
<links>
<view>
http://www.mediafire.com/view/uz9u9zqa0tlk6z7/homer.jpg
</view>
<read>
http://www.mediafire.com/view/uz9u9zqa0tlk6z7/homer.jpg
</read>
<normal_download>
http://www.mediafire.com/file/uz9u9zqa0tlk6z7/homer.jpg
</normal_download>
<direct_download>
http://download851.mediafire.com/lfh5vm4ubiig/uz9u9zqa0tlk6z7/homer.jpg
</direct_download>
<one_time>
<download>
http://www.mediafire.com/?wc22veydvove3pmbm40heopavw5ktvb
</download>
<view>
http://www.mediafire.com/view/wc22veydvove3pmbm40heopavw5ktvb
</view>
</one_time>
</links>
</file_info>
<result>Success</result>
<current_api_version>1.5</current_api_version>
</response>
Example 2 (Success with JSON - Deleted file owned by session user):
HTTPS://www.mediafire.com/api/1.1/file/get_info.php?quick_key=la0ba4jmt5xlitq&session_token=&response_format=json&signature=
{
action: file/get_info,
file_info:{
quickkey: la0ba4jmt5xlitq,
filename: t1.png,
created: 2015-04-22 13:37:28,
downloads: 0,
description: ,
size: 2986,
privacy: public,
password_protected: no,
hash: b5e0ef3f79c2b91f44fd88794939eae37ede7b2f82f53de617a2f61b1338ebb9,
filetype: image,
mimetype: image/png,
owner_name: Clint,
flag: 6,
parent_folderkey: trash,
delete_date: 2015-04-27 16:40:25,
revision: 161342,
view: 2,
edit: 0,
links:{
view: http://www.mediafire.com/view/la0ba4jmt5xlitq/t1.png,
read: http://www.mediafire.com/view/la0ba4jmt5xlitq/t1.png,
normal_download: http://www.mediafire.com/file/la0ba4jmt5xlitq/t1.png,
direct_download: http://download851.mediafire.com/fdrkdovzvmcg/la0ba4jmt5xlitq/t1.png,
one_time:{
download: http://www.mediafire.com/?8r9uf7399pw363u3uwzf681jwgr4pp6,
view: http://www.mediafire.com/view/8r9uf7399pw363u3uwzf681jwgr4pp6,
}
}
}
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 3 (Sucess with JSON - Public file not owned by or shared to session user):
HTTPS://www.mediafire.com/api/1.1/file/get_info.php?quick_key=eb2zv1uji6vjh6i&session_token=&response_format=json&signature=
{
action: file/get_info,
file_info:{
quickkey: eb2zv1uji6vjh6i,
filename: My Movie 1080 002.z01,
created: 2014-12-18 10:40:05,
description: ,
size: 20971520,
privacy: public,
password_protected: no,
hash: d43013d65cb796756abcc8ebf87f18aa07a80839eb85639e1a5948335132008a,
filetype: application,
mimetype: application/zip,
owner_name: Test 04,
flag: 0,
revision: 146,
view: 0,
edit: 0,
links:{
normal_download: http://www.mediafire.com/file/eb2zv1uji6vjh6i/My_Movie_1080_002.z01,
}
}
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 4 (Success with XML - File shared to session user):
HTTPS://www.mediafire.com/api/1.1/file/get_info.php?quick_key=s2k1k7ldg8cs3wx&session_token=&response_format=xml&signature=
<action>file/get_info</action>
<file_info>
<quickkey>s2k1k7ldg8cs3wx</quickkey>
<filename>Sample - Menage Quad - Oh Dear.mp3</filename>
<created>2014-12-18 10:34:32</created>
<description>Menage Quad is a live, 8 piece fusion of electro swing and blends of hip hop. We make swing hop, get with it. Learn more: http://www.fb.com/menagequad or follow us http://www.twitter.com/menagequad </description>
<size>7209881</size>
<privacy>public</privacy>
<password_protected>no</password_protected>
<hash>b9b2023eb1b4f4ba0a66c430e4b4ada92441491f22f3462accc45f24e04dbfee</hash>
<filetype>audio</filetype>
<mimetype>audio/mpeg</mimetype>
<owner_name>Test 04</owner_name>
<flag>4</flag>
<permissions>
<value>1</value>
<explicit>1</explicit>
<read>1</read>
<write>0</write>
</permissions>
<revision>147</revision>
<view>4</view>
<edit>0</edit>
<links>
<listen>http://www.mediafire.com/listen/s2k1k7ldg8cs3wx/Sample_-_Menage_Quad_-_Oh_Dear.mp3</listen>
<normal_download>http://www.mediafire.com/file/s2k1k7ldg8cs3wx/Sample_-_Menage_Quad_-_Oh_Dear.mp3</normal_download>
<direct_download>http://download1475.mediafire.com/26do62d2fjlg/s2k1k7ldg8cs3wx/Sample-MenageQuad-OhDear.mp3</direct_download>
<streaming>http://transcode1.mediafire.com/hnx9k2ae3hug/s2k1k7ldg8cs3wx/b9b2/Sample-MenageQuad-OhDear.mp3</streaming>
<one_time>
<download>http://www.mediafire.com/?y23tw663e1o1076rj2676n86cvcjvef</download>
<listen>http://www.mediafire.com/listen/y23tw663e1o1076rj2676n86cvcjvef</listen>
</one_time>
</links>
</file_info>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Example 5 (Success with JSON - file_path):
HTTPS://www.mediafire.com/api/1.5/file/get_info.php?file_path=Stay%2FTest%20001%2Ftest%20001.txt&session_token=&response_format=json&signature=
{
action: file/get_info,
file_info:{
quickkey: 7a8kc7354q939b6,
filename: test 001.txt,
ready: yes,
created: 2015-05-07 11:07:05,
downloads: 0,
description: ,
size: 2,
privacy: public,
password_protected: no,
hash: 6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28,
filetype: document,
mimetype: text/plain,
owner_name: Clint,
flag: 22,
parent_folderkey: rfoh06y8w3amg,
revision: 162691,
view: 1,
edit: 1,
links:{
view: http://www.mediafire.com/view/7a8kc7354q939b6/test_001.txt,
read: http://www.mediafire.com/view/7a8kc7354q939b6/test_001.txt,
edit: http://www.mediafire.com/edit/7a8kc7354q939b6/test_001.txt,
normal_download: http://www.mediafire.com/file/7a8kc7354q939b6/test_001.txt,
direct_download: http://download1644.mediafire.com/m41sas9l3big/7a8kc7354q939b6/test+001.txt,
streaming: http://transcode1.mediafire.com/xfars908i9wg/7a8kc7354q939b6/6c17/test+001.txt,
one_time:{
download: http://www.mediafire.com/?hsbxd16g5yti6b01z1tb9dgmd8i1faz,
view: http://www.mediafire.com/view/hsbxd16g5yti6b01z1tb9dgmd8i1faz,
}
}
created_utc: 2015-05-07T16:07:05Z,
}
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 6 (Success with XML - with one-time key as argument for quick_key):
HTTPS://www.mediafire.com/api/1.5/file/get_info.php?quick_key=9w2c3196trushb6gav8j9xjres49s5h&session_token=&response_format=xml&signature=
<action>file/get_info</action>
<file_info>
<filename>My Movie 1080 002.mp4</filename>
<ready>yes</ready>
<created>2015-04-06 14:59:55</created>
<description></description>
<privacy>private</privacy>
<password_protected>no</password_protected>
<hash>7db97b317e3f0d8d834385e58a3f74d56845c58a92af66410c2b2c0fc7c6b29b</hash>
<filetype>video</filetype>
<mimetype>video/mp4</mimetype>
<owner_name>Test 03</owner_name>
<flag>4</flag>
<revision>1153</revision>
<view>5</view>
<edit>0</edit>
<created_utc>2015-04-06T19:59:55Z</created_utc>
</file_info>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Example 7 (Success with XML - with multiple quickkeys argument and at least one quickkey succeeds):
HTTPS://www.mediafire.com/api/1.5/file/get_info.php?quick_key=8cqpwj9i98a38wr,wqrf2nc9t2cc2pn&session_token=&response_format=xml&signature=
<action>file/get_info</action>
<file_infos>
<file_info>
<quickkey>8cqpwj9i98a38wr</quickkey>
<filename>my_doc.txt</filename>
<ready>yes</ready>
<created>2015-04-20 17:13:20</created>
<downloads>0</downloads>
<description/>
<size>9842460</size>
<privacy>public</privacy>
<password_protected>no</password_protected>
<hash>e4b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855</hash>
<filetype>document</filetype>
<mimetype>text/plain</mimetype>
<owner_name>John555</owner_name>
<flag>22</flag>
<parent_folderkey>01lp01afbifxh</parent_folderkey>
<revision>57454</revision>
<view>1</view>
<edit>1</edit>
<links>
...
</links>
<created_utc>2015-04-20T22:13:20Z</created_utc>
</file_info>
</file_infos>
<skipped>wqrf2nc9t2cc2pn</skipped>
<result>Success</result>
<current_api_version>1.5</current_api_version>
Get Links
Description : Returns the view link, normal download link, and, if possible, the direct download link of a file. If the direct download link is not returned, an error message is returned explaining the reason.
Required Parameters:
- none
Relative Parameters:
- quick_key : The quickkey that identifies the file. You can also specify multiple quickkeys separated by commas. Required if file_path is not passed. Takes precedence over file_path.
- file_path : The absolute path to a single file. Required if quick_key is not passed.
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature). Needed only when trying to get the direct download link.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- link_type : Specify which link type to return. If not passed, all applicable link types are returned. view, edit, normal_download, direct_download, one_time_download, listen, watch, streaming. Streaming links are only available to apps that have been granted permission to request them.
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
one_time_download_request_count | The number of one-time download links the user has requested during this 24 hour cycle | integer | |
direct_download_free_bandwidth | The amount of free bandwidth, in mebibytes, the user has used during this 24 hour cycle | string | |
one_time_key_request_count | The amount of times the one time key has been requested | integer | |
one_time_key_request_max_count | The maximum number of times the key can be requested in a 24-hour period | integer | |
one_time_download_error_message | Returned in place of one_time_download if a one-time download link is unavailable | integer | No session token provided, User is not authenticated, Daily limit for one-time download links exceeded, Daily limit for one-time download links of this DMCA flagged file exceeded, Link unavailable |
direct_download | The direct download link of the file | string | |
direct_downlad_error | The numerical code of the direct_download error | integer | 40: Link unavailable, 41: Account suspended, 44: Insufficient bandwidth, 45: Insufficient permissions |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Link Responses:
Name | Description | Type | Value |
---|---|---|---|
quickkey | The quickkey of the file | string | |
error | The error message resulting from a private file not owned by or shared to session user | string | User lacks permissions |
view | The view link of the file | string | |
read | The read-only link of the file | string | |
watch | The watch link of the video file | string | |
listen | The listen link of the audio file | string | |
edit | The edit link of the file | string | File is not editable |
edit_error_message | The error message returned if the file is not editable | string | File is not editable |
normal_download | The normal download link of the file | string | |
one_time | An array of one_time link objects | object [] | |
one_time->download | The download link of the one-time file | string | |
one_time->view | The view link of the one-time file | string | |
one_time->watch | The watch link of the one-time file | string | |
one_time->listen | The listen link of the one-time file | string | |
one_time_key_error_message | The error message for a one time key download | string | User is not authenticated |
streaming | The transcode link to the file | string | |
streaming_error_message | The error message returned if the file is not streamable | string | |
streaming_error | The error code for the unstreamable file | string | 40 |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON: Document type file owned by session user with quick_key):
HTTPS://www.mediafire.com/api/file/get_links.php?quick_key=5k6vgkdi9gvvbiy&session_token=<token>&link_type=&response_format=json&signature=<token>
{
action: file/get_links,
links:[
{
quickkey: 5k6vgkdi9gvvbiy,
view: http://www.mediafire.com/view/5k6vgkdi9gvvbiy/example(2).txt,
edit: http://www.mediafire.com/edit/5k6vgkdi9gvvbiy/example(2).txt,
normal_download: http://www.mediafire.com/file/5k6vgkdi9gvvbiy/example(2).txt,
direct_download: http://download789.mediafire.com/8yr2f7zv8hmg/5k6vgkdi9gvvbiy/example%282%29.txt,
one_time_download: http://www.mediafire.com/?yaxqp0vvd7eekaae7iu7eddfnsiw967,
}
]
one_time_download_request_count: 0,
direct_download_free_bandwidth: 1353,
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 2 (Success with XML - a video type file owned by session user with file_path):
HTTPS://www.mediafire.com/api/1.5/file/get_links.php?file_path=Test%20002%2FMy%20Movie%201080%20006.mp4&session_token=&response_format=xml&signature=
<action>file/get_links</action>
<links>
<link>
<quickkey>qaxvrb4cpvvf6eo</quickkey>
<watch>http://www.mediafire.com/watch/qaxvrb4cpvvf6eo/My_Movie_1080_006.mp4</watch>
<edit_error_message>File is not editable</edit_error_message>
<normal_download>http://www.mediafire.com/file/qaxvrb4cpvvf6eo/My_Movie_1080_006.mp4</normal_download>
<one_time>
<download>http://www.mediafire.com/?y5od7kmoaas5gloq6yl1glohhb9pil3</download>
<watch>http://www.mediafire.com/watch/y5od7kmoaas5gloq6yl1glohhb9pil3</watch>
</one_time>
</link>
</links>
<one_time_key_request_count>1</one_time_key_request_count>
<one_time_key_request_max_count>100</one_time_key_request_max_count>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Example 3 (Success with JSON - A public audio file not owned by session user and without permissions):
HTTPS://dev.mediafire.com/api/file/get_links.php?quick_key=jav5g03az9uzeo0&session_token=<token>&response_format=json&signature=<token>
{
action: file/get_links,
links:[
{
quickkey: jav5g03az9uzeo0,
listen: http://dev.mediafire.com/listen/jav5g03az9uzeo0/David_Heartbreak_-_Raindrops_ft._Skylar_Grey_&_The_Partysquad_-_.mp3,
edit_error_message: File is not editable,
normal_download: http://dev.mediafire.com/file/jav5g03az9uzeo0/David_Heartbreak_-_Raindrops_ft._Skylar_Grey_&_The_Partysquad_-_.mp3,
direct_download_error_message: Insufficient Permissions,
direct_download_error: 45,
one_time_download_error_message: Link unavailable,
}
]
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 4 (Success with XML - private file not owned by or shared to session user):
HTTPS://www.mediafire.com/api/1.5/file/get_links.php?quick_key=ilc8d6gllrhb671&session_token=&response_format=xml&signature=
<action>file/get_links</action>
<links>
<link>
<quickkey>ilc8d6gllrhb671</quickkey>
<error>User lacks permissions</error>
</link>
</links>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>
Example 5 (Success with JSON - multiple arguments for link_type):
HTTPS://www.mediafire.com/api/1.5/file/get_links.php?quick_key=lx8fb6gpizuuv9o&session_token=&link_type=normal_download%2Cstreaming&response_format=json&signature=
{
action: file/get_links,
links:[
{
quickkey: lx8fb6gpizuuv9o,
normal_download: http://www.mediafire.com/file/lx8fb6gpizuuv9o/Test004.zip,
streaming_error_message: Link unavailable,
streaming_error: 40,
}
]
direct_download_free_bandwidth: 621,
result: Success,
new_key: yes,
current_api_version: 1.3,
}
Get Versions
Description : Returns a list of all file versions.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- quick_key : The quickkey that identifies the file. Required if file_path is not passed. Takes precedence over file_path.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
revision | The revision number of the file | integer | |
date | The date and time the file was modified | string timestamp | |
head | Indicates if the file is the latest version | flag | yes, no |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 104, 114 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - quick_key):
HTTPS://www.mediafire.com/api/1.5/file/get_versions.php?session_token=&quick_key=lbc4r1jhra9s0xg&response_format=json&signature=
{
action: file/get_versions,
file_versions:[
{
revision: 162696,
date: 2015-05-07 15:46:28,
head: yes,
date_utc: 2015-05-07T20:46:28Z,
}
{
revision: 162654,
date: 2015-05-05 16:34:41,
date_utc: 2015-05-05T21:34:41Z,
}
]
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 2 (Success with XML - file_path):
HTTPS://www.mediafire.com/api/1.5/file/get_versions.php?session_token=&file_path=Test%20002%2Funtitled.txt&response_format=xml&signature=
<action>file/get_versions</action>
<file_versions>
<file_version>
<revision>162696</revision>
<date>2015-05-07 15:46:28</date>
<head>yes</head>
<date_utc>2015-05-07T20:46:28Z</date_utc>
</file_version>
<file_version>
<revision>162654</revision>
<date>2015-05-05 16:34:41</date>
<date_utc>2015-05-05T21:34:41Z</date_utc>
</file_version>
</file_versions>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Example 3 (Failure with JSON - Error 114 with public file not owned by or shared to session user):
HTTPS://www.mediafire.com/api/1.5/file/get_versions.php?session_token=&quick_key=ooy9x1hmcw7vw4e&response_format=json&signature=
{
action: file/get_versions,
message: Access denied,
error: 114,
result: Error,
new_key: yes,
current_api_version: 1.5,
}
Move
Description: Move one or more files from one location to another.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- quick_key : The quickkey of the file to be copied. You can specify multiple quickkeys separated by a comma. Required if file_path is not passed. Takes precedence over file_path if both are passed.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- folder_key : The key that identifies the destination folder. If omitted, the destination folder will be '0' (the root folder - My files). If folder_key and folder_path are not passed, device 0's(cloud) root is used. Takes precedence over folder_path if both are passed. Alternatively, you may pass myfiles as a folderkey moniker for the root folder.
- folder_path : The absolute path to the destination folder in the session user's account. If folder_key and folder_path are not passed, device 0's(cloud) root is used.
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
new_names | A collection of files entered that had their names changed to avoid collisions in the destination | object | |
new_device_revision | The new revision number of the device | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 110, 114 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - file owned by session user and file_path and folder_key):
HTTPS://www.mediafire.com/api/1.5/file/move.php?session_token=&file_path=Photos%2Fs12.png&folder_key=b5brfb1s16fr0&response_format=json&signature=
{
action: file/move,
new_names: ,
result: Success,
new_key: yes,
current_api_version: 1.5,
new_device_revision: 162698,
}
Example 2 (Success with XML - file owned by session user and quick_key and folder_path):
HTTPS://www.mediafire.com/api/1.5/file/move.php?session_token=&quick_key=c1m5nrbccs9mj&response_format=xml&signature=
<action>file/move</action>
<message>Unknown or Invalid QuickKey</message>
<error>110</error>
<result>Error</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Example 3 (Failure with XML - Error 114 with file not owned by session user):
HTTPS://www.mediafire.com/api/1.5/file/move.php?session_token=&quick_key=ooy9x1hmcw7vw4e&folder_path=Test%20002&response_format=xml&signature=
<action>file/move</action>
<message>Access denied</message>
<error>114</error>
<result>Error</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
One Time Key
Description: Creates a one-time key. A one-time key is a key that can only be used by one recipient, which can be further restricted to a specific IP address (bind_ip). Once it has been used it can optionally be destroyed after use (burn_after_use). The API will also
return information regarding how many one-time keys have been used, as well as how many can be requested, for a given 24 hour period.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- quick_key : The quickkey that identifies the file. Required if file_path is not passed. Takes precedence over file_path.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- get_counts_only : If set to 'yes', only the daily request counts will be returned. No link is generated.
- duration : The number of minutes this link is valid. If not passed, then the link expires after 30 days.
- email_notification : Indicates whether or not to send an email notification to the file owner when the file is downloaded. 'yes' or 'no. (default 'no').
- success_callback_url : An absolute URL which is called when the user successfully downloads the file.
- error_callback_url : An absolute URL which is called when the download fails.
- bind_ip : An IP mask/range, or a comma-separated list of IP masks/ranges, which restrict the download to only matching user's IP addresses. (e.g. '68.154.11.5/8, 145.230.230.115-145.230.240.33, 78.192.10.10').
- burn_after_use : Configurable only if bind_ip is set & passed. Determines if the one-time link should be invalidated after first use. Values: yes | no [default].
- response_format : 'xml' or 'json' (default 'xml')
Functionality Scenarios
- If bind_ip is not set and passed, the system automatically sets burn_after_use to 'yes' (this setting is not changeable in this scenario). It is not necessary to set or pass burn_after_use in the API call.
- If bind_ip is set and passed, burn_after_use allows the caller to decide whether the link should be invalidated after its first use or remain usable.
Response Properties
Name | Description | Type | Value |
---|---|---|---|
one_time_key_request_count | A count of how many one-time keys have been generated in the current 24hr cycle. Only returned when a one-time link is successfully returned. | integer | |
one_time_key_request_max_count | The amount of one time key requests that can be made in a 24-hour period. | integer | |
token | The one-time download link token | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 114 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Links
Name | Description | Type | Value |
---|---|---|---|
download | The download link of the one time key. | string | |
view | The view link of the one time key. | string |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML - file_path and success_callback_url):
HTTPS://www.mediafire.com/api/1.5/file/one_time_key.php?session_token=&file_path=Photos%2Fsegoesc.ttf&success_callback_url=http%3A%2F%2Fwww.test.com%2Ftest.php&response_format=xml&signature=
<action>file/one_time_key</action>
<one_time_key_request_count>1</one_time_key_request_count>
<one_time_key_request_max_count>100</one_time_key_request_max_count>
<links>
<download>http://www.mediafire.com/?yl1rfx9hdqac8n49oi864ilcyxf1423</download>
</links>
<token>yl1rfx9hdqac8n49oi864ilcyxf1423</token>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>
Example 2 (Success with JSON - quick_key, duration, & email_notification=yes and bind_ip):
HTTPS://www.mediafire.com/api/1.5/file/one_time_key.php?session_token=&quick_key=boak73lbh58tvae&duration=15&email_notification=yes&bind_ip=10.10.25.36&response_format=json&signature=
{
action: file/one_time_key,
one_time_key_request_count: 1,
one_time_key_request_max_count: 100,
links:{
download: http://www.mediafire.com/?izp9in69uiz9dxiht2xzc16bc71cnc3,
}
token: izp9in69uiz9dxiht2xzc16bc71cnc3,
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 3 (Success with JSON - get_counts_only=yes):
HTTPS://www.mediafire.com/api/1.5/file/one_time_key.php?session_token=&get_counts_only=yes&response_format=json&signature=
{
action: file/one_time_key,
one_time_key_request_count: 1,
one_time_key_request_max_count: 100,
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 4 (Failure with XML - Error 129):
HTTPS://www.mediafire.com/api/1.5/file/configure_one_time_download.php?session_token=&token=&email_notification=&burn_after_use=&response_format=xml&signature=
<action>file/configure_one_time_download</action>
<message>One or more parameters for this request are invalid</message>
<error>129</error>
<result>Error</result>
<current_api_version>1.5</current_api_version>
Purge
Description : Permanently delete a user's file.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- quick_key : The quickkey that identifies the file. Required if file_path is not passed. Takes precedence over file_path.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
new_device_revision | The new revision number of the device | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 110, 114 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - quick_key):
HTTPS://www.mediafire.com/api/1.5/file/purge.php?session_token=&quick_key=ne65je49dqj99z1&response_format=json&signature=
{
action: file/purge,
result: Success,
new_key: yes,
current_api_version: 1.5,
new_device_revision: 161665,
}
Example 2 (Success with XML - file_path):
HTTPS://www.mediafire.com/api/1.5/file/purge.php?session_token=&file_path=Photos%2Fr.sys&response_format=xml&signature=
<action>file/purge</action>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
<new_device_revision>162702</new_device_revision>
Example 3 (Failure with XML - Error 110):
HTTPS://www.mediafire.com/api/1.5/file/move.php?session_token=&quick_key=c1m5nrbccs9mj&response_format=xml&signature=
<action>file/move</action>
<message>Unknown or Invalid QuickKey</message>
<error>110</error>
<result>Error</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Recently Modified
Description : Returns a list of quickkeys of the recently modified files.
Required Parameters:
- session_token :(needed only when accessing root folder, private folder, or the folder's private content) A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- number_of_files : Indicates the number of quickkeys to be returned. 10(default).
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
quickkeys | The quickkeys of the file which were revised. This property will repeat until the number specified in the optional parameter is reached. | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML):
http://www.mediafire.com/api/1.5/file/recently_modified.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc
<response>
<action>file/recently_modified</action>
<quickkeys>
<quickkey>pk6wac3kn4hqs6h</quickkey>
<quickkey>tg4vt34w0k9c0zb</quickkey>
<quickkey>ouyzeu9z52527yv</quickkey>
<quickkey>qjnkolnr7cjs137</quickkey>
<quickkey>x4aub1yln8h8ae8</quickkey>
<quickkey>qz5talh1ay6a8h3</quickkey>
<quickkey>k44s7l2ybympf13</quickkey>
<quickkey>2gurwo528sbf63e</quickkey>
<quickkey>6ypjovee3urtscm</quickkey>
<quickkey>pmohk1mdjdd08mw</quickkey>
</quickkeys>
<result>Success</result>
<current_api_version>1.5</current_api_version>
</response>
Example 2 (Success with JSON - number_of_files=15):
HTTPS://www.mediafire.com/api/file/recently_modified.php?session_token=&number_of_files=15&response_format=json&signature=
{
action: file/recently_modified,
quickkeys:[
a7oaudfjvttw1bl,
gahdw70g17jcgdv,
5jm7x5nrijl93jt,
bit45d166c825j2,
5k6vgkdi9gvvbiy,
sn4lrzazop2ck7v,
m5n80esjby77mq4,
m5n80esjby77mq4,
m5n80esjby77mq4,
uezqt9fbs91ir7i,
uezqt9fbs91ir7i,
uezqt9fbs91ir7i,
psvub5ffa4k1ao9,
94rhvrc4uoqdpib,
2e0n2y7z4e9k5dd,
]
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Restore
Description : Restores an old file revision and makes it the current head.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- revision : The revision to restore the file to.
Relative Parameters:
- quick_key : The quickkey that identifies the file. Required if file_path is not passed. Takes precedence over file_path.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
asynchronous | Specifies whether the restore is being processed asynchronously. If yes, poll device/get_status to determine when the job is complete. | flag | yes/no |
new_device_revision | The revision number of the device | integer | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 110, 223 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - with quick_key):
HTTPS://www.mediafire.com/api/1.5/file/restore.php?session_token=&quick_key=x90a1vv7vx10pcu&revision=162681&response_format=json&signature=
{
"response": {
"action": "file/restore",
"asynchronous": "yes",
"result": "Success",
"current_api_version": "1.5"
}
}
Example 2 (Success with XML - file_path):
HTTPS://www.mediafire.com/api/1.5/file/restore.php?session_token=&file_path=test1.txt&revision=162706&response_format=xml&signature=
<action>file/restore</action>
<asynchronous>no</asynchronous>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
<new_device_revision>162708</new_device_revision>
Example 3 (Failure with XML - Error 110):
HTTPS://www.mediafire.com/api/file/restore.php?session_token=&quick_key=n636ym47yzse4h4&revision=157670&response_format=xml&signature=
<action>file/restore</action>
<message>Unknown or Invalid QuickKey</message>
<error>110</error>
<result>Error</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Example 4 (Failure with XML - Error 223):
HTTPS://www.mediafire.com/api/file/restore.php?session_token=&quick_key=n636ym47yzsy4h4&revision=157676&response_format=xml&signature=
<action>file/restore</action>
<message>The revision you requested is invalid or cannot be restored</message>
<error>223</error>
<result>Error</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Set Artwork
Description : Associates a given image with one or more media files (audio or video). When a media file's quickkey is passed to the conversion server, an image will be returned, either associated artwork or the default image for audio or video.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- quick_key : The quickkey that identifies the file. Required if file_path is not passed. Takes precedence over file_path.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- artwork : The file key of the image to associate with the media file(s). Required if artwork_path is not passed. Takes precedence over artwork_path.
- artwork_path : The absolute path to a single image file in the session users account to associate to the media file(s). Required if artwork is not passed.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 110, 114 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - quick_key and artwork):
HTTPS://www.mediafire.com/api/1.5/file/set_artwork.php?session_token=&quick_key=qaxvrb4cpvvf6eo&artwork=pq1pmn1vckpsdqk&response_format=json&signature=
{
action: file/set_artwork,
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 2 (Success with XML - file_path and artwork_path):
HTTPS://www.mediafire.com/api/1.5/file/set_artwork.php?session_token=&file_path=Test%20002%2Ftestmov.mp4&artwork_path=Test%20002%2FNew%20Bitmap%20Image.bmp&response_format=xml&signature=
<action>file/set_artwork</action>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
Update
Description : Update a file's information.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- quick_key : The quickkey that identifies the file. Required if file_path is not passed. Takes precedence over file_path.
- file_path : The absolute path to a single file in the session user's account. Required if quick_key is not passed.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- filename : The name and mimetype extensions of the file (Should have same file type as the old file). The filename should be 3 to 255 in length. Mime type extension values: 'txt'.
- description : The description of the file.
- truncate : Specifies if the content of the file should be deleted. no(default) or yes.
- mtime : The date/time of the update. If not set, the current server time will be used. Refer to the following document for valid date/time formats: http://www.php.net/manual/en/datetime.formats.php
- privacy : Privacy of the file ('public' or 'private')
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
new_device_revision | The new revision number of the device | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 110, 118 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - quick_key, filename, and privacy):
HTTPS://www.mediafire.com/api/1.5/file/update.php?session_token=&quick_key=cdlevnue3hb482g&filename=Test%20002&description=Hello&privacy=private&response_format=json&signature=
{
action: file/update,
result: Success,
new_key: yes,
current_api_version: 1.5,
new_device_revision: 162710,
}
Example 2 (Success with XML - file_path and truncate=yes):
HTTPS://www.mediafire.com/api/1.5/file/update.php?session_token=&file_path=Test%20002%2Ftest%20002&truncate=yes&response_format=xml&signature=
<action>file/update</action>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
<new_device_revision>162711</new_device_revision>
Example 3 (Failure with JSON - Error 110):
HTTPS://www.mediafire.com/api/1.5/file/update.php?session_token=&quick_key=2fyldd8m3l9t0ct&filename=Test01&response_format=json&signature=
{
action: file/update,
message: Unknown or Invalid QuickKey,
error: 110,
result: Error,
new_key: yes,
current_api_version: 1.5,
}
Example 4 (Failure with XML - Error 118):
HTTPS://www.mediafire.com/api/1.5/file/update.php?session_token=&quick_key=2fyldd8m3l9t0ck&filename=#@4532&privacy=private&response_format=xml&signature=
<action>file/update</action>
<message>The File Name specified is invalid</message>
<error>118</error>
<result>Error</result>
<current_api_version>1.5</current_api_version>
Update File
Description :This API provides a simple way to override a file's contents and properties with the contents and properties of another file while preserving the original file's quickkey. This is a destructive operation in that the contents and properties of the original file are lost as well as the quickkey of the file being updated from. Both from_quickkey and to_quickkey have to be non-image files, have the same extension, and be owned by the same session user. See graphic below for visual explanation of this process.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- from_quickkey : The file key of the file being updated from. This file key is destroyed by this API. Required if from_path is not passed. Takes precedence over from_path.
- from_path : The absolute path to a single file in the session user's account to update from. The file key for this file is destroyed by this API. Required if from_quickkey is not passed.
- to_quickkey : The file key to the file being updated. The contents and properties of this file are over-written by the file specified in from_quickkey or from_path. Required if to_path is not passed. Takes precedence over to_path.
- to_path : The absolute path to a single file in the session user's account to be updated. Required if to_quickkey is not passed. The contents and properties of this file are over-written by the file specified in from_quickkey or from_path.
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
new_device_revision | The new revision number of the device | string | |
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - from_quickkey and to_path):HTTPS://www.mediafire.com/api/1.5/file/update_file.php?session_token=&from_quickkey=lbc4r1jhra9s0xg&to_path=Test%20002%2FUntitled(3).txt&response_format=json&signature=
{
action: file/update_file,
result: Success,
new_key: yes,
current_api_version: 1.5,
new_device_revision: 162716,
}
Example 1 (Success with XML - from_path and to_quickkey):
HTTPS://www.mediafire.com/api/1.5/file/update_file.php?session_token=&from_path=Test%20002%2FUntitled.txt&to_quickkey=akns2lffvinq5p7&response_format=xml&signature=
<action>file/update_file</action>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.5</current_api_version>
<new_device_revision>162717</new_device_revision>
Zip
Description : Download multiple files at once by packaging the files into a ZIP container. This API supports folders as input. A new call signature must be calculated after a successful download.
Required Parameters:
- none
Relative Parameters:
- keys : a comma-separated list of quickkeys and folderkeys to be zipped. Required if file_path and folder_path are not passed. Takes precedence over file_path and folder_path.
- file_path : The absolute path to a single file in the session user's account. Required if keys is not passed.
- folder_path : The absolute path to a single folder in the session user's account. Required if keys is not passed.
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- use_own_bandwidth : Confirm the download using the session user's bandwidth if the user is premium. no(default) or yes.
- allow_large_download : Confirm the download of a large archive greater than 2GB. no(default) or yes.
- meta_only : Only returns a json or xml response even on success. This will prevent returning the zip file back. 'yes' or 'no' (default 'no').
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type | Value |
---|---|---|---|
deprecated | Indicates this API is deprecated and should no longer be used. | string | yes |
error | The numerical error code | integer | 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157 |
message | The description of the error | string | |
result | Indicates if the API call was successful: 'Success' or 'Error' | string | Success, Error |
current_api_version | The latest stable API version number | string | |
new_key | Indicates a new call signature needs to be calculated. Applicable only when using Session Token v2 | string | yes |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with JSON - Success files owned by session user, keys, and meta_only=yes):
HTTPS://www.mediafire.com/api/1.5/file/zip.php?keys=cdlevnue3hb482g%2Clx8fb6gpizuuv9o%2Cqaxvrb4cpvvf6eo&session_token=&meta_only=yes&response_format=json&signature=
{
action: file/zip,
result: Success,
new_key: yes,
current_api_version: 1.5,
}
Example 2 (Success with XML - Success with files owned by session user and keys):
HTTPS://www.mediafire.com/api/1.5/file/zip.php?keys=69k6b40hdap5rp8%2Cx90a1vv7vx10pcu%2Ckazdx32ietmbyhp&session_token=&response_format=xml&signature=
Zip file payload
Example 3 (Success with JSON - file_path and folder_path):
HTTPS://www.mediafire.com/api/1.5/file/zip.php?file_path=test1.txt&folder_path=Test%20002&session_token=&response_format=json&signature=
Zip file payload
Example 4 (Failure with XML - Error 148):
http://www.mediafire.com/api/1.5/file/zip.php?session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e&keys=dd9cmgl746p4p
<response>
<action>file/update_password</action>
<myfiles_revision>
<revision>243</revision>
<epoch>1360959064</epoch>
</myfiles_revision>
<result>Success</result>
<current_api_version>1.5</current_api_version>
</response>
Example 5 (Failure with XML - Error 151):
http://businessdomaintest.mediafire.com/api/1.5/file/zip.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&keys=ixskrduth0rgs
<response>
<action>file/zip</action>
<message>The item you selected contained no files. You must select at least one file to zip</message>
<error>151</error>
<result>Error</result>
<current_api_version>1.5</current_api_version>
</response>