Folder1.2
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.
Relative Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
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).
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type |
---|---|---|
asynchronous | This property tells whether the request is being processed real-time. If the job is processed asynchronously, callers will need to poll device/get_status to determine when their job is complete. 'yes' or 'no' | yes/no flag |
device_revision | The revision number of the cloud device | integer |
result | Indicates if the API call was successful. 'Error' or "Success' | string |
current_api_version | The latest stable API version number | string |
New Folder Properties
Name | Description | Type |
---|---|---|
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 XML):
http://www.mediafire.com/api/1.2/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.2</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/folder/copy.php?folder_key_src=bbm411lcts280&folder_key_dst=d2udzgjn5l5vd&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json
{
"response": {
"action": "folder/copy",
"new_folderkeys": [ "8adbweycihdkd" ],
"device_revision": "123",
"result": "Success",
"current_api_version": "1.2"
}
}
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.
Relative Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
Optional Parameters:
- 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).
- action_on_duplicate : 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
Name | Description | Type |
---|---|---|
folderkey | The folderkey for the newly created folder | 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 |
upload_key | The upload key of the newly created folder | string |
folder_key | The folderkey for the newly created folder | string |
current_api_version | The latest stable API version number | string |
device_revision | The revision number of the cloud device | integer |
result | Indicates if the API call was successful. '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):
http://www.mediafire.com/api/1.2/folder/create.php?session_token=123456789012345678901234567890123456789012345678901234567890&foldername=newfolder&version=1
<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>
<device_revision>2468</device_revision>
<result>Success</result>
<current_api_version>1.0</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/folder/create.php?session_token=123456789012345678901234567890123456789012345678901234567890&foldername=newfolder&version=1&response_format=json
{
"response": {
"action": "folder/create",
"folderkey": "91kukmyz71741",
"name": "newfolder(2)",
"created": "2014-12-22 14:15:29",
"privacy": "private",
"file_count": "0",
"folder_count": "0",
"revision": "2466",
"dropbox_enabled": "no",
"flag": "2",
"upload_key": "119e85924136899667cd7f7bd65f7eef1d1a6d7847fc6b77f0a154af670496da",
"folder_key": "91kukmyz71741",
"device_revision": "2468",
"result": "Success",
"current_api_version": "1.0"
}
}
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.
Relative Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type |
---|---|---|
asynchronous | This property tells whether the request is being processed real-time. If the job is processed asynchronously, callers will need to poll device/get_status to determine when their job is complete. 'yes' or 'no' | yes/no flag |
New Folder Properties
Name | Description | Type |
---|---|---|
new_folderkey | The new folderkey | string |
device_revision | The revision number of the cloud device | integer |
result | Indicates if the API call was successful. 'Error' or "Success' | string |
current_api_version | The latest stable API version number | string |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML):
http://www.mediafire.com/api/1.2/folder/delete.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key=0dwzor67253tu
<response>
<action>folder/delete</action>
<myfiles_revision>
<revision>456222</revision>
<epoch>1361220899</epoch>
</myfiles_revision>
<result>Success</result>
<current_api_version>1.2</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/folder/delete.php?folder_key=0dwzor67253tu&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json
{
"response": {
"action": "folder/delete",
"myfiles_revision": {
"revision": "456222",
"epoch": "1361220899"
},
"device_revision": "123",
"result": "Success",
"current_api_version": "1.2"
}
}
Get Content
Notes: New optional parameter 'chunk_size'.
New response property 'more_chunks'.
Description: Returns either a list of folders or a list of files.
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).
- 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:
- 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 |
---|---|---|
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' | yes/no flag |
result | Indicates if the API call was successful. 'Error' or 'Success' | |
new_key | Indicates if a new session token was created: 'yes' or 'no' | yes/no flag |
current_api_version | Indicates the API version used |
Response for Files Contained Within Folder
Name | Description | Type |
---|---|---|
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] | yes/no flag |
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 | |
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 |
Note: The bitmask 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.
Link Information
Name | Description | Type |
---|---|---|
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 |
---|---|---|
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 |
---|---|---|
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. 'private' or 'public' | string |
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. 'yes' or 'no' | yes/no flag |
flag | The bitmask value specifying special details about a file (values not represented are for internal MediaFire documentation purposes): '1' = File is owned by the session user. | bitmask |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Owned folders with XML):
HTTPS://www.mediafire.com/api/folder/get_content.php?session_token=3cb57cb29257c6b9433dd83d051b38d1f2892718aa7bf2b3b88916f8e9a994c152b1bfb718b16d19bd91136166319770ed0863df7af35ec3bb6e0eeec5c324370dbe642e95077c91&folder_key=1cplu1o59n1bw&content_type=folders&filter=&order_by=created&order_direction=asc&details=yes&response_format=xml&signature=0987c167ca67804cf40855248e6436c7
<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>r7hhnynekfk8e</folderkey>
<name>Test3</name>
<description></description>
<privacy>public</privacy>
<created>2014-08-07 11:52:50</created>
<revision>103167</revision>
<flag>2</flag>
<shared_by_user>1</shared_by_user>
<file_count>0</file_count>
<folder_count>0</folder_count>
<dropbox_enabled>no</dropbox_enabled>
<total_folders>0</total_folders>
<total_files>0</total_files>
<total_size>0</total_size>
</folder>
<folder>
<folderkey>ea80fopql1aoa</folderkey>
<name>Test4</name>
<description></description>
<privacy>public</privacy>
<created>2014-08-07 11:52:56</created>
<revision>103170</revision>
<flag>2</flag>
<file_count>0</file_count>
<folder_count>0</folder_count>
<dropbox_enabled>no</dropbox_enabled>
<total_folders>0</total_folders>
<total_files>0</total_files>
<total_size>0</total_size>
</folder>
</folders>
<more_chunks>no</more_chunks>
</folder_content>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.2</current_api_version>
Example 2 (Owned folders with JSON):
HTTPS://www.mediafire.com/api/folder/get_content.php?session_token=3cb57cb29257c6b9433dd83d051b38d1f2892718aa7bf2b3b88916f8e9a994c152b1bfb718b16d19bd91136166319770ed0863df7af35ec3bb6e0eeec5c324370dbe642e95077c91&folder_key=1cplu1o59n1bw&content_type=files&filter=&order_by=created&order_direction=asc&details=no&response_format=json&signature=1de585f80c4450ea0e3de6c24b8fde5e
{
"response":{
"action":"folder\/get_content",
"folder_content":{
"chunk_size":"100",
"content_type":"files",
"chunk_number":"1",
"files":[{
"quickkey":"er4s9u732z189yh",
"hash":"55d90279295fc5230f5035dba90c7f4e2a84e35cb6237816907547f6b17c03e8",
"filename":"(Copy of) 1394 (2)(10).inf",
"description":"",
"size":"12224",
"privacy":"public",
"created":"2010-11-20 22:23:47",
"password_protected":"no",
"mimetype":"text\/plain",
"filetype":"development",
"view":"1",
"edit":"1",
"revision":"103185",
"flag":"22",
"shared_by_user":"1",
"downloads":"0",
"views":"0",
"links":{
"view":"http:\/\/www.mediafire.com\/view\/er4s9u732z189yh\/(Copy_of)_1394_(2)(10).inf",
"edit":"http:\/\/www.mediafire.com\/edit\/er4s9u732z189yh\/(Copy_of)_1394_(2)(10).inf",
"normal_download":"http:\/\/www.mediafire.com\/file\/er4s9u732z189yh\/(Copy_of)_1394_(2)(10).inf"
}
},{
"quickkey":"wme0jlwyaukyly6",
"hash":"5f12feef26fbf271e7e5891382908df53605452b69c9be690ca2f3b403279479",
"filename":"(Copy of) 1394 (2)(10).inf_loc",
"description":"",
"size":"3588",
"privacy":"public",
"created":"2011-04-12 03:17:23",
"password_protected":"no",
"mimetype":"text\/plain",
"filetype":"document",
"view":"1",
"edit":"1",
"revision":"103180",
"flag":"22",
"downloads":"0",
"views":"0",
"links":{
"view":"http:\/\/www.mediafire.com\/view\/wme0jlwyaukyly6\/(Copy_of)_1394_(2)(10).inf_loc",
"edit":"http:\/\/www.mediafire.com\/edit\/wme0jlwyaukyly6\/(Copy_of)_1394_(2)(10).inf_loc",
"normal_download":"http:\/\/www.mediafire.com\/file\/wme0jlwyaukyly6\/(Copy_of)_1394_(2)(10).inf_loc"
}
}],
"more_chunks":"no"
},
"result":"Success",
"new_key":"yes",
"current_api_version":"1.2"
}
}
Example 3 (Non-owned folders with JSON ):
HTTPS://www.mediafire.com/api/folder/get_content.php?session_token=3cb57cb29257c6b9433dd83d051b38d1f2892718aa7bf2b3b88916f8e9a994c152b1bfb718b16d19bd91136166319770ed0863df7af35ec3bb6e0eeec5c324370dbe642e95077c91&folder_key=mlvz6g9jat9wp&content_type=folders&filter=&order_by=created&order_direction=asc&details=yes&response_format=json&signature=8db4559185e25c3228b274a91265d838
"action":"folder\/get_content",
"folder_content":{
"chunk_size":"100",
"content_type":"folders",
"chunk_number":"1",
"folders":[{
"folderkey":"85qi3qhpddk7g",
"name":"Test1",
"description":"",
"privacy":"public",
"created":"2014-08-07 14:54:56",
"revision":"4267",
"flag":"0",
"permissions":{
"value":"2",
"explicit":"1",
"read":"1",
"write":"1"
},
"file_count":"0",
"folder_count":"0",
"dropbox_enabled":"no",
"total_folders":"0",
"total_files":"0",
"total_size":"0"
},{
"folderkey":"4e7wm8iepmr24",
"name":"Test2",
"description":"",
"privacy":"public",
"created":"2014-08-07 14:54:59",
"revision":"4252",
"flag":"0",
"permissions":{
"value":"1",
"explicit":"0",
"read":"1",
"write":"0"
},
"file_count":"0",
"folder_count":"0",
"dropbox_enabled":"no",
"total_folders":"0",
"total_files":"0",
"total_size":"0"
}],
"more_chunks":"no"
},
"result":"Success",
"new_key":"yes",
"current_api_version":"1.2"
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.
Relative Parameters:
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
Optional Parameters:
- response_format : 'xml' or 'json' (default 'xml')
Response Properties
Name | Description | Type |
---|---|---|
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 |
result | Indicates if the API call was successful. 'Error' or "Success' | string |
current_api_version | The latest stable API version number | string |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML):
http://www.mediafire.com/api/1.2/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.2</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/folder/get_depth.php?folder_key=2509mz6sb9swz&session_token=7bc1f2bdf00920e37553f1eaa04078fbdf5c28d8a3e6144ff26f89d3d980272a4561f99c404e70d9ffc8abf4220eba4f30e9d68132f6ae1f5a38342831d9b3c917504f5a01524bde&response_format=json
{
"response": {
"action": "folder/get_depth",
"folder_depth": {
"depth": "2",
"chain_folders": [
{
"folderkey": "2509mz6sb9swz",
"name": "1"
},
{
"folderkey": "d3h9rqbm1dj3y",
"name": "_3"
}
]
},
"result": "Success",
"current_api_version": "1.2"
}
}
Get Info
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).
- 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:
- 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 |
---|---|---|
result | Indicates if the API call was successful. 'Error' or 'Success' | string |
current_api_version | The latest stable API version number | string |
folderkey | The folderkey | string |
name | The name of the folder | string |
description | The folder description | string |
created | The date and time the folder was created | string timestamp |
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. | string |
delete_date | The date and time the file was moved to the Trash (if applicable). | string timestamp |
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 |
revision | The revision number of the folder | integer |
owner_name | The owner of the folder | string |
avatar | The location of the avatar associated with the account | string |
dropbox_enabled | Indicated whether the folder is a FileDrop. 'yes' or 'no' | yes/no flag |
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.
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML):
http://www.mediafire.com/api/1.2/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/>
<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>
Example 2 (Success with JSON):
http://www.mediafire.com/api/folder/get_info.php?folder_key=wl88kcc0k0xvj&session_token=736d51e04a51a2210f6182951d84bad3e9de5fa0dc12894589e83fa434e5276f9cc7f4aa00bf883d7269ec51ddd911014e30eac29ad754db7c8bfa166f7130373b39d6595a9dfda7&response_format=json
{
"response": {
"action": "folder/get_info",
"folder_info": {
"folderkey": "wl88kcc0k0xvj",
"name": "myfolder",
"created": "2011-01-07 12:24:34",
"revision": "2",
"epoch": "1381236999",
"parent_folderkey": "poq8du83hf9w",
"custom_url": "custom",
"dbx_enabled": "1",
"file_count": "2",
"folder_count": "1",
"size": "1251582",
"total_folders": "284",
"total_files": "99999",
"total_size": "12345",
"overflow": "yes",
"flag": "2",
"shared_by_user": "1",
"permissions": "2",
"owner_name": "Anonymous",
"avatar": "http://link.to/avatar"
},
"result": "Success"
}
}
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.
- response_format : 'xml' or 'json' (default 'xml')
- 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).
- 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')
- 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.
- 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')
- 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.
- signature : This is the call signature that is required to authenticate a type 2 session token transaction.
- response_format : 'xml' or 'json' (default 'xml')
- search_text : The search keywords to look for in filenames, folder names, and descriptions.
- 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.
- 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')
- 1: File is owned by the session user.
- 2: File is supported for preview.
- 4: File is editable.
- 8: File is virus flagged.
- 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.
- 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')
Optional Parameters:
Response Properties
Name | Description | Type |
---|---|---|
result | Indicates if the API call was successful. 'Error' or 'Success' | |
current_api_version | The API version | |
revision | The revision of the folder |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
http://www.mediafire.com/api/1.2/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:
Relative Parameters:
Optional Parameters:
Response Properties
Name | Description | Type |
---|---|---|
result | Indicates if the API call was successful. 'Error' or 'Success' | string |
current_api_version | The latest stable API version number | string |
Sibling Folder Responses
Name | Description | Type |
---|---|---|
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: 'private' or public' | string |
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 | |
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 | The flags of the newly created folder: '1' = 'Folder is owned by the session user'. Other bits not documented are internal MediaFire notations. | bitmask |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (One sibling with JSON):
HTTPS://www.mediafire.com/api/1.2/folder/get_siblings.php?folder_key=ea80fopql1aoa&session_token=3cb57cb29257c6b9433dd83d051b38d1f2892718aa7bf2b3b88916f8e9a994c152b1bfb718b16d19bd91136166319770ed0863df7af35ec3bb6e0eeec5c324370dbe642e95077c91&response_format=json&signature=f7d3bd04e2eed17825b5f544b5017922
{
"action":"folder\/get_siblings",
"siblings":[{
"folderkey":"r7hhnynekfk8e",
"name":"Test3",
"description":"",
"created":"2014-08-07 11:52:50",
"privacy":"public",
"file_count":"3",
"revision":"103224",
"owner_name":"Changed It",
"avatar":"https:\/\/www16.mediafire.com\/convkey\/ff9b\/krox9vo12tupavp1g.jpg",
"dropbox_enabled":"no",
"flag":"2"
}],
"result":"Success",
"new_key":"yes",
"current_api_version":"1.2"}
Move
Description : Move one folder to another folder.
Required Parameters:
Relative Parameters:
Optional Parameters:
Response Properties
Name | Description | Type |
---|---|---|
result | Indicates if the API call was successful. 'Error' or 'Success' | string |
current_api_version | The latest stable API version number | string |
device_revision | The revision number of the device | integer |
Response when NOT specifying a destination folder which moves your folder to root (My Files)
Name | Description | Type |
---|---|---|
asynchronous | This property tells whether the request is being processed real-time. If the job is processed asynchronously, callers will need to poll device/get_status to determine when their job is complete. 'yes' or 'no' | yes/no flag |
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 XML):
http://www.mediafire.com/api/1.2/folder/move.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key_src=bbm411lcts280&folder_key_dst=d2udzgjn5l5vd
<response>
<action>folder/move</action>
<myfiles_revision>
<revision>456222</revision>
<epoch>1361220899</epoch>
</myfiles_revision>
<result>Success</result>
<current_api_version>1.2</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/folder/move.php?folder_key_src=bbm411lcts280&folder_key_dst=d2udzgjn5l5vd&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json
{
"response": {
"action": "folder/move",
"myfiles_revision": {
"revision": "456222",
"epoch": "1361220899"
},
"device_revision": "123",
"result": "Success",
"current_api_version": "1.2"
}
}
Purge
Description : Permanently delete a user's folder.
Required Parameters:
Relative Parameters:
Optional Parameters:
Response Properties
Name | Description | Type |
---|---|---|
asynchronous | This property tells whether the request is being processed real-time. If the job is processed asynchronously, callers will need to poll device/get_status to determine when their job is complete. 'yes' or 'no' | yes/no flag |
result | Indicates if the API call was successful. 'Error' or 'Success' | string |
current_api_version | The latest stable API version number | string |
device_revision | The revision number of the device | integer |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML):
http://www.mediafire.com/api/1.2/folder/purge.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&folder_key=0dwzor67253tu
<response>
<action>folder/purge</action>
<asynchronous>no</asynchronous>
<result>Success</result>
<current_api_version>1.2</current_api_version>
<device_revision>5002</device_revision>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/folder/purge.php?folder_key=0dwzor67253tu&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json
{
"response": {
"action": "folder/purge",
"asynchronous": "no",
"device_revision": "123",
"result": "Success",
"current_api_version": "1.2"
}
}
Search
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:
Relative Parameters:
Optional Parameters:
Response Properties
Name | Description | Type |
---|---|---|
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 latest stable API version number | string |
Responses for Files
Name | Description | Type |
---|---|---|
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 was created | string timestamp |
revision | The revision number of the file | integer |
size | The size of the file in bytes | integer |
description | The description of the file | string |
privacy | Indicates if the file is set to 'public' or 'private' | string |
password_protected | Indicates if the file is password protected. 'yes' or 'no' [DEPRECATED] | yes/no flag |
mimetype | The mimetype of the file | string |
filetype | The filetype: 'document' for example | string |
view | Specifies if this file is viewable via MediaFire and, if so, by what system. 0 [not-viewable], 1 [PDF Viewer], 2 [PDF Viewer], 3 [deprecated]. | integer |
edit | Specifies if this file can be edited via MediaFire and, if so, by what system. 0 [not-editable], 1 [Text Editor], 2 [deprecated]. | integer |
hash | The hash of the file | string |
relevancy | The relevancy of the file to the search term in percent. In this example '100' | integer |
flag | *see note below** | bitmask |
Responses for Folders
Name | Description | Type |
---|---|---|
type | The content type. 'file' or 'folder' | string |
folderkey | The folderkey | string |
name | The folder name | string |
parent_folderkey | The parent folderkey | string |
parent_name | The parent folder name | string |
revision | The revision number of the folder | integer |
privacy | Indicates if the folder is set to 'private' or 'public' | string |
relevancy | The relevancy of the folder to the search term in percent. In this example '100' | integer |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML):
http://www.mediafire.com/api/1.2/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.2</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/1.2/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.2"
}
}
Update
Description : Update a folder's information.
Required Parameters:
Relative Parameters:
Optional Parameters:
Response Properties
Name | Description | Type |
---|---|---|
asynchronous | This property tells whether the request is being processed real-time. If the job is processed asynchronously, callers will need to poll device/get_status to determine when their job is complete. 'yes' or 'no' | yes/no flag |
result | Indicates if the API call was successful. 'Error' or 'Success' | string |
current_api_version | The latest stable API version number | string |
device_revision | The revision number of the device | integer |
Error Codes
To view a list of possible error codes for this API, and their descriptions, click here.
Examples:
Example 1 (Success with XML):
http://www.mediafire.com/api/1.2/folder/set_flags.php?session_token=50adfd2c3ccb2246d8997840c54e986fbb8f5f445df069c5e474136640944272190551be7c816ed70bd4f4853a874e7df519987210dcd9daa160f61ef1841b9c7dda380bad84886b&folder_key=rae77xp6dy7za&bit=0&value=1http://www.mediafire.com/api/1.2/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>456222</revision>
<epoch>1361220899</epoch>
</myfiles_revision>
<device_revision>123</device_revision&gr;
<result>Success</result>
<current_api_version>1.2</current_api_version>
</response>
Example 2 (Success with JSON):
http://www.mediafire.com/api/1.2/folder/update.php?folder_key=8adbweycihdkd&foldername=new_name&description=new_desc&privacy=private&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json
"response": {
"action": "folder/update",
"myfiles_revision": { "revision": "456222" },
"device_revision": "123",
"result": "Success",
"current_api_version": "1.2"
}
}