Folder1.3

Copy


GET http://www.mediafire.com/api/1.3/folder/copy.php
POST http://www.mediafire.com/api/1.3/folder/copy.php

Notes: The response property device_revision was renamed to new_device_revision.

Description : Copy a folder and its content to another folder. If the folder is not owned by the session user, it will be added as a linked folder.

Required Parameters:

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • folder_key_src : The folderkey source is the folderkey of the desired folder you wish to copy. You can also specify multiple folderkeys 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:

  • folder_key_dst : The folderkey destination is the folderkey of the desired folder you wish to copy folder(s) to. If omitted, the foldersource(s) will be copied to root (My Files). 'myfiles' may be passed as a moniker for root.
  • 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' yes/no flag
error The numerical error code integer 112, 114
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
new_device_revision The revision number of the device. Returned only when the revision number has changed. integer
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
current_api_version The latest stable API version number string

New Folder Properties
Name Description Type Value
new_folderkey The new folderkey string

Error Codes

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


Examples:


Example 1 (Success with JSON - file owned by session user):

Request
HTTPS://www.mediafire.com/api/1.3/folder/copy.php?session_token=&folder_key_src=aoy55zbh8346b&folder_key_dst=dwr4tgrn9vsd0&response_format=json&signature=
Response
{
   action: folder/copy,
   asynchronous: no,
   new_folderkeys:[
      rfoh06y8w3amg,
   ]
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
   new_device_revision: 161681,
}

Example 2 (Success with JSON - public file NOT owned by session user):

Request
HTTPS://www.mediafire.com/api/1.3/folder/copy.php?session_token=&folder_key_src=jaebr616cg651&response_format=json&signature=
Response
{
   action: folder/copy,
   asynchronous: no,
   new_folderkeys:[
      sg60715mwg7yh,
   ]
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
   new_device_revision: 161682,
}

Create


GET http://www.mediafire.com/api/1.3/folder/create.php
POST http://www.mediafire.com/api/1.3/folder/create.php

Notes: The response property device_revision was renamed to new_device_revision. Returned only when the revision number has changed.
Parameter allow_duplicate_name renamed to action_on_duplicate and behavior updated for consistency.

Description: Creates a folder in a specified target destination.

Required Parameters:


Relative Parameters:

  • signature : Required only for session token version 2. Click here to learn more about building an API call signature.

Optional Parameters:

  • parent_key : The destination folder key. If not passed, device 0's(cloud) root is used. myfiles may be passed as a moniker for device 0's(cloud) root.
  • action_on_duplicate : Specifies the action to take when the folder already exists, by name, in the destination folder. The value 'skip' does nothing and returns success, 'keep' is the default and it creates the folder and makes the folder name unique by appending a number to it, and 'replace' returns the information for the existing folder.
  • mtime : The creation date of the added folder. If not set, 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
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type Value
folderkey The ID for the newly created folder string
folder_key The ID for the newly created folder string
parent_folderkey The ID key of the folder containing the newly created folder. Not returned when the parent folder is device 0's(cloud) root string
name The name of the newly created folder string
description The description for the newly created folder string
created The date and time the new folder was created string timestamp
privacy Indicates the privacy of the newly created folder. 'public' or 'private' string
file_count The amount of files contained in the newly created folder integer
folder_count The amount of folders contained in the newly created folder integer
revision The revision number of the newly created folder integer
dropbox_enabled Indicates if the newly created folder is a FileDrop. 'yes' or 'no' yes/no flag
flag A bitmask value specifying special details about a folder. '1' = 'Folder is owned by the session user'. Other bits not documented are internal MediaFire notations. bitmask
permissions Returned for non-owned folders the user has permissions to object
permissions --> value The specific permission level the user has to the folder integer 1(read), 2(read+write), 4(manage)[NOT IN USE]
permissions --> explicit Specifies whether the folder owner granted the permission flag yes/no
permissions --> read Specifies whether the user has read access to the folder flag yes/no
permissions --> write Specifies whether the user has write access to the folder flag yes/no
upload_key The upload key of the newly created folder string
error The numerical error code integer 114, 185
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
new_device_revision The revision number of the device. Returned only when the revision number has changed. integer
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
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.3/folder/create.php?session_token=123456789012345678901234567890123456789012345678901234567890&foldername=newfolder&version=1
Response
<response>
  <action>folder/create</action>
  <folderkey>91kukmyz71741</folderkey>
  <name>newfolder(2)</name>
  <description/>
  <created>2014-12-22 14:15:29</created>
  <privacy>private</privacy>
  <file_count>0</file_count>
  <folder_count>0</folder_count>
  <revision>2466</revision>
  <dropbox_enabled>no</dropbox_enabled>
  <flag>2</flag>
  <upload_key>
    119e85924136899667cd7f7bd65f7eef1d1a6d7847fc6b77f0a154af670496da
  </upload_key>
  <folder_key>91kukmyz71741</folder_key>
  <result>Success</result>
  <current_api_version>1.0</current_api_version>
  <new_device_revision>2468</new_device_revision>
</response>

Example 2 (Success with XML - action_on_duplicate=skip and folder exists, by name, in destination):

Request
HTTPS://www.mediafire.com/api/1.3/folder/create.php?session_token=&foldername=Test%20001&action_on_duplicate=skip&response_format=xml&signature=
Response
<action>folder/create</action>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Example 3 (Success with JSON - action_on_duplicate=keep and folder exists, by name, in destination):

Request
HTTPS://www.mediafire.com/api/1.3/folder/create.php?session_token=&foldername=Test%20002&action_on_duplicate=keep&response_format=json&signature=
Response
{
   action: folder/create,
   folderkey: c2jia5ap1q79p,
   name: Test 002(2),
   description: ,
   created: 2015-04-30 19:42:29,
   privacy: public,
   file_count: 0,
   folder_count: 0,
   revision: 161685,
   dropbox_enabled: no,
   flag: 2,
   upload_key: ba860a9208913ce508d8a638a7d1bbf7016d6b6ee64f7ba1ebf83e4806eab77b,
   folder_key: c2jia5ap1q79p,
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
   new_device_revision: 161685,
}

