File1.2

Configure One Time Key


GET http://www.mediafire.com/api/1.2/file/configure_one_time_key.php
POST http://www.mediafire.com/api/1.2/file/configure_one_time_key.php

Note: API name change from file/configure_one_time_download.

Description : Allows configuring/modifying of the options 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 : 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 : This is the call signature that is required to authenticate a type 2 session token transaction.

Optional Parameters:

  • duration : The number of minutes this link is valid. There isn't a default. If 'duration' is not assigned, the link expires whenever it was originally set to expire.
  • email_notification : Whether or not to send an email notification to the file owner. 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 a comma-separated list of IP masks/ranges to restrict the download to matching user IP addresses. (e.g. '68.154.11.2/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
one_time_key_request_count How many one-time links the session user has requested in a 24-hour period 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):

Request
http://www.mediafire.com/api/1.2/file/configure_one_time_key.php?session_token=35a203a91867b2737af3d63462ce7d5473f07e6b0463ba0e9092a049866c20adc1ff4c1461e4843ca44468803781fe774e769a8a62c48b11810678ad7ceb9c485efa5e9e7b1302d0&token=yuuib4pk0i0uf586ta6gil1r3j92f98&duration=7200&email_notification=no&success_callback_url=http://www.yourcompany.com/my_callback.php&error_callback_url=http://www.yourcompany.com/error_callback.php&burn_after_use=yes&response_format=xml
Response:
<response>
    <action>file/configure_one_time_key</action>
    <one_time_key_request_count>0</one_time_key_request_count>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
  </response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/1.2/file/configure_one_time_key.php?quick_key=kefnlyjopexkaae&token=48z0b1awog9jyfrgxcr46kkwu3vsrer&duration=7200&email_notification=no&success_callback_url=http://anotherurl.com&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json
Response:
Request:
http://www.mediafire.com/api/1.2/file/configure_one_time_key.php?quick_key=kefnlyjopexkaae&token=48z0b1awog9jyfrgxcr46kkwu3vsrer&duration=7200&email_notification=no&success_callback_url=http://anotherurl.com&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json
 
