FileUnversioned

Configure One Time Download


Description : Allows configuring/modifying 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.

Optional Parameters
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • 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.0/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')


GET http://www.mediafire.com/api/unversioned/file/configure_one_time_download.php
POST http://www.mediafire.com/api/unversioned/file/configure_one_time_download.php

Example:

Request
http://www.mediafire.com/api/unversioned/file/configure_one_time_download.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_download</action>
    <one_time_download_request_count>1</one_time_download_request_count>
    <result>Success</result>
    <current_api_version>2.14</current_api_version>
</response>

Copy


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


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


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

Example:

Request
http://www.mediafire.com/api/unversioned/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>2.14</current_api_version>
</response>

Create


Description: Creates a new file.

Required Parameters:


Relative parameters:
  • file_extension: The mime type extension of the file. Required if filename is not set & passed. Ignored if filename is set & passed. Values: '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 folderkey 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 : Allows setting the created/modification date for the new file.
  • response_format : 'xml' or 'json' (default 'xml')


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

Example:

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

Create Snapshot


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

Required Parameters:


Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')


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

Example:

Request
http://www.mediafire.com/api/unversioned/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>2.14</current_api_version>
</response>

Delete


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.

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')

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

Example:

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

Get Flags


Deprecated. Use file/get_info instead.

Description: Returns a bitmask value of special information about a file.

Required Parameters:

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).Needed only when accessing a user's private files.
  • 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.

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')


GET http://www.mediafire.com/api/unversioned/file/get_flags.php
POST http://www.mediafire.com/api/unversioned/file/get_flags.php

Example:

Request
http://www.mediafire.com/api/unversioned/file/get_flags.php?session_token=736d51e04a51a2210f6182951d84bad3e9de5fa0dc12894589e83fa434e5276f9cc7f4aa00bf883d7269ec51ddd911014e30eac29ad754db7c8bfa166f7130373b39d6595a9dfda7&quick_key=p72btpmf38j5j09&quick_key=uau4cofs8ya82h4
Response
<response>
    <action>file/get_flags</action>
    <file_flag>
        <quickkey>uau4cofs8ya82h4</quickkey>
        <flags>0</flags>
    </file_flag>
    <deprecated>yes</deprecated>
    <result>Success</result>
    <current_api_version>2.14</current_api_version>
</response>

Get Info


Description: Returns a list of the file's details. This call will return the quickkey, filename, creation date, description, status, size, flag ...etc.

Notes: Response modified to include permissions section for files shared to the session user.

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.

Optional Parameters:


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

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></current_api_version>
</response>

Property: flag

This is a bit-mask value indicating special details about a file. The following is a list of bits and their meanings:

  • 1: Indicates whether this file is owned by the current session user.
  • 2: File is supported for preview.
  • 4: File is editable.

Property: shared_by_user
Will be set to '1' if the user has shared the file with anyone. Not present otherwise.

Property: permissions
Present if the session user has permissions to the file. Values: 0=read, 1=read+write, 2=manage (Not In Use).



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: ,
}


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.

Special Note About Link Penalties: Streaming bandwidth is deducted at the time the link is created.

Required Parameters:

  • quick_key : The quickkey that identifies the file. You can also specify multiple quickkeys separated by commas.

Optional 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.
  • link_type : Specify which link type is to be returned. If not passed, all link types are returned. Values: 'view', 'edit', 'normal_download', 'direct_download', 'one_time_download'. With the direct_download link, users have a daily free bandwidth of 50 GB.
  • response_format : 'xml' or 'json' (default 'xml')

Possible Error Messages
  • edit_error_message:
    • User lacks edit permissions
    • File is not editable
  • one_time_download_error_message
    • User is not authenticated
    • No session token provided
    • Daily limit for one-time download links exceeded
    • Daily limit for one-time download links of this DMCA-flagged file exceeded
    • Link unavailable
  • direct_download_error_message
    • Insufficient bandwidth
    • Insufficient Permissions
    • Link unavailable
  • direct_download_error
    • 40: Link unavailable
    • 41: Account suspended
    • 44: Insufficient bandwidth
    • 45: Insufficient Permissions


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

