File1.3
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.3/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.3,
}
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.3</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.3</current_api_version>
Copy
Notes: All files, regardless of owner, can potentially be copied to a folder owned by the session user. Files not owned by the session user must be share link enabled to be copied.
The response property device_revision was renamed to new_device_revision.
Description : Copies a file from one account or location another account or location. Any file can be copied whether it belongs to the session user or another user. However, the target folder must be owned by the session caller. Private files not owned by the session caller cannot be copied.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- quick_key : The quickkey of the file to be copied. You can specify multiple quickkeys separated by a comma.
Relative Parameters:
- 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). Alternatively, you may pass myfiles as a folderkey moniker for the root folder.
- 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 XML):
http://www.mediafire.com/api/1.3/file/copy.php?session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e&quick_key=cu8pzeipcz2hhhn&folder_key=dd9cmgl746p4p
<response>
<action>file/copy</action>
<new_quickkeys>
<new_quickkey>jf4bcgrbrqz0185</new_quickkey>
</new_quickkeys>
<skipped_count>0</skipped_count>
<other_count>0</other_count>
<new_device_revision>123&/new_device_revision>
<result>Success</result>
<current_api_version>1.3</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/1.3/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.3"
}
}
Create
Description: Creates a new file.
Optional Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
Relative Parameters:
- file_extension: The file extension of the file. Required if filename is not set and passed. Ignored if filename is set and passed. The only extension currently supported is '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 of the file to be created. If not passed, a new name will be generated and file_extension is then required. The filename should be 3 to 255 characters in length.
- parent_key : The folder_key that identifies an existing folder in which the new file is to be created. If not specified, the new file will be created in the root folder (My files). Alternatively, you may pass myfiles as a folderkey moniker for the root folder.
- 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] | yes/no flag | |
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. 0 [not-viewable], 1 [PDF Viewer], 2 [PDF Viewer], 3 [deprecated]. | 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. 0 [not-editable], 1 [Text Editor], 2 [deprecated]. | 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.3/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.3</current_api_version>
<new_device_revision>161658</new_device_revision>
Example 2 (Success with JSON - filename & parent_key):
HTTPS://www.mediafire.com/api/1.3/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.3,
new_device_revision: 161659,
}
Example 3 (Success with JSON - file_extension=txt and filetype=text):
HTTPS://www.mediafire.com/api/1.3/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.3,
new_device_revision: 161660,
}
Create Snapshot
Description: Creates a duplicate of a file as a new revision.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- quick_key : The quickkey of the file requiring a snapshot.
Relative Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type |
---|---|---|
new_revision | The revision number of the file | integer |
old_revision | The prior revision number of the file | integer |
result | Indicates if the API call was successful: 'Success' or 'Error' | string |
current_api_version | The latest stable API version number | 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):
http://www.mediafire.com/api/1.3/file/create_snapshot.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb
<response>
<action>file/create_snapshot</action>
<new_revision>1520</new_revision>
<old_revision>1519</old_revision>
<result>Success</result>
<current_api_version>1.3</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/file/create_snapshot.php?quick_key=h8rhtpjx9za16cb&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
{
"response": {
"action": "file/create_snapshot",
"new_revision": "1520",
"old_revision": "1519",
"result": "Success",
"current_api_version": "1.3"
}
}
Delete
Notes: The response property device_revision was renamed to new_device_revision.
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.
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):
http://www.mediafire.com/api/1.3/file/delete.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb
<response>
<action>file/delete</action>
<myfiles_revision>
<revision>456922</revision>
</myfiles_revision>
<new_device_revision>123</new_device_revisions>
<result>Success</result>
<current_api_version>1.3</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/file/delete.php?quick_key=h8rhtpjx9za16cb&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
{
"response": {
"action": "file/delete",
"myfiles_revision": {
"revision": "456922",
},
"new_device_revision": "123",
"result": "Success",
"current_api_version": "1.3"
}
}
Get Info
Notes: The parameter quickkey accepts one-time keys for arguments. Additionally, responses for one-time keys do not include sections that would reveal the file key.
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:
- 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.
Relative Parameters:
- 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 | |
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. 'public' or 'private' | string | |
password_protected | Indicates if the file is password protected [DEPRECATED] | yes/no flag | |
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 | |
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. | integer flag | |
permissions | Present if the session user has permissions to a file not owned by the session user. | integer | |
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(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 tool | integer | 0(Not Editable), 1(ACE Editor) |
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 down 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->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 | |
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.3/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.3</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.3,
}
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.3,
}
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.3</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:
- quick_key : The quickkey that identifies the file. You can also specify multiple quickkeys separated by commas.
Relative Parameters:
- 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 | |
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 | |
view | The view link of the file | string | |
read | The read-only link of the file | string | |
watch | The watch link of the 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 | |
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 |
streaming | The transcode link to the file | string | |
one_time->download | The download link of the one-time file | string | |
one_time->watch | The watch link of the one-time file | string |
Download Link Responses:
Name | Description | Type | Value |
---|---|---|---|
download | The one time download link of the file | string | |
view | The one-time view link of the file | 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 |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XLM: Document type file owned by session user):
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.3,
}
Example 2 (Success with JSON - Video link owned by session user):
HTTPS://www.mediafire.com/api/1.0/file/get_links.php?&quick_key=qh5zn56433rp5kw&session_token=&response_format=json&signature=
{
action: file/get_links,
links:[
{
quickkey: qh5zn56433rp5kw,
watch: http://www.mediafire.com/watch/qh5zn56433rp5kw/My_Movie_1080_002.mp4,
edit_error_message: File is not editable,
normal_download: http://www.mediafire.com/file/qh5zn56433rp5kw/My_Movie_1080_002.mp4,
direct_download: http://download2113.mediafire.com/u0738c2788xg/qh5zn56433rp5kw/My+Movie+1080+002.mp4,
streaming: http://transcode1.mediafire.com/5ovhif5a0gig/qh5zn56433rp5kw/7db9/My+Movie+1080+002.mp4,
one_time:{
download: http://www.mediafire.com/?szuiwk1xwpfjuuvz6mmt7qupk5z1c8y,
watch: http://www.mediafire.com/watch/szuiwk1xwpfjuuvz6mmt7qupk5z1c8y,
}
}
]
one_time_download_request_count: 0,
direct_download_free_bandwidth: 1058,
result: Success,
new_key: yes,
current_api_version: 1.3,
}
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.3,
}
Example 4 (Success with JSON - A private file not owned by session user and lacking permissions):
HTTPS://dev.mediafire.com/api/file/get_links.php?quick_key=4sl620zf28na4wv&session_token=<token>&response_format=json&signature=<token>
{
action: file/get_links,
links:[
{
quickkey: 4sl620zf28na4wv,
error: User lacks permissions,
}
]
result: Success,
new_key: yes,
current_api_version: 1.3,
}
Example 5 (Direct Download with XML):
http://www.mediafire.com/api/1.3/file/get_links.php?quick_key=e6wzpz7hkiwq3m7&link_type=direct_download&session_token=a37cd44897687b2b8a35d4e03bc6739f525b9e4998d546ba67729e65d1b320bb390c350f38984c5f021421c0a44d1599ce5f7baf2875cf3976d7d3a9f2aa414c32542cb60d9744ec
<response>
<action>file/get_links</action>
<links>
<link>
<quickkey>e6wzpz7hkiwq3m7</quickkey>
<direct_download>
http://10.10.24.62/bh1b9qqny1sg/e6wzpz7hkiwq3m7/cliff-aliens-2.jpg
</direct_download>
</link>
</links>
<direct_download_free_bandwidth>0</direct_download_free_bandwidth>
<result>Success</result>
<current_api_version>1.3</current_api_version>
</response>
Example 6 (Direct Download with JSON):
http://www.mediafire.com/api/1.3/file/get_links.php?quick_key=e6wzpz7hkiwq3m7&link_type=direct_download&response_format=json&session_token=a37cd44897687b2b8a35d4e03bc6739f525b9e4998d546ba67729e65d1b320bb390c350f38984c5f021421c0a44d1599ce5f7baf2875cf3976d7d3a9f2aa414c32542cb60d9744ec
{
"response": {
"action": "file/get_links",
"links": [
{
"quickkey": "e6wzpz7hkiwq3m7",
"direct_download": "http://10.10.24.62/2jlguvwenxdg/e6wzpz7hkiwq3m7/cliff-aliens-2.jpg"
}
],
"direct_download_free_bandwidth": "0",
"result": "Success",
"current_api_version": "1.3"
}
}
Example 7 (Multiple Links with XML):
http://www.mediafire.com/api/1.3/file/get_links.php?quick_key=jbt6l1k35btl13k&link_type=normal_download,direct_download&session_token=a37cd44897687b2b8a35d4e03bc6739f525b9e4998d546ba67729e65d1b320bb390c350f38984c5f021421c0a44d1599ce5f7baf2875cf3976d7d3a9f2aa414c32542cb60d9744ec
<response>
<action>file/get_links</action>
<links>
<link>
<quickkey>jbt6l1k35btl13k</quickkey>
<direct_download>
http://10.10.24.62/bf2bn2dk3dng/jbt6l1k35btl13k/document_bill2.doc
</direct_download>
<normal_download>
http://www.mediafire.com/file/jbt6l1k35btl13k/document_bill2.doc
</normal_download>
</link>
</links>
<direct_download_free_bandwidth>0</direct_download_free_bandwidth>
<result>Success</result>
<current_api_version>1.3</current_api_version>
</response>
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).
- quick_key : The quickkey that identifies the file.
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 |
---|---|---|---|
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 |
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.3/file/get_versions.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb
<response>
<action>file/get_versions</action>
<file_versions>
<file_version>
<revision>50035</revision>
<date>2011-10-25 14:28:53</date>
</file_version>
<file_version>
<revision>50034</revision>
<date>2011-10-25 14:28:03</date>
</file_version>
<file_version>
<revision>50033</revision>
<date>2013-06-25 14:53:11</date>
</file_version>
</file_versions>
<result>Success</result>
<current_api_version>1.3</current_api_version>
</response>
Example 2 (Failure with XML - Error 104):
HTTPS://www.mediafire.com/api/file/get_versions.php?quick_key=5k6vgkdi9gvvbiy&response_format=xml&signature=
<action>file/get_versions</action>
<message>Session Token is missing</message>
<error>104</error>
<result>Error</result>
<current_api_version>1.3</current_api_version>
Move
Notes: The response property device_revision was renamed to new_device_revision.
Description : Move a file, or list of files, to a different location.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- quick_key : The quickkey, or a list of quickkeys, that identify the file(s) to be moved. Quickkeys must be separated by commas. The maximum number of quickkeys allowed is 500.
Relative Parameters:
- signature : Required only for session token version 2. Click here to learn more about building an API call signature.
Optional Parameters:
- folder_key : The folderkey that identifies the destination folder. If omitted, the destination folder will be '0' (the root folder - My Files). Alternatively, you may pass myfiles as a folderkey moniker for the root folder.
- 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 |
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 is owned by session user):
HTTPS://www.mediafire.com/api/1.3/file/move.php?session_token=&quick_key=c1mcd5nrbccs9mj&response_format=json&signature=
{
action: file/move,
new_names: ,
result: Success,
new_key: yes,
current_api_version: 1.3,
}
Example 2 (Failure with XML - Error 110):
HTTPS://www.mediafire.com/api/1.3/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.3</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 of the file to generate the one-time download link. If 'quick_key' is not passed, no link is generated, and the daily limit will be returned.
- 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.3/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 | |
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 | 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 - Without quickkey):
HTTPS://www.mediafire.com/api/1.1/file/one_time_key.php?session_token=&response_format=xml&signature=
<action>file/one_time_key</action>
<one_time_key_request_count>0</one_time_key_request_count>
<one_time_key_request_max_count>10</one_time_key_request_max_count>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>
Example 2 (Success with JSON - quickkey and get_counts_only=yes):
HTTPS://www.mediafire.com/api/1.1/file/one_time_key.php?session_token=&quick_key=j8v32p15g3gebid&get_counts_only=yes&response_format=json&signature=
{
action: file/one_time_key,
one_time_key_request_count: 0,
one_time_key_request_max_count: 10,
result: Success,
new_key: yes,
current_api_version: 1.3,
}
Example 3 (Success with JSON - With quickkey):
HTTPS://www.mediafire.com/api/1.1/file/one_time_key.php?session_token=&quick_key=j8v32p15g3gebid&response_format=json&signature=
{
action: file/one_time_key,
one_time_key_request_count: 0,
one_time_key_request_max_count: 10,
links:{
download: http://www.mediafire.com/?nxpqb4788fijc86o833gsag4pbbm58g,
listen: http://www.mediafire.com/listen/nxpqb4788fijc86o833gsag4pbbm58g,
}
token: nxpqb4788fijc86o833gsag4pbbm58g,
result: Success,
new_key: yes,
current_api_version: 1.3,
}
Example 4 (Failure with XML - Error 114):
HTTPS://www.mediafire.com/api/1.1/file/one_time_key.php?session_token=&quick_key=x2fu76gbv31x2b3&response_format=xml&signature=
<action>file/one_time_key</action>
<message>Access denied</message>
<error>114</error>
<result>Error</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>
Purge
Notes: The response property device_revision was renamed to new_device_revision.
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).
- quick_key : The quickkey, or a list of quickkeys separated by commas, that identify the files to be purged. The maximum number of quickkeys allowed is 500.
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 | 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):
HTTPS://www.mediafire.com/api/1.3/file/purge.php?session_token=&quick_key=ne65je49dqj99z1&response_format=json&signature=
{
action: file/purge,
result: Success,
new_key: yes,
current_api_version: 1.3,
new_device_revision: 161665,
}
Example 2 (Failure with XML - Error 110):
HTTPS://www.mediafire.com/api/1.3/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.3</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.3/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.3</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.3,
}
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).
- quick_key : The quickkey that identifies the file to be restored.
- revision : The revision to restore the file to.
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 |
---|---|---|---|
asynchronous | This property tells whether the request is being processed real-time. If the job is processed asynchronously, callers will need to poll device/get_status to determine when their job is complete. 'yes' or 'no' | flag | yes/no |
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):
http://www.mediafire.com/api/file/restore.php?quick_key=h8rhtpjx9za16cb&revision=50393&session_token=11e9325290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
{
"response": {
"action": "file/restore",
"asynchronous": "yes",
"result": "Success",
"current_api_version": "1.3"
}
}
Example 2 (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.3</current_api_version>
Example 3 (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.3</current_api_version>
Update
Notes: The response property device_revision was renamed to new_device_revision.
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).
- quick_key : The quickkey that identifies the file.
Relative Parameters:
- 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.
- 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 - filename=test):
HTTPS://www.mediafire.com/api/1.3/file/update.php?session_token=&quick_key=s5wcthzclpzxfwt&filename=test&response_format=json&signature=
{
action: file/update,
result: Success,
new_key: yes,
current_api_version: 1.3,
new_device_revision: 161668,
}
Example 2 (Failure with JSON - Error 110):
HTTPS://www.mediafire.com/api/1.3/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.3,
}
Example 3 (Failure with XML - Error 118):
HTTPS://www.mediafire.com/api/1.3/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.3</current_api_version>
Update File
Notes: The response property device_revision was renamed to new_device_revision.
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).
- from_quickkey : The quickkey of the file whose contents will replace another quickkey's contents. After this operation, this quickkey will be invalid.
- to_quickkey : The quickkey whose contents will be replaced with the contents of 'from_quickkey'. After this operation, the original contents of the to_quickkey file will be erased.
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 JSON):HTTPS://www.mediafire.com/api/1.3/file/update_file.php?session_token=&from_quickkey=rjr3ffv4ov8n8pp&to_quickkey=b5aho6dzmnz6tct&response_format=json&signature=
{
action: file/update_file,
result: Success,
new_key: yes,
current_api_version: 1.3,
new_device_revision: 161678,
}
Zip
Description : Bulk-download multiple files and/or folders into one single zip file.
Required Parameters:
- keys : a comma-separated list of quickkeys and folderkeys to be zipped.
Relative Parameters:
- 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 XML):
http://www.mediafire.com/api/1.3/file/zip.php?session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e&keys=dd9cmgl746p4p
Zip File will be automatically downloaded
Example 2 (Error 148):
http://www.mediafire.com/api/1.3/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.3</current_api_version>
</response>
Example 3 (Error 151):
http://businessdomaintest.mediafire.com/api/1.3/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.3</current_api_version>
</response>