Response:
{
  "response": {
    "action": "file/configure_one_time_key",
    "one_time_download_request_count": "1",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Copy


GET http://www.mediafire.com/api/1.2/file/copy.php
POST http://www.mediafire.com/api/1.2/file/copy.php

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.

Description : Copy a file to a specified folder. 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:


Relative Parameters:

  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.

Optional Parameters:

  • folder_key : The key that identifies the destination folder. If omitted, the destination folder will be the root folder (My files).
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type
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
current_api_version The latest stable API version number string
device_revision The revision number of the cloud device integer
result Indicates if the API call was successful: 'Success' or 'Error' string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/copy.php?session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e&quick_key=cu8pzeipcz2hhhn&folder_key=dd9cmgl746p4p
Response
<response>
    <action>file/copy</action>
    <new_quickkeys>
        <new_quickkey>jf4bcgrbrqz0185</new_quickkey>
    </new_quickkeys>
    <skipped_count>0</skipped_count>
    <other_count>0</other_count>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/1.2/file/copy.php?quick_key=cu8pzeipcz2hhhn&folder_key=dd9cmgl746p4p&response_format=json&session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e
Response
{
  "response": {
    "action": "file/copy",
    "new_quickkeys": [
    	"jf4bcgrbrqz0185"
    ],
    "skipped_count": "0",
    "other_count": "0",
    "device_revision": "123",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Create


GET http://www.mediafire.com/api/1.2/file/create.php
POST http://www.mediafire.com/api/1.2/file/create.php

Note: Added new parameter 'type'.

Description: Creates a new file.

Optional Parameters:


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 : This is the call signature that is required to authenticate a type 2 session token transaction.

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).
  • 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
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
mimetype Mimetype of the file string
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 the file. Values: 0=read, 1=read+write, 2=manage (Not In Use). integer
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
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
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag
flag **see note below** bitmask
Note: A bitmask value specifying special details about a file. The following is a list of bits and their meanings. Flag descriptions not present are for internal MediaFire use only and therefore not on public distribution:
  • 1 : File is owned by the session user.
  • 2 : File is supported for preview.
  • 4 : File is editable.
  • 8 : File is virus-flagged

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):

Request
http://www.mediafire.com/api/1.2/file/create.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&filename=test_create_file.txt
Response
<response>
    <action>file/create</action>
    <fileinfo>
        <quickkey>h8rhtpjx9za16cb</quickkey>
        <filename>test_create_file.txt</filename>
        <created>2013-02-18 16:17:29</created>
        <downloads>0</downloads>
        <description/>
        <size>2</size>
        <privacy>public</privacy>
        <password_protected>no</password_protected>
        <filetype>other</filetype>
        <flag>2</flag>
    </fileinfo>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/1.2/file/create.php?filename=test_create_file.txt&type=text&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
Response
{
  "response": {
    "action": "file/create",
    "fileinfo": {
      "quickkey": "okwz9xx0x9s1mu3",
      "filename": "test_create_file.txt",
      "created": "2014-11-11 18:25:27",
      "downloads": "0",
      "description": "",
      "size": "2",
      "privacy": "public",
      "password_protected": "no",
      "hash": "6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28",
      "filetype": "document",
      "mimetype": "text/plain",
      "flag": "22",
      "revision": "58624",
      "view": "1",
      "edit": "1",
      "links": {
        "view": "http://www.mediafire.com/view/okwz9xx0x9s1mu3/test_create_file.txt",
        "read": "http://www.mediafire.com/view/okwz9xx0x9s1mu3/test_create_file.txt",
        "edit": "http://www.mediafire.com/edit/okwz9xx0x9s1mu3/test_create_file.txt",
        "normal_download": "http://www.mediafire.com/file/okwz9xx0x9s1mu3/test_create_file.txt",
        "direct_download": "http://download1644.mediafire.com/sq3b2w09ucmg/okwz9xx0x9s1mu3/test_create_file.txt",
        "streaming": "http://transcode1.mediafire.com/3n5gj57ju8og/okwz9xx0x9s1mu3/6c17/test_create_file.txt",
        "one_time": {
          "download": "http://www.mediafire.com/?c8em9wy65w81lhy2cxo19bc0433zm9k",
          "view": "http://www.mediafire.com/view/c8em9wy65w81lhy2cxo19bc0433zm9k"
        }
      }
    },
    "result": "Success",
    "current_api_version": "1.2",
    "device_revision": 58626
  }
}

Create Snapshot


GET http://www.mediafire.com/api/1.2/file/create_snapshot.php
POST http://www.mediafire.com/api/1.2/file/create_snapshot.php

Description: Creates a duplicate of a file as a new revision.

Required Parameters:


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):

Request
http://www.mediafire.com/api/1.2/file/create_snapshot.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb
Response
<response>
    <action>file/create_snapshot</action>
    <new_revision>1520</new_revision>
    <old_revision>1519</old_revision>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/create_snapshot.php?quick_key=h8rhtpjx9za16cb&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
Response
{
  "response": {
    "action": "file/create_snapshot",
    "new_revision": "1520",
    "old_revision": "1519",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Delete


GET http://www.mediafire.com/api/1.2/file/delete.php
POST http://www.mediafire.com/api/1.2/file/delete.php

Description: Delete a user's file. The file is moved 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 : 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
device_revision The revision number of the device integer
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/delete.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb
Response
<response>
    <action>file/delete</action>
    <myfiles_revision>
        <revision>456922</revision>
        <epoch>1360959064</epoch>
    </myfiles_revision>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/delete.php?quick_key=h8rhtpjx9za16cb&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
Response
{
  "response": {
    "action": "file/delete",
    "myfiles_revision": {
      "revision": "456922",
      "epoch": "1360959064"
    },
    "device_revision": "123",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Get Info


GET http://www.mediafire.com/api/1.2/file/get_info.php
POST http://www.mediafire.com/api/1.2/file/get_info.php

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:


Optional Parameters:

  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type
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
filetype The file type string
mimetype The mimetype of the file string
owner_name The owner of the file string
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 the file. Values: 0=read, 1=read+write, 2=manage (Not In Use). integer
parent_folderkey The key of the folder containing the file string
revision The amount of revisions made to 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
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
view The view URL of the file (this is listed under "links") string
normal_download The download URL of the file (this is listed under "links) string
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag
flag **see note below** bitmask

Note: A bitmask value specifying special details about a file. The following is a list of bits and their meanings (meanings not listed are internal MediaFire notifications and not meant for public distribution):
  • 1: File is owned by the session user.
  • 2: File is supported for preview.
  • 4: File is editable.
  • 8: File is virus flagged.

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Example 1 (File owned by a session user):

Request
http://www.mediafire.com/api/file/get_info.php?session_token=123456789012345678901234567890123456789012345678901234567890&quick_key=8c4ff4fzufdbbip&version=1
Response
<response>
  <action>file/get_info</action>
  <file_info>
    <quickkey>z3gwya3gv0j3rwd</quickkey>
    <filename>1368028908.dat</filename>
    <created>2013-05-08 11:00:47</created>
    <downloads>0</downloads>
    <description>Test doc</description>
    <size>4194304</size>
    <privacy>public</privacy>
    <password_protected>no</password_protected>
    <hash>6edfd801c5431b350eafdab5a981c9286cb996a881fd646a5935d792b74242b2</hash>
    <filetype>other</filetype>
    <mimetype>application/octet-stream</mimetype>
    <owner_name>TestHerbert</owner_name>
    <flag>2</flag>
    <shared_by_user>1</shared_by_user>
    <permissions>2</permissions>
    <parent_folderkey>7gpavwtgpcpr9</parent_folderkey>
    <revision>145</revision>
  </file_info>
  <result>Success</result>
  <current_api_version>1.2</current_api_version>
</response>

Example 2 (File is shared with session user):

Request
HTTPS://dev.mediafire.com/api/1.0/file/get_info.php?quick_key=3lpuc2dct3xw0o7&session_token=&response_format=json&signature=
Response
response:{
   action: file/get_info,
   file_info:{
      quickkey: 3lpuc2dct3xw0o7,
      filename: Tree Ornaments.jpg,
      created: 2014-06-17 13:15:40,
      description: ,
      size: 876926,
      privacy: public,
      password_protected: no,
      hash: 68cfaeb3c9847f99918751143749606cb6cc1210f08e4f405d06aee8e08787ca,
      filetype: image,
      mimetype: image/jpeg,
      owner_name: Test 02,
      flag: 4,
      permissions:{
         value: 1,
         explicit: 1,
         read: 1,
         write: 0,
      }
      revision: 150,
      view: 2,
      edit: 0,
      links:{
         view: http://dev.mediafire.com/view/3lpuc2dct3xw0o7/Tree_Ornaments.jpg,
         normal_download: http://dev.mediafire.com/file/3lpuc2dct3xw0o7/Tree_Ornaments.jpg,
      }
   }
   result: Success,
   new_key: yes,
   current_api_version: 1.2,
}


GET http://www.mediafire.com/api/1.2/file/get_links.php
POST http://www.mediafire.com/api/1.2/file/get_links.php

Notes: Beginning with version 1.0, the parameter link_type accepts a new argument, streaming, but only for apps granted permission to request streaming links. Additionally, beginning in 1.0, response structures replaced one_time_download with a one_time parent structure holding download and view links. Streaming bandwidth is deducted at the time the link is used.

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 : This is the call signature that is required to authenticate a type 2 session token transaction.

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
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Link Responses:
Name Description Type
quickkey The quickkey of the file string
view The view link of the file string
read The read-only link of the file string
edit_error_message The error message of the file. 'File is not editable' string
normal_download The normal download link of the file string

Download Link Responses:
Name Description Type
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

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (All Links with XML):

Request
http://www.mediafire.com/api/1.2/file/get_links.php?quick_key=awexld5n7qmj5hy&session_token=bca2ed5fa166eb0916f83f2d0bd7ac85d107bee5dd3d26f7835595168237dfd51ba628df05c3ce91d38c2718f2f6cc4bf82ef31a418f2d85309732b8b020e629ad3824647529f6eb
Response
<response>
  <action>file/get_links</action>
  <links>
    <link>
      <quickkey>awexld5n7qmj5hy</quickkey>
      <view>http://dev.mediafire.com/view/awexld5n7qmj5hy/Marugame_Castle_Path.jpg</view>
      <edit_error_message>File is not editable</edit_error_message>
      <normal_download>http://dev.mediafire.com/file/awexld5n7qmj5hy/Marugame_Castle_Path.jpg</normal_download>
      <direct_download_error_message>Link unavailable</direct_download_error_message>
      <direct_download_error>40</direct_download_error>
      <one_time>
        <download>http://dev.mediafire.com/?x1n363923sxe4e064mjn2mpg44hj7mw</download>
        <view>http://dev.mediafire.com/view/x1n363923sxe4e064mjn2mpg44hj7mw</view>
      </one_time>
    </link>
  </links>
  <one_time_download_request_count>1</one_time_download_request_count>
  <direct_download_free_bandwidth>0</direct_download_free_bandwidth>
  <result>Success</result>
  <current_api_version>1.2</current_api_version>
</response>

Example 2 (All Links with JSON):

Request
http://www.mediafire.com/api/1.2/file/get_links.php?quick_key=awexld5n7qmj5hy&response_format=json&session_token=bca2ed5fa166eb0916f83f2d0bd7ac85d107bee5dd3d26f7835595168237dfd51ba628df05c3ce91d38c2718f2f6cc4bf82ef31a418f2d85309732b8b020e629ad3824647529f6eb
Response
{
  "response": {
  "action": "file\/get_links",
  "links": [
    {
      "quickkey": "awexld5n7qmj5hy",
      "view": "http:\/\/dev.mediafire.com\/view\/awexld5n7qmj5hy\/Marugame_Castle_Path.jpg",
      "edit_error_message": "File is not editable",
      "normal_download": "http:\/\/dev.mediafire.com\/file\/awexld5n7qmj5hy\/Marugame_Castle_Path.jpg",
      "direct_download_error_message": "Link unavailable",
      "direct_download_error": "40",
      "one_time": {
        "download": "http:\/\/dev.mediafire.com\/?tkxcoz2nehqjxvr444iz4oxe37boxyh",
        "view": "http:\/\/dev.mediafire.com\/view\/tkxcoz2nehqjxvr444iz4oxe37boxyh"
      }
    }
  ],
  "one_time_download_request_count": "2",
  "direct_download_free_bandwidth": "0",
  "result": "Success",
  "current_api_version": "1.2"
  }
}

Example 3 (Listen Links with XML):

Request
http://www.mediafire.com/api/1.2/file/get_links.php?quick_key=ll3wpapd57suvdk,a7udmnczzdsk633,bt7ts8ai6a9gh3f&link_type=listen&session_token=bca2ed5fa166eb0916f83f2d0bd7ac85d107bee5dd3d26f7835595168237dfd51ba628df05c3ce91d38c2718f2f6cc4bf82ef31a418f2d85309732b8b020e629ad3824647529f6eb
Response
<response>
  <action>file/get_links</action>
  <links>
    <link>
      <quickkey>ll3wpapd57suvdk</quickkey>
      <listen>
        http://dev.mediafire.com/listen/ll3wpapd57suvdk/variableman_1_dick_64kb.mp3
      </listen>
    </link>
    <link>
      <quickkey>a7udmnczzdsk633</quickkey>
      <listen>
        http://dev.mediafire.com/listen/a7udmnczzdsk633/variableman_2_dick_64kb.mp3
      </listen>
    </link>
    <link>
      <quickkey>bt7ts8ai6a9gh3f</quickkey>
      <listen>
        http://dev.mediafire.com/listen/bt7ts8ai6a9gh3f/variableman_3_dick_64kb.mp3
      </listen>
    </link>
  </links>
  <result>Success</result>
  <current_api_version>1.2</current_api_version>
</response>

Example 4 (Listen Links with JSON):

Request
http://www.mediafire.com/api/1.2/file/get_links.php?quick_key=ll3wpapd57suvdk,a7udmnczzdsk633,bt7ts8ai6a9gh3f&link_type=listen&response_format=json&session_token=bca2ed5fa166eb0916f83f2d0bd7ac85d107bee5dd3d26f7835595168237dfd51ba628df05c3ce91d38c2718f2f6cc4bf82ef31a418f2d85309732b8b020e629ad3824647529f6eb
Response
{
  "response": {
  "action": "file\/get_links",
  "links": [
    {
      "quickkey": "ll3wpapd57suvdk",
      "listen": "http:\/\/dev.mediafire.com\/listen\/ll3wpapd57suvdk\/variableman_1_dick_64kb.mp3"
    },
    {
      "quickkey": "a7udmnczzdsk633",
      "listen": "http:\/\/dev.mediafire.com\/listen\/a7udmnczzdsk633\/variableman_2_dick_64kb.mp3"
    },
    {
      "quickkey": "bt7ts8ai6a9gh3f",
      "listen": "http:\/\/dev.mediafire.com\/listen\/bt7ts8ai6a9gh3f\/variableman_3_dick_64kb.mp3"
    }
  ],
  "result": "Success",
  "current_api_version": "1.2"
  }
}

Example 5 (Direct Download with XML):

Request
http://www.mediafire.com/api/1.2/file/get_links.php?quick_key=e6wzpz7hkiwq3m7&link_type=direct_download&session_token=a37cd44897687b2b8a35d4e03bc6739f525b9e4998d546ba67729e65d1b320bb390c350f38984c5f021421c0a44d1599ce5f7baf2875cf3976d7d3a9f2aa414c32542cb60d9744ec
Response
<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.2</current_api_version> </response>

Example 6 (Direct Download with JSON):

Request
http://www.mediafire.com/api/1.2/file/get_links.php?quick_key=e6wzpz7hkiwq3m7&link_type=direct_download&response_format=json&session_token=a37cd44897687b2b8a35d4e03bc6739f525b9e4998d546ba67729e65d1b320bb390c350f38984c5f021421c0a44d1599ce5f7baf2875cf3976d7d3a9f2aa414c32542cb60d9744ec
Response
{
  "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.2"
  }
}

Example 7 (Multiple Links with XML):

Request
http://www.mediafire.com/api/1.2/file/get_links.php?quick_key=jbt6l1k35btl13k&link_type=normal_download,direct_download&session_token=a37cd44897687b2b8a35d4e03bc6739f525b9e4998d546ba67729e65d1b320bb390c350f38984c5f021421c0a44d1599ce5f7baf2875cf3976d7d3a9f2aa414c32542cb60d9744ec
Response
<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.2</current_api_version>
</response>

Get Versions


GET http://www.mediafire.com/api/1.2/file/get_versions.php
POST http://www.mediafire.com/api/1.2/file/get_versions.php

Description : Returns a list of all file versions.

Required Parameters:


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
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. 'yes' or 'no' yes/no flag
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/get_versions.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb
Response
<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.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/get_versions.php?quick_key=h8rhtpjx9za16cb&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
Response
{
  "response": {
    "action": "file/get_versions",
    "file_versions": [
      {
        "revision": "50035",
        "date": "2011-10-25 14:28:03"
      },
      {
        "revision": "50034",
        "date": "2011-10-25 14:28:03"
      },
      {
        "revision": "50033",
        "date": "2013-06-25 14:53:11"
      }
    ],
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Move


GET http://www.mediafire.com/api/1.2/file/move.php
POST http://www.mediafire.com/api/1.2/file/move.php

Description : Move a file, or list of files, to a folder.

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 : This is the call signature that is required to authenticate a type 2 session token transaction.

Optional Parameters:

  • folder_key : The folderkey that identifies the destination folder. If omitted, the destination folder will be the root folder (My Files).
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type
revision The revision number of the file integer
epoch [DEPRECATED] integer
device_revision The revision number of the cloud device integer
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/move.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=08iqaa1a492vf1v&folder_key=l0g2q7xz3ga6m
Response
<response>
    <action>file/move</action>
    <myfiles_revision>
        <revision>456222</revision>
        <epoch>1360959064</epoch>
    </myfiles_revision>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/move.php?quick_key=08iqaa1a492vf1v&folder_key=l0g2q7xz3ga6m&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json

Response
{
  "response": {
    "action": "file/move",
    "myfiles_revision": {
      "revision": "243.5",
      "epoch": "1360959064"
    },
    "device_revision": "123",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

One Time Key


GET http://www.mediafire.com/api/1.2/file/one_time_key.php
POST http://www.mediafire.com/api/1.2/file/one_time_key.php

Notes: API name change from file/one_time_download. Additionally, one-time-keys now support the generation of one-time keys for document viewing.

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:


Relative Parameters:

  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.

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. '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 to restrict the download to matching user's IP addresses. (e.g. '68.154.11.2/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
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
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string

Links
Name Description Type
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):

Request
http://www.mediafire.com/api/file/one_time_key.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&quick_key=kefnlyjopexkaae&duration=3600&email_notification=yes&success_callback_url=http://someurl.com

Response:
  <response>
    <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>
    <links>
      <download>http://dev.mediafire.com/8x22y4kiak8uu41iaegcibq1xcx5zmc</download>
      <view>http://dev.mediafire.com/view/8x22y4kiak8uu41iaegcibq1xcx5zmc</view>
    </links>
    <token>8x22y4kiak8uu41iaegcibq1xcx5zmc</token>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
  </response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/1.2/file/one_time_key.php?quick_key=ei1sd03zsets218&session_token=88015ddfeb6b5681a4de1d74d295e9dfb8e5d857e8977e717acac7c8b8edf302b3fa3e9193e24d041b60ead56570e8c6acb94c0497d7fc22479fe4b1af01c9eabc87c209121ae322&response_format=json


Response:
{
  "response": {
    "action": "file/one_time_key",
    "one_time_key_request_count": "0",
    "one_time_key_request_max_count": "10",
    "links": {
      "download": "http://www.mediafire.com/?b2bnap3xw9uezhjdal20j3a9fclmy83",
      "view": "http://www.mediafire.com/view/b2bnap3xw9uezhjdal20j3a9fclmy83"
    },
    "token": "b2bnap3xw9uezhjdal20j3a9fclmy83",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Purge


GET http://www.mediafire.com/api/1.2/file/purge.php
POST http://www.mediafire.com/api/1.2/file/purge.php

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 : 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
device_revision The revision number of the device integer
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/purge.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb
Response
 <response>
    <action>file/purge</action>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
    <device_revision>4963</device_revision>
  </response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/purge.php?quick_key=h8rhtpjx9za16cb&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
Response
{
  "response": {
    "action": "file/purge",
    "device_revision": "123",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Recently Modified


GET http://www.mediafire.com/api/1.2/file/recently_modified.php
POST http://www.mediafire.com/api/1.2/file/recently_modified.php

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 : This is the call signature that is required to authenticate a type 2 session token transaction.

Optional Parameters:

  • number_of_files : Indicates the number of quickkeys to be returned.
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type
quickkey The quickkey of the file which was revised. This property will repeat until the number specified in the optional parameter is reached. string
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/recently_modified.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc
Response
<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.2</current_api_version>
</response>


Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/recently_modified.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json
Response
{
  "response": {
    "action": "file/recently_modified",
    "quickkeys": [
      "pk6wac3kn4hqs6h",
      "tg4vt34w0k9c0zb",
      "ouyzeu9z52527yv",
      "qjnkolnr7cjs137",
      "x4aub1yln8h8ae8",
      "qz5talh1ay6a8h3",
      "k44s7l2ybympf13",
      "2gurwo528sbf63e",
      "6ypjovee3urtscm",
      "pmohk1mdjdd08mw"
    ],
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Restore


GET http://www.mediafire.com/api/1.2/file/restore.php
POST http://www.mediafire.com/api/1.2/file/restore.php

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 : 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
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' yes/no flag
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/restore.php?session_token=11e9325290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=h8rhtpjx9za16cb&revision=50393
Response
<response>
    <action>file/restore</action>
    <asynchronous>yes</asynchronous>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/restore.php?quick_key=h8rhtpjx9za16cb&revision=50393&session_token=11e9325290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json

Response
{
  "response": {
    "action": "file/restore",
    "asynchronous": "yes",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Update


GET http://www.mediafire.com/api/1.2/file/update.php
POST http://www.mediafire.com/api/1.2/file/update.php

Description : Update a file's information.

Note: The following optional APIs were deprecated: note_subject, note_description, tags.

Required Parameters:


Relative Parameters:

  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.

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
revision The revision number of the file integer
epoch [DEPRECATED] integer
device_revision The revision number of the device integer
result Indicates if the API call was successful: 'Success' or 'Error' string
current_api_version The latest stable API version number string
new_key Indicates if a new session token was created. 'yes' or 'no' yes/no flag

Error Codes

To view a list of possible error codes for this API, and their descriptions, click here.


Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/update.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=08iqaa1a492vf1v&filename=test_update_file&description=test_desc&privacy=private
Response
<response>
    <action>file/update</action>
    <myfiles_revision>
        <revision>243</revision>
        <epoch>1360959064</epoch>
    </myfiles_revision>
    <device_revision>123</device_revision>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/update.php?quick_key=08iqaa1a492vf1v&filename=test_update_file&description=test_desc&privacy=private&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json
Response
{
  "response": {
    "action": "file/update",
    "myfiles_revision": {
      "revision": "243.6",
      "epoch": "1360959064"
    },
    "device_revision": "123",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Update File


GET http://www.mediafire.com/api/1.2/file/update_file.php
POST http://www.mediafire.com/api/1.2/file/update_file.php

Description : Update a file's quickkey with another file's quickkey.

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 to be overwritten. After this operation, this quickkey will be invalid.
  • to_quickkey : The new quickkey that will point to the file previously identified by from_quickkey.

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
revision The revision number of the file integer
epoch [DEPRECATED] integer
device_revision The revision number of the device 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:

Request
http://www.mediafire.com/api/1.2/file/update_file.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&from_quickkey=08iqaa1a492vf1v&to_quickkey=hy8l46d39k8wb6z
Response
<response>
    <action>file/update</action>
    <myfiles_revision>
        <revision>243</revision>
        <epoch>1360959064</epoch>
    </myfiles_revision>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/file/update_file.php?from_quickkey=08iqaa1a492vf1v&to_quickkey=hy8l46d39k8wb6z&session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&response_format=json


Response
{
  "response": {
    "action": "file/update_file",
    "myfiles_revision": {
      "revision": "243.11",
      "epoch": "1360959064"
    },
    "device_revision": "123",
    "result": "Success",
    "current_api_version": "1.2"
  }
}

Zip


GET http://www.mediafire.com/api/1.2/file/zip.php
POST http://www.mediafire.com/api/1.2/file/zip.php

Description : Bulk-download multiple files and folders into one single zip file.

Required Parameters:

  • keys : a comma-separated list of quickkeys and folderkeys to be zipped.

Relative Parameters:

  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.

Optional Parameters:

  • use_own_bandwidth :The session user wants to include private items when downloading owned files and folders, or
  • allow_large_download :If 'confirm_download' is set to 'yes', that is, when the session user wants to use their own bandwidth (if they are premium).
  • confirm_download : Confirm the download using the session user's bandwidth, and only if the user is premium. 'yes' or 'no' (default 'no').
  • 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')

Examples:


Example 1 (Success with XML):

Request
http://www.mediafire.com/api/1.2/file/zip.php?session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e&keys=dd9cmgl746p4p
Response
Zip File will be automatically downloaded

Example 2 (Error 148):

Request
http://www.mediafire.com/api/1.2/file/zip.php?session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e&keys=dd9cmgl746p4p
Response
<response>
    <action>file/update_password</action>
    <myfiles_revision>
        <revision>243</revision>
        <epoch>1360959064</epoch>
    </myfiles_revision>
    <result>Success</result>
    <current_api_version>1.2</current_api_version>
</response>

Example 3 (Error 151):

Request
http://businessdomaintest.mediafire.com/api/1.2/file/zip.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&keys=ixskrduth0rgs
Response
<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.2</current_api_version>
</response>