Example:

Request
http://www.mediafire.com/api/unversioned/file/get_links.php?session_token=51465350a6de13090bb3225dd2a9c3df0af6fe9a5c773007a20b1da8c230729d50947f1fb0b61048050d96ed08c070fb0a03958d82bbeda744f06efca2aeca3bea21f7c1fb8862ee&quick_key=p72btpmf38j5j09
Response
<response>
    <action>file/get_links</action>
    <links>
        <link>
            <quickkey>p72btpmf38j5j05</quickkey>
            <view>http://www.mediafire.com/view/p72btpmf38j5j05</view>
            <normal_download>http://www.mediafire.com/?p72btpmf38j5j05</normal_download>
            <direct_download>http://199.91.152.147/dv6nnr2bs7dg/p72btpmf38j5j05/captcha.png</direct_download>
            <edit>http://www.mediafire.com/edit/?ne27ous5suoue2y12sbc98bkeco67ic</edit>
            <one_time_download>http://www.mediafire.com/?l99pgavoodvc08ynxgflgp078xrgurz</one_time_download>
        </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>2.14</current_api_version>
</response>

Get Status


Description : Returns the status of a document or an image. This call is designed to bypass some of the more aggressive caching in order to provide a more effective and reliable polling target. Refer to 'Status property' section for more details.

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.

Optional Parameters:

GET http://www.mediafire.com/api/unversioned/file/get_status.php
POST http://www.mediafire.com/api/unversioned/file/get_status.php

Example:

Request
http://www.mediafire.com/api/unversioned/file/get_status.php?session_token=ab951de178b31957f16a769ea69b58b5bf33f6b1bc03077c99d79d8605ed9a1e45b7edf2a9952fe18fd512bce0fa2d4f1fc1ee92215f33700be424d184e3637ca15a90108a2813fe&quick_key=p72btpmf38j5j05
Response
<response>
    <action>file/get_status</action>
    <file_status>
        <quickkey>p72btpmf38j5j05</quickkey>
        <status/>
    </file_status>
    <result>Success</result>
    <current_api_version>2.14</current_api_version>
</response>

Get Versions


Description : Returns a list of all file versions.

Required Parameters:


Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')


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

Example:

Request
http://www.mediafire.com/api/unversioned/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:03</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>2.14</current_api_version>
</response>

Move


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.

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


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

Example:

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

One Time Download


Functionality Scenarios Notes

  • 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.

Description : Creates a one-time download link. A one time download link is a download 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).

Required Parameters

  • 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].
  • 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.0/8, 145.230.230.115-145.230.240.33, 78.192.10.10').
  • response_format : 'xml' or 'json' (default 'xml')


GET http://www.mediafire.com/api/unversioned/file/one_time_download.php
POST http://www.mediafire.com/api/unversioned/file/one_time_download.php

Example:

Request
http://www.mediafire.com/api/unversioned/file/one_time_download.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&quick_key=kefnlyjopexkaae&duration=3600&email_notification=yes&success_callback_url=http://someurl.com
Response:
<response>
    <action>file/one_time_download</action>
    <one_time_download_request_count>1</one_time_download_request_count>
    <one_time_download_request_max_count>5000</one_time_download_request_max_count>
    <one_time_download>http://www.mediafire.com/?48z0b1awog9jyfrgxcr46kkwu3vsrer</one_time_download>
    <token>48z0b1awog9jyfrgxcr46kkwu3vsrer</token>
    <result>Success</result>
    <current_api_version>2.14</current_api_version>
</response>

Purge


Description : Permanently delete a user's file.

Required Parameters:

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • 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.

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')


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

Example:

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

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

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • number_of_files : Indicates the number of quickkeys to be returned.
  • response_format : 'xml' or 'json' (default 'xml')


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

Example:

Request
http://www.mediafire.com/api/unversioned/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>2.14</current_api_version>
</response>


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.

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')


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

Example:

Request
http://www.mediafire.com/api/unversioned/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>2.14</current_api_version>
</response>

Set Flags


Deprecated. Use file/update instead.

Description : Sets the bits in the file's flags.

Required Parameters:

  • session_token :(needed only when accessing user's private files) 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. The maximum number of quickkeys allowed is 500.
  • bit : The number of the bit to modify (starting from 0).
  • value : The value to set the above bit to. It can only take the value 0 or 1.

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')


GET http://www.mediafire.com/api/unversioned/file/set_flags.php
POST http://www.mediafire.com/api/unversioned/file/set_flags.php

Example:

Request
http://www.mediafire.com/api/unversioned/file/set_flags.php?session_token=50adfd2c3ccb2246d8997840c54e986fbb8f5f445df069c5e474136640944272190551be7c816ed70bd4f4853a874e7df519987210dcd9daa160f61ef1841b9c7dda380bad84886b&quick_key=h8w6sywa7yfrc1z&bit=0&value=1
Response
<response>
    <action>file/restore</action>
    <device_revision>123</device_revision>
    <deprecated>yes</deprecated>
    <result>Success</result>
    <current_api_version>2.14</current_api_version>
</response>

Update


Description : Update a file's information.

Required Parameters:


Relative Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • file_extension : The mime type extension of the file. Required if filename is not set & passed. Ignored if filename is set & passed. values: 'txt'.

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')
  • timezone : The code of the local timezone of the user.
  • tags : A space-separated list of tags. Deprecated. Do not use.
  • note_subject: The subject of the file's note. Deprecated. Do not use.
  • note_description:The description of the file's note. Deprecated. Do not use.
  • response_format : 'xml' or 'json' (default 'xml')

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

Example:

Request
http://www.mediafire.com/api/unversioned/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.6</revision>
        <epoch>1360959064</epoch>
    </myfiles_revision>
    <device_revision>123</device_revision>
    <result>Success</result>
    <current_api_version>2.14</current_api_version>
</response>

Update File


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.

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')

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

Example:

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

Update Password


Deprecated. File-specific passwords are no longer in use.

Description : Update a file's password.

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.
  • password : The new password to be set. To remove the password protection, pass an empty string.

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')

GET http://www.mediafire.com/api/unversioned/file/update_password.php
POST http://www.mediafire.com/api/unversioned/file/update_password.php

Example:

Request
http://www.mediafire.com/api/unversioned/file/update_password.php?session_token=11e9322290284ce58b3f80e9d897a18eb3737e80d0202def2983d02887fff8ccec01b1046e064beeefc94ab118c2531d34f316e4e5567da064cf73d35af55012d6e4e3ba22e0c142&quick_key=08iqaa1a492vf1v&password=testchangepass
Response
<response>
    <action>file/update_file</action>
    <myfiles_revision>
        <revision>243.11</revision>
        <epoch>1360959064</epoch>
    </myfiles_revision>
    <device_revision>123</device_revision>
    <deprecated>yes</deprecated>
    <result>Success</result>
    <current_api_version>2.14</current_api_version>
</response>

Zip


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.

Optional Parameters:
  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature). The session token is needed only when:
    • The session user wants to include private items when downloading owned files and folders, or
    • 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')

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

Example (Success):

Request
http://www.mediafire.com/api/unversioned/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/unversioned/file/zip.php?session_token=5335c97f17426e9a077cefcc5ee02d7a66b480ddabd34a76696ab9830f17d7f724bf44e4fb29ca5c2c023f9a4c9f3e9752aac7b29fa911faf0e577e94a84f7f1971ee51ff145968e&keys=dd9cmgl746p4p
Response
<response>
    <action>file/update_password</action>
    <myfiles_revision>
        <revision>243.9</revision>
        <epoch>1360959064</epoch>
    </myfiles_revision>
    <result>Success</result>
    <current_api_version>2.14</current_api_version>
</response>

Example 3 (Error 151):

Request
http://businessdomaintest.mediafire.com/api/unversioned/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>2.14</current_api_version>
</response>