Folder1.1
Copy
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.
Optional Parameters
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
- 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).
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
General Properties
- 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'
- device_revision: The device revision
- result: Indicates if the API call was successful. 'Error' or "Success'
- current_api_version: The API version
New Folder Properties
- new_folderkey: The new folderkey
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://www.mediafire.com/api/1.1/folder/copy.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key_src=bbm411lcts280&folder_key_dst=d2udzgjn5l5vd
<response>
<action>folder/copy</action>
<new_folderkeys>
<new_folderkey>8adbweycihdkd</new_folderkey>
</new_folderkeys>
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>
Create
Description: Creates a folder.
Required Parameters:
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- foldername : The name of the folder to be created.
Optional Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
- parent_key : The key that identifies an existing folder (use the folderkey to assign the folder) in which the new folder is to be created. If not specified, the new folder will be created in the root folder (My files).
- allow_duplicate_name : Allow the folder to be created if another folder with the same name in the same folder already exists. If set to 'yes' the new folder will be created but a number will be added to the end of the folder name (i.e. myfolder, myfolder(2), myfolder(3), and so on). If set to 'no' and folder name already exists, information for the existing folder will be returned. 'yes' or 'no' (default 'yes').
- 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
- folderkey: The folderkey for the newly created folder
- name: The name of the newly created folder
- description: The description for the newly created folder
- tags: The tag for the newly created folder [deprecated]
- created: The date and time the new folder was created
- privacy: Indicates the privacy of the newly created folder. 'public' or 'private'
- file_count: The amount of files contained in the newly created folder
- folder_count: The amount of folders contained in the newly created folder
- revision: The revision of the newly created folder
- dropbox_enabled: Indicates if the newly created folder is a dropbox. 'yes' or 'no'
- flag: The flag of the newly created folder
- upload_key: The upload key of the newly created folder
- folder_key: The folderkey for the newly created folder
- current_api_version: Indicates the API version used
- device_revision: The device revision
- result: Indicates if the API call was successful. 'Error' or 'Success'
Error From a Folder Name With Unknown Characters
- message: The specified Folder Name is invalid
- error: The error number for a bad folder name: 185
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://www.mediafire.com/api/1.1/folder/create.php?session_token=123456789012345678901234567890123456789012345678901234567890&foldername=newfolder&version=1
<response>
<action>folder/create</action>
<folder_key>n1b56566wj29q</folder_key>
<upload_key>a4c4a65d2e89a11733e9b61320d48100e04e75f6e8ebb871</upload_key>
<result>Success</result>
</response>
Delete
Description: Delete a user's folder. If called, 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.
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')
Response Properties
- 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'
- new_folderkey: The new folderkey
- device_revision: The device revision
- result: Indicates if the API call was successful. 'Error' or "Success'
- current_api_version: The API version
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://www.mediafire.com/api/1.1/folder/delete.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key=0dwzor67253tu
<response>
<action>folder/delete</action>
<myfiles_revision>
<revision>2.0</revision>
<epoch>1361220899</epoch>
</myfiles_revision>
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>
Get Content
Description: Returns either a list of folders or a list of files.
Required 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).
- session_token : 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.
- 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.
- 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
- chunk_size: The number of items returned in a single chunk.
- content_type: The type of content requested
- chunk_number: The chunk number
- more_chunks: Indicates whether more chunks are available: 'yes' or 'no'
- result: Indicates if the API call was successful. 'Error' or 'Success'
- new_key: Indicates if a new session token was created: 'yes' or 'no'
- current_api_version: Indicates the API version used
Response for Files Contained Within Folder
- 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]
- mimetype: The mimetype of the file
- filetype: The file type
- 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].
- 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
- flag: The bit-mask value specifying special details about a file (values not represented are for internal MediaFire documentation purposes):
- 1: File is owned by the session user.
- 2: File is supported for preview.
- 4: File is editable.
- 8: File is virus flagged.
- downloads: The amount of times the file has been downloaded
- views: The amount of times the file has been viewed
Link Information
- 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
- 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
- folderkey: The folderkey of the folder
- name: The name of the folder
- description: The description of the folder
- tags: The tags for the folder [deprecated]
- privacy: The security setting for the folder. 'private' or 'public'
- created: The date and time the folder was created
- revision: The revision of the folder
- flag: The bit-mask value specifying special details about a file (values not represented are for internal MediaFire documentation purposes):
- 1: File is owned by the session user.
- file_count: The amount of files within the folder
- folder_count: The amount of folders within the folder
- dropbox_enabled: Indicates if the folder is FileDrop enabled. 'yes' or 'no'
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example 1 (Folders):
http://www.mediafire.com/api/1.1/folder/get_content.php?folder_key=dh7ry84hqwh7t&session_token=12345678901234567890123456789012345678901234567890123456789012345678901234567890&content_type=folders
<response>
<action>folder/get_content</action>
<folder_content>
<chunk_size>100</chunk_size>
<content_type>folders</content_type>
<chunk_number>1</chunk_number>
<folders>
<folder>
<folderkey>1o2cqdg26o1ab</folderkey>
<name>Sumfin</name>
<description/>
<privacy>public</privacy>
<created>2013-02-26 16:55:34</created>
<revision>23369</revision>
<flag>2</flag>
<permissions>
<value>1</value>
<explicit>1</explicit>
<read>1</read>
<write>0</write>
</permissions>
<file_count>0</file_count>
<folder_count>0</folder_count>
<size>0</size>
<revision>
<revision>1</revision>
<epoch>1366050311</epoch>
</revision>
<dropbox_enabled>no</dropbox_enabled>
</folder>
</folders>
<folder>
<folderkey>41n5d51nabf79</folderkey>
<name>Copy this!</name>
<description/>
<privacy>private</privacy>
<created>2013-11-13 14:30:25</created>
<revision>22063</revision>
<flag>0</flag>
<file_count>500</file_count>
<folder_count>0</folder_count>
<grafted>yes</grafted>
<owner_name>Jonesy</owner_name>
<avatar>https://secure.gravatar.com/avatar/968aa19b0eeaadbf5aa8e75367e6c416?s=48&d=mm</avatar>
<dropbox_enabled>no</dropbox_enabled>
</folder>
</folder_content>
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>
Example 2 (Files):
http://www.mediafire.com/api/1.1/folder/get_content.php?folder_key=dh7ry84hqwh7t&session_token=12345678901234567890123456789012345678901234567890123456789012345678901234567890&content_type=files
<response>
<action>folder/get_content</action>
<folder_content>
<chunk_size>100</chunk_size>
<content_type>files</content_type>
<chunk_number>1</chunk_number>
<files>
<file>
<quickkey>cg66p0rrzs9grir</quickkey>
<filename>css workarounds.css</filename>
<description/>
<size>1628</size>
<privacy>public</privacy>
<created>2013-02-21 18:29:54</created>
<password_protected>no</password_protected>
<mimetype>text/css</mimetype>
<filetype>development</filetype>
<view>2</view>
<edit>0</edit>
<revision>12254</revision>
<flag>22</flag>
<permissions>
<value>1</value>
<explicit>1</explicit>
<read>1</read>
<write>0</write>
</permissions>
<hash>7b9bdd3a1d24a9aae52639563c1a1f8dee73572366b8ebf999250f32268f2e62</hash>
<downloads>0</downloads>
<views>0</views>
<links>
<view>http://www.mediafire.com/view/81re0fjd690896f/atom.png</view>
<normal_download>http://www.mediafire.com/file/81re0fjd690896f/atom.png</normal_download>
</links>
</file>
<file>
<quickkey>zq29c3yuq701eeb</quickkey>
<hash>f76a18f6aaa5c47e2151591fdc8d240b521c7b9903921a1caaa20604c96337d1</hash>
<filename>883406056_877ba3bcfb_b (1)(2).jpg</filename>
<description>HELLO</description>
<size>699933</size>
<privacy>public</privacy>
<created>2013-07-03 16:09:42</created>
<password_protected>no</password_protected>
<mimetype>image/jpeg</mimetype>
<filetype>image</filetype>
<view>2</view>
<edit>0</edit>
<revision>14254</revision>
<flag>4</flag>
<permissions>
<value>1</value>
<explicit>1</explicit>
<read>1</read>
<write>0</write>
</permissions>
<downloads>0</downloads>
<views>0</views>
<grafted>yes</grafted>
<owner_name>Jonesy</owner_name>
<avatar>https://secure.gravatar.com/avatar/968aa19b0eeaadbf5aa8e75367e6c416?s=48&d=mm</avatar>
<links>
<view>http://www.mediafire.com/view/i811sarxep4436u/882548399_a67e94c405_b(2).jpg</view>
<normal_download>http://www.mediafire.com/file/i811sarxep4436u/882548399_a67e94c405_b(2).jpg</normal_download>
</links>
</file>
</files>
</folder_content>
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>
Get Depth
Description: Returns information about folder nesting (distance from root).
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 requiring fetch information.
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')
Response Properties
- folderkey: The folderkey for the newly created folder
- name: The name of the newly created folder
- depth: The numerical distance of the specified folder from the root folder
- result: Indicates if the API call was successful. 'Error' or 'Success'
- current_api_version: The API version
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://www.mediafire.com/api/1.1/folder/get_depth.php?session_token=7bc1f2bdf00920e37553f1eaa04078fbdf5c28d8a3e6144ff26f89d3d980272a4561f99c404e70d9ffc8abf4220eba4f30e9d68132f6ae1f5a38342831d9b3c917504f5a01524bde&folder_key=2509mz6sb9swz
<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.1</current_api_version>
</response>
Get Info
Description : Returns a list of a folder's details.
Required Parameters:
- folder_key : The key that identifies the folder requiring information. if not passed, then it will return the root folder (session token is then required).
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature). Needed only when accessing user's private files.
Optional Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
- 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')
- folderkey: The folderkey
- name: The name of the folder
- description: The folder description
- tags: The folder tags [deprecated]
- created: The date and time the folder was created
- parent_folderkey : The key of the folder containing the file. Returned only if a valid session token is supplied and the user has at least read access to the file. Omitted if the file is located in the My Files root.
- delete_date : The date the file was moved to the Trash (if applicable).
- privacy: The security of the file. 'public' or 'private'
- file_count: The amount of files contained in the folder
- folder_count: The amount of folders in the folder
- total_files: The total amount of files contained within the folder and subfolders
- total_folders: The total amount of folders contained within the folder and subfolder
- total_size: The total folder size
- revision: The revision of the folder
- owner_name: The owner of the folder
- avatar: The location of the avatar associated with the account
- dropbox_enabled: Indicated whether the folder is a FileDrop. 'yes' or 'no'
- flag: The bit-mask value specifying special details about a file (values not represented are for internal MediaFire documentation purposes):
- 1: File is owned by the session user.
- 2: File is supported for preview.
- 4: File is editable.
- 8: File is virus flagged.
- result: Indicates if the API call was successful. 'Error' or 'Success'
- current_api_version: The API version
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://www.mediafire.com/api/1.1/folder/get_info.php?session_token=123456789012345678901234567890123456789012345678901234567890&folder_key=wl88kcc0k0xvj&version=1
<response>
<action>folder/get_info</action>
<folder_info>
<folderkey>wl88kcc0k0xvj</folderkey>
<name>myfolder</name>
<desc/>
<tags/>
<created>2011-01-07 12:24:34</created>
<revision>2</revision>
<epoch>1381236999</epoch>
<parent_folderkey>poq8du83hf9w</parent_folderkey>
<custom_url>custom</custom_url>
<dbx_enabled>1</dbx_enabled>
<file_count>2</file_count>
<folder_count>1</folder_count>
<total_folders>1</total_folders>
<total_files>2</total_files>
<total_size>12345</total_size>
<flag>2</flag>
<shared_by_user>1</shared_by_user>
<permissions>2</permissions>
<owner_name>Anonymous</owner_name>
<avatar>http://link.to/avatar</avatar>
</folder_info>
<result>Success</result>
</response>
Property: flag
This is a bit-mask value indicating special details about a folder. The following is a list of bits and their meanings:
- 1: Indicates whether this folder is owned by the current session user.
Flag bits in bold are reserved and should not be publicly documented at the moment.
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 user has been granted permissions for the file. Decimal value of bit mask field. Bit 0 = read; 1 = read + write; 2 = manage.
Get Revision
Description : Returns a number indicating the revision of the folder identified by folder_key. Any changes made to this folder or its content will increment the revision. When the revision resets to '1', the timestamp epoch is updated so both revision and epoch can be used to identify a unique revision. .
Note: The parameter return_changes has been removed.
Required Parameters: There are no required parameters.
Relative Parameters:
- folder_key : The key that identifies the folder. If not passed, the root folder will be returned(session token is then required).
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
- signature : This is the call signature that is required to authenticate a type 2 session token transaction. Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
- revision: The revision of the folder
- result: Indicates if the API call was successful. 'Error' or 'Success'
- current_api_version: The API version
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
- 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).
- session_token : A type 1 or type 2 session token. (Type 2 will require a call signature) Only needed when accessing a user's private folders.
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
- 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')
- result: Indicates if the API call was successful. 'Error' or 'Success'
- current_api_version: The API version
- folderkey: The folderkey
- name: The folder name
- description: The folder description
- created: The date and time the folder was created
- privacy: Indicates the folder's privacy: 'private' or public'
- file_count: The amount of files contained in the folder
- folder_count: The amount of folders contained in the folder
- revision: The folder revision
- owner_name: The folder owner's name
- avatar: The location of the folder's avatar
- dropbox_enabled: Indicated whether the folder is a FileDrop. 'yes' or 'no'
- flag: The folder's flag information
Response Properties
Error Responses From Supplying a Bad Session Token:
Example:
http://www.mediafire.com/api/1.1/folder/get_revision.php?folder_key=zaj0wjzqw23cf&return_changes=yes
<response>
<action>folder/get_revision</action>
<changes>
<add>file-fj3478fje3dje-5,file-395753jcn33dje-6,</add>
<remove>folder-jhjf84jfg2jf74uj-5,</remove>
<update/>
</changes>
<revision>541</revision>
<epoch>1296321580</epoch>
<result>Success</result>
</response>
Get Siblings
Description : Returns the sibling folders.
Required Parameters:
Optional Parameters:
Response Properties
Sibling Folder Responses
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://haibiztest.mediafire.com/api/1.1/folder/get_siblings.php?session_token=8b78feee3ab222b568b31d991b1f91a14227e2fc8e665f65846b638173e46c90e4858364d7ef049d18e6be071115fc4e732556e755f0611008176616133b7905f5d353477844f820&folder_key=lzknk841487c1
<response>
<action>folder/get_siblings</action>
<siblings>
<sibling>
<folderkey>ixskrduth0rgs</folderkey>
<name>__bulk</name>
<description />
<tags />
<created>2013-01-25 15:16:21</created>
<privacy>public</privacy>
<file_count>1</file_count>
<revision>13</revision>
<epoch>1361220901</epoch>
<owner_name>Testbiz</owner_name>
<avatar>https://secure.gravatar.com/avatar/00000000?s=27&d=mm&f=y</avatar>
<dropbox_enabled>no</dropbox_enabled>
<flag>2</flag>
<folders />
<files />
</sibling>
<sibling>
<folderkey>1idgyy8easr75</folderkey>
<name>testst</name>
<description />
<tags />
<created>2013-01-11 15:13:57</created>
<privacy>public</privacy>
<file_count>97</file_count>
<revision>1</revision>
<epoch>1361220901</epoch>
<owner_name>Testbiz</owner_name>
<avatar>https://secure.gravatar.com/avatar/00000000?s=27&d=mm&f=y</avatar>
<dropbox_enabled>no</dropbox_enabled>
<flag>2</flag>
<folders />
<files />
</sibling>
</siblings>
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>
Move
Description : Move one folder to another 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 should call the folderkey that identifies the folder to be moved. You can also specify multiple folderkeys separated by commas.
Optional Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
- folder_key_dst : Call the folderkey that identifies the destination folder. If omitted, the destination folder will be the root folder (My Files).
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
- device_revision: The revision of the device
- result: Indicates if the API call was successful. 'Error' or 'Success'
- current_api_version: The API version
Response when NOT specifying a destination folder which moves your folder to root (My Files)
Error for using a bad folderkey
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://www.mediafire.com/api/1.1/folder/move.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key_src=bbm411lcts280&folder_key_dst=d2udzgjn5l5vd
<response>
<action>folder/move</action>
<myfiles_revision>
<revision>5.0</revision>
<epoch>1361220899</epoch>
</myfiles_revision>
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>
Purge
Description : Permanently delete a user's folder.
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. You can also specify multiple folderkeys 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')
Response Properties
- 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'
- device_revision: The revision of the device
- result: Indicates if the API call was successful. 'Error' or 'Success'
- current_api_version: The API version
Error for using a bad folderkey
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://www.mediafire.com/api/1.1/folder/purge.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key=0dwzor67253tu
<response>
<action>folder/delete</action>
<myfiles_revision>
<revision>2.0</revision>
<epoch>1361220899</epoch>
</myfiles_revision>
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>
Search
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, descriptions and tags.
- 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.
- 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.
Optional Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
- 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
General Responses
- result_count: Total amount of items returned that match the search criteria
- result: Indicates if the API call was successful. 'Error' or 'Success'
- current_api_version: The API version
Responses for Files
- type: The content type: 'file' for this example
- quickkey: The quickkey of the file found
- filename: The file name
- parent_folderkey: The parent folder key
- parent_name: The parent folder name
- created: The date/time the folder was created
- revision: The revision number of the file
- size: The size of the file in bytes
- description: The description of the file
- privacy: Indicates if the file is set to 'public' or 'private'
- password_protected: Indicates if the file is password protected. 'yes' or 'no' {deprecated}
- mimetype: The mimetype of the file
- filetype: The filetype: 'document' for example
- 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].
- edit: Specifies if this file can be edited via MediaFire and, if so, by what system. 0 [not-editable], 1 [Text Editor], 2 [deprecated].
- hash: The hash of the file
- flag: The bit-mask value specifying special details about a file (values not represented are for internal MediaFire documentation purposes):
- 1: File is owned by the session user.
- 2: File is supported for preview.
- 4: File is editable.
- 8: File is virus flagged.
- relevancy: The relevancy of the file to the search term in percent. In this example '100'
Responses for Folders
- type: The content type. 'folder' for this example
- folderkey: The folderkey
- name: The folder name
- parent_folderkey: The parent folderkey
- parent_name: The parent folder name
- revision: The revision of the folder
- privacy: Indicates if the folder is set to 'private' or 'public'
- relevancy: The relevancy of the folder to the search term in percent. In this example '100'
Example:
http://www.mediafire.com/api/1.1/folder/search.php?session_token=c94078a5b36f6dad64924676be45407a4ae0d772525050d6b1d8215fbea7ec21ea1f7ac04f3366d0a22829a712bfc8bc13b9ee39a82d0ea1d161fe3442e0265da8e58058232bd14e&search_text=unicode
<response>
<action>folder/search</action>
<results_count>3</results_count>
<results>
<result>
<type>file</type>
<quickkey>a91a5j8ru2bcqdh</quickkey>
<filename>unicode.txt</filename>
<parent_folderkey>iie3pu4pvtaui</parent_folderkey>
<parent_name>unicode</parent_name>
<created>2013-07-01 10:50:02</created>
<revision>22882</revision>
<size>25582</size>
<description/>
<privacy>public</privacy>
<password_protected>no</password_protected>
<mimetype>text/plain</mimetype>
<filetype>document</filetype>
<view>1</view>
<edit>1</edit>
<hash>6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28</hash>
<flag>22</flag>
<relevancy>100</relevancy>
</result>
<result>
<type>folder</type>
<folderkey>iie3pu4pvtaui</folderkey>
<name>unicode</name>
<parent_folderkey>m8zm361z1s810</parent_folderkey>
<parent_name>Unicode Test</parent_name>
<revision>22885</revision>
<privacy>public</privacy>
<relevancy>100</relevancy>
</result>
<result>
<type>folder</type>
<folderkey>m8zm361z1s810</folderkey>
<name>Unicode Test</name>
<parent_folderkey>3g9v11j8z8rd8</parent_folderkey>
<parent_name>Search Test</parent_name>
<revision>22886</revision>
<privacy>public</privacy>
<relevancy>100</relevancy>
</result>
</results>
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>
JSON Example:
http://www.mediafire.com/api/1.1/folder/search.php?session_token=04ef99ba504d24b1f11371a2bb30bb127c5823ab894139daf97feb800d9b752e6b5e2cc98b6d27c8b37fe3912bb23912ec7f0759fad905d7b7a1bc42de77cb24deeac7c418c0d0c6&search_text=unicode&response_format=json
{
"response": {
"action": "folder\/search",
"results_count": "3",
"results": [
{
"type": "file",
"quickkey": "a91a5j8ru2bcqdh",
"filename": "unicode.txt",
"parent_folderkey": "iie3pu4pvtaui",
"parent_name": "unicode",
"created": "2013-07-01 10:50:02",
"revision": "22882",
"size": "2",
"description": "",
"privacy": "public",
"password_protected": "no",
"mimetype": "text\/plain",
"filetype": "document",
"view": "1",
"edit": "1",
"hash": "6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28",
"flag": "22",
"relevancy": "100"
},
{
"type": "folder",
"folderkey": "iie3pu4pvtaui",
"name": "unicode",
"parent_folderkey": "m8zm361z1s810",
"parent_name": "Unicode Test",
"revision": "22885",
"privacy": "public",
"relevancy": "100"
},
{
"type": "folder",
"folderkey": "m8zm361z1s810",
"name": "Unicode Test",
"parent_folderkey": "3g9v11j8z8rd8",
"parent_name": "Search Test",
"revision": "22886",
"privacy": "public",
"relevancy": "100"
}
],
"result": "Success",
"current_api_version": "1.1"
}
}
Update
Description : Update a folder's information.
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 updated.
Optional Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
- 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
- tags : A space-separated list of tags. Deprecated. Do Not Use.
- note_subject: The subject of the folder's note. Deprecated. Do Not Use.
- note_description: The description of the folder's note. Deprecated. Do Not Use.
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
General Responses
- 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'
- device_revision: The revision of the device
- result: Indicates if the API call was successful. 'Error' or 'Success'
- current_api_version: The API version
Error for using a bad folderkey
Error Responses From Supplying a Bad Session Token:
- message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
- error: Error number for a supplying a bad session token: '105'
Example:
http://www.mediafire.com/api/1.1/folder/set_flags.php?session_token=50adfd2c3ccb2246d8997840c54e986fbb8f5f445df069c5e474136640944272190551be7c816ed70bd4f4853a874e7df519987210dcd9daa160f61ef1841b9c7dda380bad84886b&folder_key=rae77xp6dy7za&bit=0&value=1http://www.mediafire.com/api/1.1/folder/update.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key=8adbweycihdkd&foldername=new_name&description=new_desc&privacy=private
<response>
<action>folder/update</action>
<myfiles_revision>
<revision>8.0</revision>
<epoch>1361220899</epoch>
</myfiles_revision>
<device_revision>123</device_revision&gr;
<result>Success</result>
<current_api_version>1.1</current_api_version>
</response>