Example 4 (Success with JSON - action_on_duplicate=replace and folder exists, by name, in destination):
Request
HTTPS://www.mediafire.com/api/1.3/folder/create.php?session_token=&foldername=Test%20002&action_on_duplicate=replace&response_format=json&signature=
Response
{
   action: folder/create,
   folder_key: 2ynmtp05gd8p2,
   name: Test 002,
   upload_key: ba860a9208913ce508d8a638a7d1bbf7532a0f3ae332325d3f099d5d2e9c3cfd,
   created: 2015-04-28 17:40:52,
   privacy: private,
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 5 (Failure with XML - Error 114 with parent_key not owned by session user and lacking edit permissions):

Request
HTTPS://www.mediafire.com/api/1.3/folder/create.php?session_token=&foldername=Test%20001&action_on_duplicate=skip&response_format=xml&signature=
Response
<action>folder/create</action>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Delete


GET http://www.mediafire.com/api/1.3/folder/delete.php
POST http://www.mediafire.com/api/1.3/folder/delete.php

Notes: The response property device_revision was renamed to new_device_revision.

Description: Deletes one or more session user's folders by setting the folders' and their contents' delete_date properties and moving the folders and their contents to the trash can. The folder is not deleted permanently but, rather, the folder is moved to the trash can.

Required Parameters:

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • folder_key : The key that identifies the folder to be deleted. You can also specify multiple folderkeys 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
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
new_folderkey The new folderkey string
error The numerical error code integer 128, 159
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
new_device_revision The revision number of the device. Returned only when the revision number has changed. integer
result Indicates if the API call was successful. 'Error' or "Success' 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.3/folder/delete.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key=0dwzor67253tu
Response
<response>
    <action>folder/delete</action>
    <myfiles_revision>
        <revision>456222</revision>
    </myfiles_revision>
	<new_device_revision>123</new_device_revision>
    <result>Success</result>
    <current_api_version>1.3</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/folder/delete.php?folder_key=0dwzor67253tu&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json

Response
  {
  "response": {
    "action": "folder/delete",
    "myfiles_revision": {
      "revision": "456222",
    },
    "new_device_revision": "123",
    "result": "Success",
    "current_api_version": "1.3"
  }
}

Get Content


GET http://www.mediafire.com/api/1.3/folder/get_content.php
POST http://www.mediafire.com/api/1.3/folder/get_content.php

Description: Returns a collection of top-level folders or files for target folder.

Required Parameters:

  • none

Relative Parameters:
  • folder_key : The key that identifies the folder to be returned. If not passed, then it will return the root folder (session token is then required). Alternatively, you may pass myfiles as a folderkey moniker for the root folder.
  • 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:

  • content_type : Request what type of content ('folders' or 'files'). If not passed, it defaults to 'folders'.
  • filter : Filter by privacy and/or by filetype. This is a comma-separated list of file types and privacy options and can take one or more of the following values : "public", "private", "image", "video", "audio", "document", "spreadsheet", "presentation", "application", "archive", "data", and "development". If content_type is 'folders', only 'public' and 'private' filters are honored.
  • device_id : Specify which device to return the myfiles data from. If not set, it defaults to the cloud.
  • order_by : 'name', 'created', 'size', 'downloads' (default 'name'). In case of requesting folders, only 'name' and 'created' are considered; anything else will default to 'name'.
  • order_direction : Order direction: 'asc' or 'desc' (default 'asc').
  • chunk : Specifies which segment of the results to return starting from 1. Repeat calls to this API, incrementing chunk on each call, to obtain all the result data.
  • chunk_size: The number of items to include in each chunk returned. Range: 100 to 1000. Default: 100.
  • details : "yes", "no", or "shallow" ("no" by default). If "yes", the API returns the '''total_files''', '''total_folders''', and '''total_size''' for all the contained folders and files recursively of each folder. However, there is a limit on how many items can be counted. If the limit is reached, an extra property '''overflow''' will be returned as well. If "shallow" is specified, the API returns the '''byte_count''' of files immediately inside each folder (non-recursive).
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type Value
chunk_size The number of items returned in a single chunk.
content_type The type of content requested string folders/files
chunk_number The chunk number
more_chunks Indicates whether more chunks are available: 'yes' or 'no' yes/no flag
error The numerical error code integer 114
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
new_device_revision The revision number of the device. Returned only when the revision number has changed. integer
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
current_api_version The latest stable API version number string

Response for Files Contained Within Folder
Name Description Type Value
quickkey The quickey of the file inside the requested folder
hash The hash of the file
filename The file name
description The file description
size The file size
privacy The privacy of the file. 'public' or 'private'
created The date the file was created
password_protected Indicates if the file is password protected: 'yes' or 'no' [DEPRECATED] flag yes/no
mimetype The mimetype of the file
filetype The file type application, archive, audio, development, data, document, image, presentation, spreadsheet, video
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]. 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].
revision The file revision
downloads The amount of times the file has been downloaded
views The amount of times the file has been viewed
flag **see note below** bitmask 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 Value
view The view link of the file (if applicable)
read The read only link of the file (if applicable)
edit The edit link of the file (if applicable)
watch A link to watch the file (if video)
listen A link to listen to the file (if audio)
normal_download The normal download link of the file
direct_download The direct download link of the file
streaming The streaming link of the file (if applicable)
download The download link of the file

One-time Link Information
Name Description Type Value
download A one-time link to download the file
view A one-time link to view the file (if applicable)
watch A one-time link to watch the file (if video)
listen A one-time link to listen to the file (if audio)

Response for a Folder Contained Within the Folder
Name Description Type Value
folderkey The folderkey of the folder string
name The name of the folder string
description The description of the folder string
privacy The security setting for the folder string private/public
created The date and time the folder was created string timestamp
revision The revision number of the folder integer
file_count The amount of files within the folder integer
folder_count The amount of folders within the folder integer
dropbox_enabled Indicates if the folder is FileDrop enabled flag yes/no
flag The bitmask value specifying special details about a file bitmask '1' = File is owned by the session user

Error Codes

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


Examples:


Example 1 (Success with JSON - content_type=folders and details=no):

Request
HTTPS://www.mediafire.com/api/1.2/folder/get_content.php?session_token=&folder_key=2ynmtp05gd8p2&content_type=folders&filter=all&order_by=created&order_direction=asc&details=no&response_format=json&signature=
Response
{
   action: folder/get_content,
   asynchronous: no,
   folder_content:{
      chunk_size: 100,
      content_type: folders,
      chunk_number: 1,
      folders:[
         {
            folderkey: n3erva9t9rn36,
            name: Test 002-001,
            description: ,
            privacy: private,
            created: 2015-04-29 13:57:24,
            revision: 161604,
            flag: 2,
            file_count: 7,
            folder_count: 1,
            dropbox_enabled: no,
         }
         {
            folderkey: t240hiidaa4le,
            name: Test 002-002,
            description: ,
            privacy: private,
            created: 2015-04-29 13:57:30,
            revision: 161605,
            flag: 2,
            file_count: 8,
            folder_count: 1,
            dropbox_enabled: no,
         }
      ]
      more_chunks: no,
   }
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 2 (Success with XML - content_type=folders and details=yes):

Request
HTTPS://www.mediafire.com/api/1.2/folder/get_content.php?session_token=&folder_key=2ynmtp05gd8p2&content_type=folders&filter=all&order_by=created&order_direction=asc&details=yes&response_format=xml&signature=
Response
<action>folder/get_content</action>
<asynchronous>no</asynchronous>
<folder_content>
   <chunk_size>100</chunk_size>
   <content_type>folders</content_type>
   <chunk_number>1</chunk_number>
   <folders>
      <folder>
         <folderkey>n3erva9t9rn36</folderkey>
         <name>Test 002-001</name>
         <description></description>
         <privacy>private</privacy>
         <created>2015-04-29 13:57:24</created>
         <revision>161604</revision>
         <flag>2</flag>
         <file_count>7</file_count>
         <folder_count>1</folder_count>
         <dropbox_enabled>no</dropbox_enabled>
         <total_folders>0</total_folders>
         <total_files>2</total_files>
         <total_size>7763</total_size>
      </folder>
      <folder>
         <folderkey>t240hiidaa4le</folderkey>
         <name>Test 002-002</name>
         <description></description>
         <privacy>private</privacy>
         <created>2015-04-29 13:57:30</created>
         <revision>161605</revision>
         <flag>2</flag>
         <file_count>8</file_count>
         <folder_count>1</folder_count>
         <dropbox_enabled>no</dropbox_enabled>
         <total_folders>0</total_folders>
         <total_files>3</total_files>
         <total_size>3522583</total_size>
      </folder>
   </folders>
   <more_chunks>no</more_chunks>
</folder_content>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Example 3 (Success with XML - content_type=files):

Request
HTTPS://www.mediafire.com/api/1.2/folder/get_content.php?session_token=&folder_key=2ynmtp05gd8p2&content_type=files&filter=all&order_by=created&order_direction=asc&response_format=xml&signature=
Response
<action>folder/get_content</action>
<asynchronous>no</asynchronous>
<folder_content>
   <chunk_size>100</chunk_size>
   <content_type>files</content_type>
   <chunk_number>1</chunk_number>
   <files>
      <file>
         <quickkey>f6j1xykqhbtsdp5</quickkey>
         <hash>661ecd51fa36e3fad0e855c00beb3265c78fef3234131a0b671a740354b054a1</hash>
         <filename>t2.png</filename>
         <description></description>
         <size>553</size>
         <privacy>private</privacy>
         <created>2015-04-29 13:58:09</created>
         <password_protected>no</password_protected>
         <mimetype>image/png</mimetype>
         <filetype>image</filetype>
         <view>2</view>
         <edit>0</edit>
         <revision>161606</revision>
         <flag>6</flag>
         <downloads>0</downloads>
         <views>0</views>
         <links>
            <view>http://www.mediafire.com/view/f6j1xykqhbtsdp5/t2.png</view>
            <read>http://www.mediafire.com/view/f6j1xykqhbtsdp5/t2.png</read>
            <normal_download>http://www.mediafire.com/file/f6j1xykqhbtsdp5/t2.png</normal_download>
            <direct_download>http://download1335.mediafire.com/s3ntadl4cpbg/f6j1xykqhbtsdp5/t2.png</direct_download>
            <one_time>
               <download>http://www.mediafire.com/?di3q6ef9w9alnro8rh7qjhurgzvni13</download>
               <view>http://www.mediafire.com/view/di3q6ef9w9alnro8rh7qjhurgzvni13</view>
            </one_time>
         </links>
      </file>
      <file>
         <quickkey>rra6c0loi1aet6l</quickkey>
         <hash>b5e0ef3f79c2b91f44fd88794939eae37ede7b2f82f53de617a2f61b1338ebb9</hash>
         <filename>t1.png</filename>
         <description></description>
         <size>2986</size>
         <privacy>private</privacy>
         <created>2015-04-29 13:58:09</created>
         <password_protected>no</password_protected>
         <mimetype>image/png</mimetype>
         <filetype>image</filetype>
         <view>2</view>
         <edit>0</edit>
         <revision>161607</revision>
         <flag>6</flag>
         <downloads>0</downloads>
         <views>0</views>
         <links>
            <view>http://www.mediafire.com/view/rra6c0loi1aet6l/t1.png</view>
            <read>http://www.mediafire.com/view/rra6c0loi1aet6l/t1.png</read>
            <normal_download>http://www.mediafire.com/file/rra6c0loi1aet6l/t1.png</normal_download>
            <direct_download>http://download851.mediafire.com/tvpadd243dag/rra6c0loi1aet6l/t1.png</direct_download>
            <one_time>
               <download>http://www.mediafire.com/?hckptbs28eedpzxjfrsgp39az9tzvzb</download>
               <view>http://www.mediafire.com/view/hckptbs28eedpzxjfrsgp39az9tzvzb</view>
            </one_time>
         </links>
      </file>
   </files>
   <more_chunks>no</more_chunks>
</folder_content>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Example 4 (Success with JSON - content_type=files and public folder_key not owned by session user that contains one file shared to session user):

Request
HTTPS://www.mediafire.com/api/1.2/folder/get_content.php?session_token=&folder_key=adhh9bywxj7b4&content_type=files&filter=all&order_by=created&order_direction=asc&response_format=json&signature=
Response
{
   action: folder/get_content,
   asynchronous: no,
   folder_content:{
      chunk_size: 100,
      content_type: files,
      chunk_number: 1,
      files:[
         {
            quickkey: 7i3m3xyjgb4un5l,
            hash: 9336396d039d29899898ba6d3c9035e2371d3d7d572317517761fd5208912c25,
            filename: Sample - Cherry Blossoms.jpg,
            description: Cherry Blossoms by Jeff Kubina http://www.flickr.com/photos/kubina/448485266/,
            size: 2207340,
            privacy: public,
            created: 2014-09-16 15:00:47,
            password_protected: no,
            mimetype: image/jpeg,
            filetype: image,
            view: 2,
            edit: 0,
            revision: 1119,
            flag: 4,
            permissions:{
               value: 2,
               explicit: 1,
               read: 1,
               write: 1,
            }
            links:{
               view: http://www.mediafire.com/view/7i3m3xyjgb4un5l/Sample_-_Cherry_Blossoms.jpg,
               read: http://www.mediafire.com/view/7i3m3xyjgb4un5l/Sample_-_Cherry_Blossoms.jpg,
               normal_download: http://www.mediafire.com/file/7i3m3xyjgb4un5l/Sample_-_Cherry_Blossoms.jpg,
               direct_download: http://download1646.mediafire.com/vecg99jb6yeg/7i3m3xyjgb4un5l/Sample+-+Cherry+Blossoms.jpg,
               one_time:{
                  download: http://www.mediafire.com/?h23l847z938o6f52wot7wlxp6k3kt8u,
                  view: http://www.mediafire.com/view/h23l847z938o6f52wot7wlxp6k3kt8u,
               }
            }
         }
         {
            quickkey: bnc267333scir17,
            hash: 78b9847be03dea76714ed4249cef6c2f7816cb6318f8e04b6812a491f314ca06,
            filename: Sample - Curious Portrait.jpg,
            description: Curious Portrait by Andrew Wong http://www.flickr.com/photos/wongdood/,
            size: 2470389,
            privacy: public,
            created: 2014-09-16 15:00:47,
            password_protected: no,
            mimetype: image/jpeg,
            filetype: image,
            view: 2,
            edit: 0,
            revision: 1118,
            flag: 4,
            links:{
               view: http://www.mediafire.com/view/bnc267333scir17/Sample_-_Curious_Portrait.jpg,
               read: http://www.mediafire.com/view/bnc267333scir17/Sample_-_Curious_Portrait.jpg,
               normal_download: http://www.mediafire.com/file/bnc267333scir17/Sample_-_Curious_Portrait.jpg,
            }
         }
      ]
      more_chunks: no,
   }
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 5 (Failure with XML - Error 114 with private folder_key not owned by session user):

Request
HTTPS://www.mediafire.com/api/1.2/folder/get_content.php?session_token=&folder_key=854vy14gg1vi9&content_type=folders&filter=all&order_by=created&order_direction=asc&response_format=xml&signature=
Response
<action>folder/get_content</action>
<message>Access denied</message>
<error>114</error>
<result>Error</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Get Depth


GET http://www.mediafire.com/api/1.3/folder/get_depth.php
POST http://www.mediafire.com/api/1.3/folder/get_depth.php

Description: Specifies how deep in the folder structure, how far from root, the target folder is. The number of levels deep is returned with a list of "chain folders" which illustrate the direct path from root to the target folder.

Required Parameters:


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
folderkey The folderkey for the newly created folder string
name The name of the newly created folder string
depth The numerical distance of the specified folder from the root folder integer
chain_folders A collection of folders, starting with the specified folder, linking back to root object
error The numerical error code integer
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
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.3/folder/get_depth.php?session_token=7bc1f2bdf00920e37553f1eaa04078fbdf5c28d8a3e6144ff26f89d3d980272a4561f99c404e70d9ffc8abf4220eba4f30e9d68132f6ae1f5a38342831d9b3c917504f5a01524bde&folder_key=2509mz6sb9swz
Response
<response>
    <action>folder/get_depth</action>
    <folder_depth>
        <depth>2</depth>
        <chain_folders>
            <chain_folder>
                <folderkey>2509mz6sb9swz</folderkey>
                <name>1</name>
            </chain_folder>
            <chain_folder>
                <folderkey>d3h9rqbm1dj3y</folderkey>
                <name>_3</name>
            </chain_folder>
        </chain_folders>
    </folder_depth>
    <result>Success</result>
    <current_api_version>1.3</current_api_version>
</response>

Example 2 (Success with JSON - public folder_key not owned by session user):

Request
HTTPS://www.mediafire.com/api/folder/get_depth.php?session_token=&folder_key=qa7e4d6wwbp51&response_format=json&signature=
Response
{
   action: folder/get_depth,
   folder_depth:{
      depth: 2,
      chain_folders:[
         {
            folderkey: qa7e4d6wwbp51,
            name: Test002,
         }
         {
            folderkey: tip1zg4gbsz4k,
            name: Test 01,
         }
      ]
   }
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Get Info


GET http://www.mediafire.com/api/1.3/folder/get_info.php
POST http://www.mediafire.com/api/1.3/folder/get_info.php

Description : Returns a list of a folder's details.

Required Parameters:

  • none

Relative Parameters:

  • folder_key : The key that identifies the folder to be returned. If not passed, then it will return the root folder (session token is then required). Alternatively, you may pass myfiles as a folderkey moniker for the root folder.
  • 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:

  • device_id : Specify which device to return the myfiles data. If not set, it defaults to the cloud.
  • details : "yes", "no", or "shallow" ("no" by default). If "yes", the API returns the '''total_files''', '''total_folders''', and '''total_size''' for all the contained folders and files recursively of each folder. However, there is a limit on how many items can be counted. If the limit is reached, an extra property '''overflow''' will be returned as well. If "shallow" is specified, the API returns the '''byte_count''' of files immediately inside each folder (non-recursive).
  • response_format : 'xml' or 'json' (default 'xml')

Response Properties

Name Description Type Value
result Indicates if the API call was successful. 'Error' or 'Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. flag yes/no
current_api_version The latest stable API version number string
folderkey The folderkey string
parent_folderkey The ID key of the folder containing this folder. Not returned when the parent folder is device 0's(cloud) root string
name The name of the folder string
description The folder description string
created The date and time the folder was created string timestamp
tag deprecated string
privacy The security of the file. 'public' or 'private' string
file_count The amount of files contained in the folder integer
folder_count The amount of folders in the folder integer
total_files The total amount of files contained within the folder and subfolders integer
total_folders The total amount of folders contained within the folder and subfolders integer
total_size The total folder size in bytes integer
byte_count The size of the folder incorporating only immediate content files integer
revision The revision number of the folder integer
dropbox_enabled Indicated whether the folder is a FileDrop. 'yes' or 'no' flag yes/no
flag A bit-mask value specifying special details about the folder or 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) [Flags not listed are for internal MediaFire operations and not public use]
owner_name The owner of the folder string
avatar The location of the avatar associated with the account string
shared_by_user Specifies whether the folder's owner has shared it to a contact string 0 (no), 1 (yes)
permissions The location of the avatar associated with the account string
permissions Returned for non-owned folders the user has permissions to object
permissions --> value The specific permission level the user has to the folder integer 1(read), 2(read+write), 4(manage)[NOT IN USE]
permissions --> explicit Specifies whether the folder owner granted the permission flag yes/no
permissions --> read Specifies whether the user has read access to the folder flag yes/no
permissions --> write Specifies whether the user has write access to the folder flag yes/no
delete_date The date and time the file was moved to the Trash (if applicable). string timestamp
error The numerical error code integer 114
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
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 - details=no):

Request
HTTPS://www.mediafire.com/api/folder/get_info.php?session_token=&folder_key=6bl6p2m44yvg5&details=no&response_format=xml&signature=
Response
<action>folder/get_info</action>
<folder_info>
   <folderkey>6bl6p2m44yvg5</folderkey>
   <parent_folderkey>k80i7ih0c40fr</parent_folderkey>
   <name>Test001</name>
   <description>Setting a description</description>
   <tags></tags>
   <created>2015-02-11 14:10:16</created>
   <privacy>public</privacy>
   <file_count>3</file_count>
   <folder_count>2</folder_count>
   <revision>158722</revision>
   <owner_name>Clint</owner_name>
   <avatar>https://www9.mediafire.com/convkey/8883/jzk02fgn9umj4lz1g.jpg</avatar>
   <dropbox_enabled>yes</dropbox_enabled>
   <flag>2</flag>
   <shared_by_user>1</shared_by_user>
</folder_info>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>


Example 3 (Success with JSON - details=shallow):

Request
HTTPS://www.mediafire.com/api/folder/get_info.php?session_token=&folder_key=6bl6p2m44yvg5&details=shallow&response_format=json&signature=
Response
{
   action: folder/get_info,
   folder_info:{
      folderkey: 6bl6p2m44yvg5,
      parent_folderkey: k80i7ih0c40fr,
      name: Test001,
      description: Setting a description,
      tags: ,
      created: 2015-02-11 14:10:16,
      privacy: public,
      file_count: 3,
      folder_count: 2,
      byte_count: 10569026,
      revision: 158722,
      owner_name: Clint,
      avatar: https://www9.mediafire.com/convkey/8883/jzk02fgn9umj4lz1g.jpg,
      dropbox_enabled: yes,
      flag: 2,
      shared_by_user: 1,
   }
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 4 (Success with XML - public folder_key not owned by session user and details=no):

Request
HTTPS://www.mediafire.com/api/folder/get_info.php?session_token=&folder_key=jklfakzr52gwo&details=no&response_format=xml&signature=
Response
<action>folder/get_info</action>
<folder_info>
   <folderkey>jklfakzr52gwo</folderkey>
   <name>Photos</name>
   <description></description>
   <tags></tags>
   <created>2014-06-17 10:37:14</created>
   <privacy>public</privacy>
   <file_count>7</file_count>
   <folder_count>0</folder_count>
   <revision>3722</revision>
   <owner_name>Test 02</owner_name>
   <avatar>https://www12.mediafire.com/convkey/b3bc/2944xlx2xzi9sbg1g.jpg</avatar>
   <flag>0</flag>
</folder_info>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Example 5 (Success with XML - public folder_key not owned by session user and details=yes):

Request
HTTPS://www.mediafire.com/api/folder/get_info.php?session_token=&folder_key=jklfakzr52gwo&details=yes&response_format=xml&signature=
Response
<action>folder/get_info</action>
<folder_info>
   <folderkey>jklfakzr52gwo</folderkey>
   <name>Photos</name>
   <description></description>
   <tags></tags>
   <created>2014-06-17 10:37:14</created>
   <privacy>public</privacy>
   <file_count>7</file_count>
   <folder_count>0</folder_count>
   <total_files>5</total_files>
   <total_folders>0</total_folders>
   <total_size>21460552</total_size>
   <revision>3722</revision>
   <owner_name>Test 02</owner_name>
   <avatar>https://www12.mediafire.com/convkey/b3bc/2944xlx2xzi9sbg1g.jpg</avatar>
   <flag>0</flag>
</folder_info>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Example 6 (Success with JSON - public folder_key not owned by session user and details=shallow):

Request
HTTPS://www.mediafire.com/api/folder/get_info.php?session_token=&folder_key=jklfakzr52gwo&details=shallow&response_format=xml&signature=
Response
{
   action: folder/get_info,
   folder_info:{
      folderkey: jklfakzr52gwo,
      name: Photos,
      description: ,
      tags: ,
      created: 2014-06-17 10:37:14,
      privacy: public,
      file_count: 7,
      folder_count: 0,
      byte_count: 21460552,
      revision: 3722,
      owner_name: Test 02,
      avatar: https://www12.mediafire.com/convkey/b3bc/2944xlx2xzi9sbg1g.jpg,
      flag: 0,
   }
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 2 (Success with JSON - public folder_key not owned by session user and session user has edit permissions and details=shallow):

Request
HTTPS://www.mediafire.com/api/folder/get_info.php?session_token=&folder_key=tip1zg4gbsz4k&details=shallow&response_format=json&signature=
Response
{
   action: folder/get_info,
   folder_info:{
      folderkey: tip1zg4gbsz4k,
      name: Test 01,
      description: ,
      tags: ,
      created: 2014-09-25 10:59:09,
      privacy: public,
      file_count: 148,
      folder_count: 1,
      byte_count: 702711,
      revision: 3724,
      owner_name: Test 02,
      avatar: https://www12.mediafire.com/convkey/b3bc/2944xlx2xzi9sbg1g.jpg,
      flag: 0,
      permissions:{
         value: 2,
         explicit: 1,
         read: 1,
         write: 1,
      }
   }
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 7 (Failure with JSON - Error 114 with private folder_key not owned by session user and session user lacks permissions):

Request
HTTPS://www.mediafire.com/api/folder/get_info.php?session_token=&folder_key=sasvmjen9mxhe&details=shallow&response_format=json&signature=
Response
{
   action: folder/get_info,
   message: Access denied,
   error: 114,
   result: Error,
   new_key: yes,
   current_api_version: 1.3,
}

Get Siblings


GET http://www.mediafire.com/api/1.3/folder/get_siblings.php
POST http://www.mediafire.com/api/1.3/folder/get_siblings.php

Description : Returns a collection of folders that are siblings of the target folder. Only public siblings are returned when the target folder is not owned by the session user.

Required Parameters:

  • folder_key : The key that identifies the folder requiring sibling information. If not passed, then it will return the root folder (session token is then required).

Relative Parameters:


Optional Parameters:

  • start : Request to return results or a subset of the siblings starting from this number.
  • limit : The maximum results to be returned.
  • response_format : 'xml' or 'json' (default 'xml')

Response Properties

Name Description Type Value
error The numerical error code integer 112, 114
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
current_api_version The latest stable API version number string

Sibling Folder Responses
Name Description Type Value
folderkey The folderkey string
name The folder name string
description The folder description string
created The date and time the folder was created string timestamp
privacy Indicates the folder's privacy string public/private
file_count The amount of files contained in the folder integer
folder_count The amount of folders contained in the folder integer
revision The folder revision integer
owner_name The folder owner's name string>
avatar The location of the folder's avatar string
dropbox_enabled Indicates if the folder is a FileDrop: 'yes' or 'no' yes/no flag
flag A bit-mask value specifying special details about the folder or 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) [Flags not listed are for internal MediaFire operations and not public use]

Error Codes

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


Examples:


Example 1 (Success with JSON):

Request
HTTPS://www.mediafire.com/api/1.0/folder/get_siblings.php?&folder_key=siss43vl5tew3&session_token=&response_format=json&signature=
Response
{
   action: folder/get_siblings,
   siblings:[
      {
         folderkey: jmnjvhijm7n41,
         name: Test 002,
         description: ,
         created: 2015-04-08 18:38:50,
         privacy: private,
         file_count: 0,
         folder_count: 0,
         revision: 161106,
         owner_name: Clint,
         avatar: https://www9.mediafire.com/convkey/8883/tzxx8g5ls936b571g.jpg,
         dropbox_enabled: no,
         flag: 2,
      }
      {
         folderkey: bwg3kssw4o5f7,
         name: Test 003,
         description: ,
         created: 2015-04-08 18:38:54,
         privacy: private,
         file_count: 0,
         folder_count: 0,
         revision: 161107,
         owner_name: Clint,
         avatar: https://www9.mediafire.com/convkey/8883/tzxx8g8ls836b571g.jpg,
         dropbox_enabled: no,
         flag: 2,
      }
   ]
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 2 (Success with XML - public folder_key not owned by session user):

Request
HTTPS://www.mediafire.com/api/1.0/folder/get_siblings.php?&folder_key=mfncvwuarcwr9&session_token=&response_format=xml&signature=
Response
<action>folder/get_siblings</action>
<siblings>
   <sibling>
      <folderkey>854vy14gg1vi9</folderkey>
      <name>Test 003</name>
      <description></description>
      <created>2015-04-08 18:41:49</created>
      <privacy>public</privacy>
      <file_count>0</file_count>
      <folder_count>0</folder_count>
      <revision>1089</revision>
      <owner_name>Test 03</owner_name>
      <avatar>https://www.mediafire.com/images/icons/myfiles/default.png</avatar>
      <flag>0</flag>
   </sibling>
</siblings>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Example 1 (Failure with JSON - Error 114 with private folder_key not owned by session user):

Request
HTTPS://www.mediafire.com/api/1.0/folder/get_siblings.php?&folder_key=jaebr616cg651&session_token=&response_format=json&signature=
Response
{
   action: folder/get_siblings,
   message: Access denied,
   error: 114,
   result: Error,
   new_key: yes,
   current_api_version: 1.3,
}

Move


GET http://www.mediafire.com/api/1.3/folder/move.php
POST http://www.mediafire.com/api/1.3/folder/move.php

Notes: The response property device_revision was renamed to new_device_revision.

Description : Move one or more user's folders to target destination.

Required Parameters:


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_dst : Call the folderkey that identifies the destination folder. If omitted, the destination folder will be 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
error The numerical error code integer
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
new_device_revision The revision number of the device. Returned only when the revision number has changed. integer
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
current_api_version The latest stable API version number string

Response when NOT specifying a destination folder which moves your folder to root (My Files)
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 flag yes/no
new_names A collection of folders entered that had their names changed to avoid collisions in the destination object
revision The My Files revision number (under 'myfiles_revision') integer
epoch [DEPRECATED] (under 'myfiles_revision')

Error Codes

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


Examples:


Example 1 (Success with JSON):

Request
HTTPS://www.mediafire.com/api/1.3/folder/move.php?session_token=&folder_key_src=t240hiidaa4le&response_format=json&signature=
Response
{
   action: folder/move,
   asynchronous: no,
   new_names: ,
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
   new_device_revision: 161690,
}

Example 2 (Success with JSON - folder_key_src not owned by session user and having edit permissions):

Request
HTTPS://www.mediafire.com/api/1.3/folder/move.php?session_token=&folder_key_src=adhh9bywxj7b4&folder_key_dst=zoppn89frkah9&response_format=json&signature=
Response
{
   action: folder/move,
   asynchronous: no,
   new_names: ,
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
   new_device_revision: 1134,
}

Example 2 (Failure with XML - Error 114 with folder_key_src not owned by session user and lacks edit permissions):

Request
HTTPS://www.mediafire.com/api/1.3/folder/move.php?session_token=&folder_key_src=354ziuhvffe29&folder_key_dst=4wld8uv6thlas&response_format=xml&signature=
Response
<action>folder/move</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


GET http://www.mediafire.com/api/1.3/folder/purge.php
POST http://www.mediafire.com/api/1.3/folder/purge.php

Notes: The response property device_revision was renamed to new_device_revision.

Description : Deletes one or more of a session user's folders permanently, along with all contents of the folders, by removing their entries from the database. THIS OPTION CANNOT BE UNDONE.

Required Parameters:


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
error The numerical error code integer 112, 114
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
new_device_revision The revision number of the device. Returned only when the revision number has changed. integer
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
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 JSON):

Request
HTTPS://www.mediafire.com/api/1.3/folder/purge.php?session_token=&folder_key=t240hiidaa4le%2Caoy55zbh8346b&response_format=json&signature=
Response
{
   action: folder/purge,
   asynchronous: no,
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
   new_device_revision: 161692,
}

Example 2 (Failure with JSON - Error 114 with folder_key not owned by session user):

Request
HTTPS://www.mediafire.com/api/1.3/folder/purge.php?session_token=&folder_key=tip1zg4gbsz4k&response_format=json&signature=
Response
{
   action: folder/purge,
   message: Access denied,
   error: 114,
   result: Error,
   new_key: yes,
   current_api_version: 1.3,
}


GET http://www.mediafire.com/api/1.3/folder/search.php
POST http://www.mediafire.com/api/1.3/folder/search.php

Note: The search term must be at least three characters in length.

Description : Searches the the content of a given folder. If folder_key is not passed, then the search will be performed on the root folder ("myfiles"). In this case, the session token will be required. To search the root folder on devices other than the cloud, pass the device_id. If device_id is '-1', then a global search on all devices will be performed.

Required Parameters:

  • search_text : The search keywords to look for in filenames, folder names, and descriptions. The string must be at least 3 characters in length.

Relative Parameters:

  • folder_key : Identify the folderkey of the folder to search. If not passed, the session token is then required, and the search will be performed on the root folder or the entire device according to search_all parameter. Alternatively, you may pass myfiles as a folderkey moniker for the root folder.
  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature). Needed only when accessing root folder, private folder, or the folder's private content.
  • signature : Required only for session token version 2. Click here to learn more about building an API call signature.

Optional Parameters:

  • filter : filter by privacy and/or by filetype. This is a comma-separated list of file types and privacy options. Can take one or more of the following values : "public", "private", "image", "video", "audio", "document", "spreadsheet", "presentation", "application", "archive", "data", and "development".
  • device_id : Specify which device to return the myfiles data. If not set, it defaults to the cloud. If it's set to -1, then search will be performed on all devices.
  • search_all : 'yes' or 'no'. If folder_key is passed, then this parameter is ignored. If folder_key is not passed, search_all can be used to indicate whether to search the root folder only or the entire device (default 'yes').
  • details: "yes", "no", or "shallow" ("no" by default). If "yes", the API returns the total_files, total_folders, and total_size for all the contained folders and files recursively of each folder. However, there is a limit on how many items can be counted. If the limit is reached, an extra property overflow will be returned as well. If "shallow" is specified, the API returns the byte_count of files immediately inside each folder (non-recursive).
  • response_format : 'xml' or 'json' (default 'xml')

Response Properties

Name Description Type Value
relevancy Specifies how close, as a percentage, the object matches the search term integer
error The numerical error code integer 128
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
current_api_version The latest stable API version number string
type The content type: 'file' or 'folder' string
quickkey The quickkey of the file found string
filename The file name string
parent_folderkey The parent folder key string
parent_name The parent folder name string
created The date/time the folder or file was created string timestamp
size The size of the file or folder in bytes integer
description The description of the file or folder string
password_protected Indicates if the file or folder is password protected. 'yes' or 'no' [DEPRECATED] yes/no flag
mimetype The mimetype of the file string
filetype The filetype string application, archive, audio, development, data, document, image, presentation, spreadsheet, video
view Specifies if this file is viewable via MediaFire and, if so, by what system 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 integer . 0 [not-editable], 1 [Text Editor], 2 [deprecated].
hash The hash of the file string
flag Details regarding the search results bitmask 1 (File is owned by the session user), 2 (File is supported for preview), 4 (File is editable), 8 (File is virus flagged) [Flags not listed are for internal MediaFire operations and not public use]
folderkey The folderkey string
name The folder or file name string
revision The revision number of the file or folder integer
privacy Indicates the privacy level of the file or folder string private/public

Error Codes

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


Examples:


Example 1 (Success with XML - folder results):

Request
HTTPS://www.mediafire.com/api/folder/search.php?search_text=test&session_token=&search_all=yes&details=yes&response_format=xml&signature=
Response
<action>folder/search</action>
<results_count>1</results_count>
<results>
   <result>
      <type>folder</type>
      <folderkey>k80i7ih0c40fr</folderkey>
      <name>Test(2)</name>
      <parent_folderkey>myfiles</parent_folderkey>
      <parent_name>myfiles</parent_name>
      <revision>159411</revision>
      <privacy>public</privacy>
      <total_folders>1</total_folders>
      <total_files>1</total_files>
      <total_size>2</total_size>
      <relevancy>100</relevancy>
   </result>
</results>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.3</current_api_version>

Example 2 (Success with JSON - file results):

Request
HTTPS://www.mediafire.com/api/folder/search.php?search_text=txt&session_token=&search_all=no&response_format=json&signature=
Response
{
   action: folder/search,
   results_count: 3,
   results:[
      {
         type: file,
         quickkey: 30d1fzd0pe02jg0,
         filename: Untitled(4).txt,
         parent_folderkey: k80i7ih0c40fr,
         parent_name: Test(2),
         created: 2015-02-10 12:57:49,
         revision: 159214,
         size: 2,
         description: ,
         privacy: public,
         password_protected: no,
         mimetype: text/plain,
         filetype: document,
         view: 1,
         edit: 1,
         hash: 6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28,
         flag: 22,
         relevancy: 100,
      }
      {
         type: file,
         quickkey: a12uq01083901wp,
         filename: Untitled(5).txt,
         parent_folderkey: myfiles,
         parent_name: myfiles,
         created: 2015-02-10 12:57:50,
         revision: 157690,
         size: 2,
         description: ,
         privacy: public,
         password_protected: no,
         mimetype: text/plain,
         filetype: document,
         view: 1,
         edit: 1,
         hash: 6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28,
         flag: 22,
         relevancy: 100,
      }
      {
         type: file,
         quickkey: n636ym47yzsy4h4,
         filename: Untitled.txt,
         parent_folderkey: myfiles,
         parent_name: myfiles,
         created: 2015-02-10 13:00:15,
         revision: 157688,
         size: 73,
         description: ,
         privacy: public,
         password_protected: no,
         mimetype: text/plain,
         filetype: document,
         view: 1,
         edit: 1,
         hash: bd1aaf062e391f0f7df720c477d8c1fe2e8197623835fc79bb0b5b64e5f41036,
         flag: 22,
         relevancy: 100,
      }
   ]
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 3 (Success with JSON - no results):

Request
HTTPS://www.mediafire.com/api/folder/search.php?search_text=none&session_token=&search_all=no&details=yes&response_format=json&signature=
Response
{
   action: folder/search,
   results_count: 0,
   results: ,
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 2 (Failure with XML - Error 128):

Request
HTTPS://www.mediafire.com/api/folder/search.php?search_text=tx&session_token=&search_all=no&response_format=xml&signature=
Response
<action>folder/search</action>
<message>Required parameters for this request are missing</message>
<error>128</error>
<result>Error</result>
<current_api_version>1.3</current_api_version>

Update


GET http://www.mediafire.com/api/1.3/folder/update.php
POST http://www.mediafire.com/api/1.3/folder/update.php

Notes: The response property device_revision was renamed to new_device_revision.

Description : Update a folder's information.

Required Parameters:


Relative Parameters:

  • signature : Required only for session token version 2. Click here to learn more about building an API call signature.

Optional Parameters:

  • foldername : The name of the folder.
  • description : The description of the folder.
  • privacy : Privacy of the folder ('public' or 'private').
  • privacy_recursive : Whether or not applying 'privacy' to sub-folders - 'yes' or 'no' (default 'no').
  • 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

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
error The numerical error code integer 128, 159
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
new_device_revision The revision number of the device. Returned only when the revision number has changed. integer
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
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 JSON - folder_name, description and privacy=public):

Request
HTTPS://www.mediafire.com/api/1.3/folder/update.php?session_token=&folder_key=o010fltlq2tdy&foldername=Test%20004&description=This%20is%20a%20test%20folder&privacy=public&privacy_recursive=yes&response_format=json&signature=
Response
{
   action: folder/update,
   asynchronous: no,
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
   new_device_revision: 161694,
}

Example 2 (Failure with JSON - Error 159):

Request
HTTPS://www.mediafire.com/api/1.3/folder/update.php?&session_token=&folder_key=bwg3kssw4o5f7&foldername=Test01&privacy=public&privacy_recursive=no&response_format=json&signature=
Response
{
   action: folder/update,
   message: This folder exists already,
   error: 159,
   result: Error,
   new_key: yes,
   current_api_version: 1.3,
}