User1.4

Accept Terms of Service


GET http://www.mediafire.com/api/1.4/user/accept_tos.php
POST http://www.mediafire.com/api/1.4/user/accept_tos.php

Description: Records that the session user has accepted the MediaFire Terms of Service by sending the acceptance token.

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
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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.4/user/accept_tos.php?session_token=ab951de178b31957f16a769ea69b58b5bf33f6b1bc03077c99d79d8605ed9a1e45b7edf2a9952fe18fd512bce0fa2d4f1fc1ee92215f33700be424d184e3637ca15a90108a2813fe&acceptance_token=331a1777f6af415b5f46f6fc0772e9fc
Response
<response>
  <action>user/accept_tos</action>
  <result>Success</result>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/user/accept_tos.php?acceptance_token=331a1777f6af415b5f46f6fc0772e9fc&session_token=ab951de178b31957f16a769ea69b58b5bf33f6b1bc03077c99d79d8605ed9a1e45b7edf2a9952fe18fd512bce0fa2d4f1fc1ee92215f33700be424d184e3637ca15a90108a2813fe&response_format=json
Response
{
  "response": {
    "action": "user/accept_tos",
    "result": "Success",
    "current_api_version": "1.4"
  }
}

Destroy Action Token


GET http://www.mediafire.com/api/1.4/user/destroy_action_token.php
POST http://www.mediafire.com/api/1.4/user/destroy_action_token.php

Description: Causes an existing action token to immediately expire.

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
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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
https://www.mediafire.com/api/1.4/user/destroy_action_token.php?session_token=e6829fe5892012154097c19ed0635741a6269cbe5dec2a5ae600b2d70e64b45afd03e00cd15ca0d8d17c2348933894db1ef00dda21bd098d6ba1f51f5e82f7a1a28b454f1bd399ae&action_token=3bbdb91e5d8e171c6943736da69843b882130b2f0cf19189f7b927c712c06c834ab0d2bd0c7424a6c7fdedd6dea970f1132820cbfcaa8cd078dddfe662cda71f4a4dc4d4d89ea13e
Response
<response>
  <action>user/destroy_action_token</action>
  <result>Success</result>
  <current_api_version>1.4</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/user/accept_tos.php?acceptance_token=331a1777f6af415b5f46f6fc0772e9fc&session_token=ab951de178b31957f16a769ea69b58b5bf33f6b1bc03077c99d79d8605ed9a1e45b7edf2a9952fe18fd512bce0fa2d4f1fc1ee92215f33700be424d184e3637ca15a90108a2813fe&response_format=json
Response
{
  "response": {
    "action": "user/accept_tos",
    "result": "Success",
    "current_api_version": "1.4"
  }
}

Fetch Terms Of Service


GET http://www.mediafire.com/api/1.4/user/fetch_tos.php
POST http://www.mediafire.com/api/1.4/user/fetch_tos.php

Description: Returns the HTML format of the MediaFire Terms of Service and its revision number, date, whether the user has accepted it not not, and the acceptance token (if the user has not accepted the latest terms).

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
revision The revision number of the Terms of Service string
terms The complete text of the Terms of Service (under 'terms_of_service') string
date The date and time the current TOS text was created (under 'terms_of_service') string timestamp
user_accepted_terms Indicates whether or not the user previously accepted the terms of service: 'yes' or 'no' (under 'terms_of_service') flag yes/no
acceptance_token The acceptance token which is needed for user/accept_tos (under 'terms_of_service') string
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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.4/user/fetch_tos.php?session_token=ab951de178b31957f16a769ea69b58b5bf33f6b1bc03077c99d79d8605ed9a1e45b7edf2a9952fe18fd512bce0fa2d4f1fc1ee92215f33700be424d184e3637ca15a90108a2813fe
Response
<response>
  <action>user/fetch_tos</action>
  <terms_of_service>
  <revision>0.11</revision>
  <Term of Service Example Text</terms>
  <date>2013-01-25 12:22:28</date>
  <user_accepted_terms>yes</user_accepted_terms>
  <acceptance_tokens>331a1777f6af415b5f46f6fc0772e9fc</acceptance_tokens>
  </terms_of_service>
  <result>Success</result>
  <current_api_version>1.4</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/user/fetch_tos.php?session_token=ab951de178b31957f16a769ea69b58b5bf33f6b1bc03077c99d79d8605ed9a1e45b7edf2a9952fe18fd512bce0fa2d4f1fc1ee92215f33700be424d184e3637ca15a90108a2813fe&response_format=json
Response
{
  "response": {
    "action": "user/fetch_tos",
    "terms_of_service": {
      "revision": "0.11",
      "terms": "Term of Service Example Text",
      "date": "2013-01-25 12:22:28",
      "user_accepted_terms": "yes",
      "acceptance_token": "331a1777f6af415b5f46f6fc0772e9fc"
    },
    "result": "Success",
    "current_api_version": "1.4"
  }
}

Get Action Token


GET https://www.mediafire.com/api/1.4/user/get_action_token.php
POST https://www.mediafire.com/api/1.4/user/get_action_token.php

Note: This call requires SSL.

Description: Generates a temporary action token that is specific to one type of request specified by the parameter type. Action Token is to be used in place of a session token in subsequent API requests. Because the session token lasts only 10 minutes, and the session token version 2 requires a signature for every call, Action Token cannot be used in certain operations. The Action Token can then be sent in lieu of the session token for authentication. It can also be destroyed after its use by calling user/destroy_action_token.

Required Parameters:

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • type : The type of action to be performed. Options are 'image' or 'upload'.

Relative Parameters:

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

Optional Parameters:

  • lifespan : The number of minutes before the action token should be destroyed.'1(default)-1440'.
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type Value
action_token The action token needed for user/destory_action_token string
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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
https://www.mediafire.com/api/1.4/user/get_action_token.php?session_token=e6829fe5892012154097c19ed0635741a6269cbe5dec2a5ae600b2d70e64b45afd03e00cd15ca0d8d17c2348933894db1ef00dda21bd098d6ba1f51f5e82f7a1a28b454f1bd399ae&type=image&lifespan=600
Response
<response>
  <action>user/get_action_token</action>
  <action_token>
    3bbdb91e5d8e171c6943736da69843b882130b2f0cf19189f7b927c712c06c834ab0d2bd0c7424a6c7fdedd6dea970f1132820cbfcaa8cd078dddfe662cda71f4a4dc4d4d89ea13e
  </action_token>   <result>Success</result>   <current_api_version>1.4</current_api_version> </response>

Example 2 (Success with JSON):

Request
https://www.mediafire.com/api/user/get_action_token.php?type=image&lifespan=600&session_token=e6829fe5892012154097c19ed0635741a6269cbe5dec2a5ae600b2d70e64b45afd03e00cd15ca0d8d17c2348933894db1ef00dda21bd098d6ba1f51f5e82f7a1a28b454f1bd399ae&response_format=json
Response
{
  "response": {
    "action": "user/get_action_token",
    "action_token": "3bbdb91e5d8e171c6943736da69843b882130b2f0cf19189f7b927c712c06c834ab0d2bd0c7424a6c7fdedd6dea970f1132820cbfcaa8cd078dddfe662cda71f4a4dc4d4d89ea13e",
    "result": "Success",
    "current_api_version": "1.4"
  }
}

Example 3 (calling the conversion server):

Request
https://www1.mediafire.com/convkey/6801/6qnke22edaz9ds3fg.jpg?size_id=c&session_token=3bbdb91e5d8e171c6943736da69843b882130b2f0cf19189f7b927c712c06c834ab0d2bd0c7424a6c7fdedd6dea970f1132820cbfcaa8cd078dddfe662cda71f4a4dc4d4d89ea13e


Get Avatar


GET http://www.mediafire.com/api/1.4/user/get_avatar.php
POST http://www.mediafire.com/api/1.4/user/get_avatar.php

Description: Returns the URL of the session user's avatar image.

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
avatar The avatar URL for the user string
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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.4/user/get_avatar.php?session_token=e6829fe5892012154097c19ed0635741a6269cbe5dec2a5ae600b2d70e64b45afd03e00cd15ca0d8d17c2348933894db1ef00dda21bd098d6ba1f51f5e82f7a1a28b454f1bd399ae
Response
<response>
  <action>user/get_avatar</action>
  <avatar>http://www.mediafire.com/convkey/2938/naaj7pr6l1umcc20g.jpg
  </avatar>
  <result>Success</result>
  <current_api_version>1.4</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/user/get_avatar.php?session_token=e6829fe5892012154097c19ed0635741a6269cbe5dec2a5ae600b2d70e64b45afd03e00cd15ca0d8d17c2348933894db1ef00dda21bd098d6ba1f51f5e82f7a1a28b454f1bd399ae&response_format=json
Response
{
  "response": {
    "action": "user/get_avatar",
    "avatar": "http://www.mediafire.com/convkey/2938/naaj7pr6l1umcc20g.jpg",
    "result": "Success",
    "current_api_version": "1.4"
  }
}

Get Devices


GET http://www.mediafire.com/api/1.4/user/get_devices.php
POST http://www.mediafire.com/api/1.4/user/get_devices.php

Description: Returns a collection of all the devices associated with the session user's account.

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
devices A collection of registered devices for the session user object
device_id The numerical ID for the device string
name The user supplied name of the device string
timestamp The date and time the device was registered string
device_type The type of device string cloud, desktop-windows, desktop-mac, mobile-iphone, mobile-android, tablet-ipad
device_state string
device_flags string
device_revision The revision of the device string
push_token The push notification ID for mobile devices string
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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
HTTPS://www.mediafire.com/api/user/get_devices.php?session_token=&response_format=xml&signature=
    
Response
<action>user/get_devices</action>
<devices>
   <device>
      <device_id>0</device_id>
      <name>My Files</name>
      <timestamp>2013-05-14 13:44:48</timestamp>
      <device_type>cloud</device_type>
      <device_state>0</device_state>
      <device_flags>0</device_flags>
      <device_revision>160659</device_revision>
      <push_token></push_token>
   </device>
   <device>
      <device_id>1</device_id>
      <name>Changed It's Desktop Windows</name>
      <timestamp>2014-10-16 17:41:28</timestamp>
      <device_type>desktop-windows</device_type>
      <device_state>0</device_state>
      <device_flags>0</device_flags>
      <device_revision>0</device_revision>
      <push_token></push_token>
   </device>
</devices>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.4</current_api_version>

Get Info


GET http://www.mediafire.com/api/1.4/user/get_info.php
POST http://www.mediafire.com/api/1.4/user/get_info.php

Description: Returns a list of the user's personal information and account vitals.

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:

  • unabridged : Specifies whether to return the complete user info list or not. no(default) or yes.
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type Value
ekey An alternate form of the session user's ID used for authentication. Only returned if this API was called with SSL. string
email The email address of the user string
first_name The first name of the user string
last_name The last name of the user string
display_name The display name of the user string
gender The user's gender as specified on their profile string
birth_date The user's birth date as specified on their profile string datestamp
location The user's location as specified on their profile string
website The user's website as specified on their profile string
premium Whether or not the user is a premium user flag yes/no
bandwidth The amount of bandwidth remaining for the user integer
created The date the account was created string datestamp
max_upload_size The maximum individual file size, in bytes, that can be normally uploaded. DEPRECATED integer
max_instant_upload_size The maximum individual file size, in bytes, that can be instantly uploaded. DEPRECATED integer
validated Indicates whether or not the user has validated their account flag yes/no
tos_accepted Indicates the version of the TOS which was accepted string 0, 1
used_storage_size The amount of storage used in bytes integer
base_storage The amount of storage that the account comes with when no bonus activities have been completed. integer
bonus_storage The amount of bonus storage the user has earned integer
storage_limit The amount of base storage + bonus storage integer
storage_limit_exceeded Indicates if the storage limit has been exceeded flag no, yes
options Information about the user bitmask 5-7: For future use, 8: User has disabled flash uploads, 9: User has disabled html5 uploads, 10: User account or seat has been blocked, 11: User has disabled instant uploads, 12: User has disabled persistent storage[DEPRECATED], 13: User enabled seeing the download page when downloading from themselves, 14: User disabled seeing the download page when downloading from other users, 15: User enabled others to see the download page when downloading their files, 16: Only account owner can download from their account, 17: On duplicate uploaded/copied filename, keep both versions, 18: On duplicate uploaded/copied filename, replace old file, 19: On duplicate uploaded/copied filename, skip operation
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
current_api_version The latest stable API version number string

Facebook Response Properties:
Name Description Type Value
facebook_id The numerical ID of the user's Facebook account integer
date_created The date the Facebook account was created string timestamp
email The email account associated with the user's Facebook account string
facebook_url The URL of the user's Facebook account string
name The full name of the user associated with their Facebook account string
firstname The first name of the user associated with their Facebook account string
lastname The last name of the user associated with their Facebook account string
hometown The hometown of the user associated with their Facebook account string
location The location of the user associated with their Facebook account string
i18n The language of the user associated with their Facebook account string
timezone The timezone of the user associated with their Facebook account integer
synced Indicates the last time contacts were synced from this account string timestamp
linked Indicates whether or not the user has linked their Facebook account flag no, yes

GMail Response Properties:
Name Description Type Value
gmail_id The gmail provided ID of the account yes/no flag
created The date and time the gmail account was linked to the session user's MediaFire account yes/no flag
email The gmail provided email address for the account yes/no flag
gmail_url The gmail provided profile URL for the account string
name The gmail provided name for the account string
first_name The gmail provided first name for the account string
last_name The gmail provided last name for the account string
i18n The language of the user associated with their gmail account string
synced The date and time contacts were last synced from the account string
linked Specifies whether a gmail account is linked to the MediaFire account flag no, yes

Twitter Response Properties:
Name Description Type Value
twitter_id The twitter provided ID of the account string
date_created The date and time the twitter account was linked to the session user's MediaFire account string datestamp
screen_name The twitter provided screen name for the account string
name The twitter provided name for the account string
i18n The language of the user associated with their Facebook account string
synced The date and time contacts were last synced from the account string datestamp
linked Specifies whether a twitter account is linked to the MediaFire account 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.4/user/get_info.php?session_token=&response_format=json&signature=
Response
{
   action: user/get_info,
   user_info:{
      ekey: c15010cf37f8c8332cf67f78fbe41199,
      email: t03@g.n,
      first_name: Test,
      last_name: 03,
      display_name: Test 03,
      gender: Prefer not to answer,
      birth_date: ,
      location: ,
      website: ,
      premium: no,
      bandwidth: 3221211543406,
      created: 2014-09-16,
      validated: yes,
      tos_accepted: 1.4,
      used_storage_size: 234364151,
      base_storage: 10739515392,
      bonus_storage: 1073741824,
      storage_limit: 11813257216,
      storage_limit_exceeded: no,
      options: 12582912,
      facebook:{
         linked: no,
      }
      gmail:{
         linked: no,
      }
      twitter:{
         linked: no,
      }
      one_time_key_request_max_count: 10,
   }
   result: Success,
   new_key: yes,
   current_api_version: 1.4,
}

Example 2 (Premium user with JSON):

Request
https://www.mediafire.com/api/user/get_info.php?response_format=json&session_token=f936121ead0dcc229b571fae97030828d29a326c0149f69e53688b3ffacd11a9f4f6408c7079820776f8000fe7563b44a43d20102fd383603a7e0fc7d83895a969daf6ac4d15a7b0

Response
{
  "response": {
    "action": "user\/get_info",
    "user_info": {
      "ekey": "0c11f4abeb2734ded26edf9ab9671436",
      "email": "clerfjernz@example.com",
      "first_name": "Clerf",
      "last_name": "Jernz",
      "display_name": "Clerf",
      "gender": "Prefer not to answer",
      "birth_date": "0000-00-00",
      "location": "",
      "website": "",
      "premium": "yes",
      "bandwidth": "6316428823938",
      "created": "2012-02-22",
      "validated": "yes",
      "tos_accepted": "1.4",
      "used_storage_size": "49649731870",
      "base_storage": "536870912000",
      "bonus_storage": "7516192768",
      "storage_limit": "544387104768",
      "storage_limit_exceeded": "no",
      "options": "49168",
      "facebook": {
        "facebook_id": "6340511089",
        "date_created": "2014-04-30 11:28:06",
        "email": "clerfjernz@example.com",
        "facebook_url": "https:\/\/www.facebook.com\/clerfjernz",
        "name": "Clerf Jernz",
        "firstname": "Clerf",
        "lastname": "Jernz",
        "hometown": "Mergnerlier, Texas",
        "location": "Curnrer, Texas",
        "i18n": "en_US",
        "timezone": "-6",
        "synced": "2014-06-03 15:27:12",
        "linked": "yes"
      },
      "gmail": {
        "gmail_id": "638275305556112238066",
        "created": "2014-07-02 08:10:31",
        "email": "",
        "gmail_url": "",
        "name": "Clerf Jernz",
        "firstname": "Clerf",
        "lastname": "Jernz",
        "i18n": "en",
        "synced": "0000-00-00 00:00:00",
        "linked": "yes"
      },
      "twitter": {
        "twitter_id": "80836181",
        "date_created": "2013-11-20 17:28:49",
        "screen_name": "clerfjernz",
        "name": "Clerf",
        "i18n": "",
        "synced": "2014-01-02 11:44:36",
        "linked": "yes"
      },
      "one_time_key_request_max_count": "100"
    },
    "result": "Success",
    "current_api_version": "1.4"
  }
}


Get Limits


GET http://www.mediafire.com/api/1.4/user/get_limits.php
POST http://www.mediafire.com/api/1.4/user/get_limits.php

Notes: Removed deprecated response property upload_size_limit.

Description: Returns a collection of limits and their progression for the session user's account.

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
storage_base The standard amount of storage space, in bytes, the session user's account comes with. integer
storage_bonus The amount of storage space, in bytes, that has been added to the session user's account. integer
storage_limit The total amount of storage space, in bytes, available to the session user. integer
storage_used The amount of storage space, in bytes, the session user's files are currently occupying. integer
bandwidth_limit Premium user's remaining bandwidth (paid not free) integer
bandwidth_used Total paid bandwidth used integer
collaboration_limit The amount of collaboration links the session user can generate in a 24-hour period. integer
collaboration_today The number of collaboration links the session user has generated in the current 24-hour period. integer
one_time_downloads_limit The amount of one-time download links the session user can generate in a 24-hour period. integer
streaming_bandwidth_limit The maximum free daily streaming bandwidth (currently 50 GB) integer
streaming_bandwidth_today The daily streaming bandwidth used so far for today integer
one_time_downloads_today The amount of one-time download links the session user has generated in the current 24-hour period.
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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 - free account):

Request
HTTPS://www.mediafire.com/api/1.4/user/get_limits.php?session_token=&response_format=json&signature=
Response
{
   action: user/get_limits,
   storage_base: 10739515392,
   storage_bonus: 1073741824,
   storage_limit: 11813257216,
   storage_used: 239417503,
   bandwidth_limit: 3221211543406,
   bandwidth_used: 2207465,
   one_time_keys_limit: 10,
   one_time_keys_today: 0,
   streaming_bandwidth_limit: 53687091200,
   streaming_bandwidth_today: 29116834,
   result: Success,
   new_key: yes,
   current_api_version: 1.4,
}

Example 2 (Success with XML - premium account):

Request
HTTPS://www.mediafire.com/api/1.2/user/get_limits.php?session_token=&response_format=xml&signature=
Response
<action>user/get_limits</action>
<storage_base>1073741824000</storage_base>
<storage_bonus>10737418240</storage_bonus>
<storage_limit>1084479242240</storage_limit>
<storage_used>230010731</storage_used>
<bandwidth_limit>5367955782472</bandwidth_limit>
<bandwidth_used>0</bandwidth_used>
<one_time_keys_limit>100</one_time_keys_limit>
<one_time_keys_today>0</one_time_keys_today>
<streaming_bandwidth_limit>53687091200</streaming_bandwidth_limit>
<streaming_bandwidth_today>253969023</streaming_bandwidth_today>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.4</current_api_version>

Get Session Token


GET SSL Required https://www.mediafire.com/api/1.4/user/get_session_token.php
POST SSL Required https://www.mediafire.com/api/1.4/user/get_session_token.php

Note: This call requires SSL.

Description : Generates a session token with a life of 10 minutes to be used in upcoming API requests.

Required Parameters:

  • application_id : The ID of the application that is using the API.
  • signature : The SHA1 hash string of the following information concatenated in the order shown:
    • (If the application property require_secret_key is not true the api_key may be omitted from signature construction.)
    • Authentication via MediaFire: email or ekey + password + application_id + api_key

Relative Parameters:

  • email : The email address of the user's MediaFire account.
  • password : The password of the user's MediaFire account.
  • ekey : An encrypted version of the user's numeric ID to be used in place of email above. Returned by user/get_info when SSL mode is used.

Optional Parameters:

  • token_version : 1 or 2 (default 1). The session token version. Version 2 is the token that requires a signature on every API call. Click here for more information about the API Call signature.
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type Value
session_token A token to authenticate the session user in subsequent API calls ('v1' has ten minute lifespan but can be renewed with user/renew_session_token before it expires AND 'v2' has two year lifespan but requires the accompaniment of a signature. string
secret_key A component used in the construction of Session Token v2 signatures. integer
time A component used in the construction of Session Token v2 signatures. decimal number
ekey An alternate form of the session user's ID to be used in place of email in certain APIs. string
pkey A unique hash token of the session user's password. Compare with previously returned pkeys to determine if the user's password has changed. string
error The numerical error code integer 127
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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 - token_version=1):

Request
HTTPS://www.mediafire.com/api/user/get_session_token.php?application_id=41629&signature=&email=&password=&token_version=1&response_format=json
Response
{
   action: user/get_session_token,
   session_token: d590e7ddf92917a14f2ebe1c6767a160d3cdf5f725d3d274215378c75ba52852e0800976f7f88f53446dbad342ebefe85c75d647c5f3ee3e82724ecf1dbf23695e7a26f2a8f600e0,
   ekey: cf78ef53165d4178d0e054c0971bd7b4,
   pkey: b45743b5a6,
   result: Success,
   current_api_version: 1.3,
}

Example 2 (Success with XML - token_version=2 & ekey):

Request
HTTPS://www.mediafire.com/api/user/get_session_token.php?application_id=41629&signature=&ekey=&password=&token_version=2&response_format=xml
Response
<action>user/get_session_token</action>
<session_token>89b3655e4ace4c54eff439e70fdfc31c72ec1abrn8b07b9c61610b8f920784f0b111b6c8e536d8ba5c3abb2376d2463688b293a3e3b0945b658e4528edf2e566421b20abe7ba8cbf</session_token>
<secret_key>1008148623</secret_key>
<time>1429681767.747</time>
<ekey>cf78ef53165d4178d0ef96c0971bd7b4</ekey>
<result>Success</result>
<current_api_version>1.3</current_api_version>

Get Settings


GET http://www.mediafire.com/api/1.4/user/get_settings.php
POST http://www.mediafire.com/api/1.4/user/get_settings.php

Description: Returns a collection of the session user's account settings and vitals.

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
validated Indicates whether or not the user has validated their email address. 'yes' or 'no'. flag yes/no
instant_uploads_enabled Indicates the availability of performing "instant" uploads. 'yes' or 'no'. flag yes/no
show_download_page -> me_from_me Show the download page when I am logged in and downloading from myself: 'yes' or 'no' (this appears under the subheading 'show_download_page') flag yes/no
show_download_page -> me_from_others Show the download page when I am logged in and downloading from someone else: 'yes' or 'no' (this appears under the subheading 'show_download_page') flag yes/no
show_download_page -> others_from_me Show the download page when someone else, logged in or our, downloads from me: 'yes' or 'no' (this appears under the subheading 'show_download_page') flag yes/no
auto_bandwidth Automatically purchase more bandwidth when my available bandwidth get low. 'yes' or 'no' object
enabled Specifies whether auto-bandwidth is turned on for the account flag yes/no
product_id The numerical ID of the product to use for the bandwidth purchase integer
low_bandwidth The bandwidth threshold, in bytes, that determines when more bandwidth is automatically purchased integer
used_storage_size The amount of storage space, in bytes, the session user's files are currently occupying. integer
storage_limit The total amount of storage space, in bytes, available to the session user. integer
storage_limit_exceeded Indicates if the session user's files are occupying more space than is available to the user. 'yes' or 'no'. yes/no flag
previous_file_versions The number of older file versions to keep for a file. integer
default_share_link_status Specifies the initial share link status for a new file string enabled, disabled, or inherit
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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.4/user/get_settings.php?session_token=123456789012345678901234567890123456789012345678901234567890
Response
<response>
  <action>user/get_settings</action>
  <settings>
    <validated>yes</validated>
    <instant_uploads_enabled>no</instant_uploads_enabled>
    <show_download_page>
      <me_from_me>no</me_from_me>
      <me_from_others>yes</me_from_others>
      <others_from_me>no</others_from_me>
    </show_download_page>
    <auto_bandwidth>
      <enabled>no</enabled>
    </auto_bandwidth>
    <used_storage_size>24205916045</used_storage_size>
    <storage_limit>272730423296</storage_limit>
    <storage_limit_exceeded>no</storage_limit_exceeded>
    <previous_file_versions>5</previous_file_versions>
    <default_share_link_status>inherit</default_share_link_status>
    <collect_metadata>yes</collect_metadata>
  </settings>
  <result>Success</result>
  <current_api_version>1.4</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/1.4/user/get_settings.php?session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json

Response
{
  "response": {
    "action": "user/get_settings",
    "settings": {
      "validated": "yes",
      "instant_uploads_enabled": "no",
      "show_download_page": {
        "me_from_me": "no",
        "me_from_others": "yes",
        "others_from_me": "no"
      },
      "auto_bandwidth": {
        "enabled": "no"
      },
      "used_storage_size": "24205916045",
      "storage_limit": "272730423296",
      "storage_limit_exceeded": "no",
      "previous_file_versions": "5",
      "default_share_link_status": "inherit",
      "collect_metadata": "yes"
    },
    "result": "Success",
    "current_api_version": "1.4"
  }
}

Register


GET SSL Required https://www.mediafire.com/api/1.4/user/register.php
POST SSL Required https://www.mediafire.com/api/1.4/user/register.php

Note: This API requires SSL and is restricted. If you wish to enable this feature in your app, please contact customer service.

Description : Register an individual with MediaFire and create a user account.

Required Parameters:

  • application_id : The application that is using the API.

Relative Parameters:

One of the following account identifiers:
  • email : The email address to be used as a login to the user's MediaFire account, and
  • password : The password of the user's MediaFire account.

Optional Parameters:

  • first_name: The first name of the user.
  • last_name : The last name of the user.
  • display_name : The name to be displayed on the user's shared items.
  • response_format : 'xml' or 'json' (default 'xml')

Response Properties

Name Description Type Value
email The email address and username of the new account string
temp_pw The temporary password for the new account when registering with facebook string
created The date and time the account was created string
pkey A unique hash token of the session user's password. Compare with previously returned pkeys to determine if the user's password has changed. string
ekey An alternate form of the session user's ID to be used in place of email in certain APIs. string
device_revision The revision number of the device integer
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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 - email, password, first_name, last_name and display_name):

Request
HTTPS://www.mediafire.com/api/1.4/user/register.php?application_id=41129&email=t103%40g.n&password=justlive&first_name=Test&last_name=103&display_name=T103&response_format=xml
Response
<action>user/register</action>
<email>t103@g.n</email>
<temp_pw></temp_pw>
<created>2015-05-12 15:31:03</created>
<created_utc>2015-05-12T20:31:03Z</created_utc>
<ekey>3152bd9de1bd701b5efa7a05f179a651</ekey>
<pkey>78d5351785</pkey>
<result>Success</result>
<current_api_version>1.4</current_api_version>

Renew Session Token


GET https://www.mediafire.com/api/1.4/user/renew_session_token.php
POST https://www.mediafire.com/api/1.4/user/renew_session_token.php

Description : Extends the life of the session token by another 10 minutes. If the session token is less than 5 minutes old, then it does not get renewed and the same token is returned. If the token is more than 5 minutes old, then, depending on the application configuration, the token gets extended or a new token is generated and returned.

Required Parameters:


Relative Parameters:

  • none

Optional Parameters:

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


Response Properties

Name Description Type Value
session_token The new, or refreshed, session token string
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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.4/user/renew_session_token.php?session_token=7d31c37ae57f08951f7e50e69eaf81d2a1a8c047aabc945272e838f82e3384f4ebfe89453f888b9c3a7a777667ada551c21604493d9863e61db0593ad06a45cf2d46f016771732a4
Response
<response>
  <action>user/renew_session_token</action>
  <session_token>7d31c37ae57f08951f7e50e69eaf81d2a1a8c047aabc945272e838f82e3384f4ebfe89453f888b9c3a7a777667ada551c21604493d9863e61db0593ad06a45cf2d46f016771732a4</session_token>
  <result>Success</result>
  <current_api_version>1.4</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/user/renew_session_token.php?session_token=7d31c37ae57f08951f7e50e69eaf81d2a1a8c047aabc945272e838f82e3384f4ebfe89453f888b9c3a7a777667ada551c21604493d9863e61db0593ad06a45cf2d46f016771732a4&response_format=json
Response
{
  "response": {
    "action": "user/renew_session_token",
    "session_token": "7d31c37ae57f08951f7e50e69eaf81d2a1a8c047aabc945272e838f82e3384f4ebfe89453f888b9c3a7a777667ada551c21604493d9863e61db0593ad06a45cf2d46f016771732a4",
    "result": "Success",
    "current_api_version": "1.4"
  }
}

Set Avatar


GET https://www.mediafire.com/api/1.4/user/set_avatar.php
POST https://www.mediafire.com/api/1.4/user/set_avatar.php


Description : Save a copy of an image file, or a remote image, to serve as the operating user's avatar.

Required Parameters:


Relative Parameters:

  • action : The type of change to make to the account avatar. set_default(unset but retain custom avatar) or remove(unset and remove custom avatar). Required if quick_key or url are not passed.
  • quick_key : The file key of an image file existing in the session user's account. If action is passed this parameter is ignored. Required if action or url are not passed.
  • url : The URL to an image file. If action or quick_key are passed this parameter is ignored. Required if action or quick_key are not passed.
  • 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
quick_key The quickkey of the avatar. string
new_device_revision The revision number of the device. Returned only when the revision number has changed. integer
upload_key An alpha-numeric ID key used with upload/get_web_upload to determine the status of the file upload string
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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 - quick_key):

Request
HTTPS://www.mediafire.com/api/1.4/user/set_avatar.php?session_token=&quick_key=p1axe01sxv3mswf&response_format=json&signature=
Response
{
   action: user/set_avatar,
   quick_key: v0e75ya85a4995p,
   message: The file(s)/folder(s) you upload/copy exceed your total storage limit,
   error: 162,
   result: Error,
   new_key: yes,
   current_api_version: 1.4,
   new_device_revision: 19,
}

Example 2 (Success with XML - action=remove):

Request
HTTPS://www.mediafire.com/api/1.4/user/set_avatar.php?session_token=&action=remove&response_format=xml&signature=
Response
<action>user/set_avatar</action>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.4</current_api_version>
Example 3 (Success with JSON - url):

Request
HTTPS://www.mediafire.com/api/1.4/user/set_avatar.php?session_token=&url=http%3A%2F%2Fwww.trademarkia.com%2Fservices%2Fhome_logo.ashx%3Fsid%3D86078087%26size%3D200&response_format=json&signature=
Response
{
   action: user/set_avatar,
   upload_key: 3p3yeps573,
   result: Success,
   new_key: yes,
   current_api_version: 1.4,
}

Set Settings


GET SSL Required https://www.mediafire.com/api/1.4/user/set_settings.php
POST SSL Required https://www.mediafire.com/api/1.4/user/set_settings.php

Notes: None

Description : Set user preferences.

Required Parameters:


Relative Parameters:

  • signature : Required only for session token version 2. Click here to learn more about building an API call signature.
  • previous_file_versions : The number of older file versions to keep. Required if default_share_link_status or collect_metadata is not passed. 0 to 10.
  • default_share_link_status : Specifies the initial share link status for a new folder or file. Required if previous_file_versions is not passed. enabled, disabled, inherit.

Optional Parameters:

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


Response Properties

Name Description Type Value
error The numerical error code integer 128
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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
http://www.mediafire.com/api/1.4/user/set_settings.php?previous_file_versions=8&default_share_link_status=disable&session_token=3f643fbbda95b7dfc4a094927a8bb23cde7bc64481f015eabca2559ae1835984c85566f97882e4c598e5702f556064e22bb9e8f6b9d12a67a7bd74e4bdd553c958e489572cd0d1fc&response_format=json

Response
{
  "response": {
    "action": "user/set_settings",
    "result": "Success",
    "current_api_version": "1.4"
  }
}


Update


GET https://www.mediafire.com/api/1.4/user/update.php
POST https://www.mediafire.com/api/1.4/user/update.php

Description : Updates the user's personal information.

Required Parameters:


Relative Parameters:

  • current_password : For security, the current password of the account has to be passed when updating the email or the password.
  • subdomain : The user's subdomain.
  • company_name : The name of the sessions user's company. Required if subdomain is passed.
  • signature : Required only for session token version 2. Click here to learn more about building an API call signature.

Optional Parameters:

  • display_name : The user's display name.
  • first_name : The user's first name.
  • last_name : The user's last name.
  • email : The new email. To update the email, current_password has to be passed.
  • password : The new password. To update the password, current_password has to be passed.
  • birth_date : The user's birth date. It should take the format "yyyy-mm-dd".
  • gender : The user's gender ('male', 'female', or 'none').
  • website : The user's website URL.
  • location : The user's address location.
  • newsletter : Whether to receive MediaFire site news via email ('yes' or 'no').
  • primary_usage : The user's primary usage of this MediaFire account ('home', 'work', 'school', or 'none').
  • timezone : The code of the local timezone of the user.
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type Value
pkey A unique hash token of the session user's password. Compare with previously returned pkeys to determine if the user's password has changed. string
error The numerical error code integer
message The error description for error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful string Success or Error
new_key Indicates a new call signature needs calculated. Applicable only when using Session Token v2 flag yes
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 - updating first_name, last_name, display_name, gender):

Request
HTTPS://www.mediafire.com/api/1.4/user/update.php?session_token=&first_name=Test&last_name=008&display_name=t08&gender=none&response_format=json&signature=
Response
{
   action: user/update,
   pkey: 78d5351785,
   result: Success,
   new_key: yes,
   current_api_version: 1.4,
}

Example 2 (Success with XML - updating email):

Request
HTTPS://www.mediafire.com/api/user/update.php?session_token=¤t_password=&email=t08@g.p&response_format=xml&signature=
Response
<action>user/update</action>
<pkey>78d5351785</pkey>
<result>Success</result>
<new_key>yes</new_key>
<current_api_version>1.4</current_api_version>

Example 3 (Success with JSON - updating subdomain & company_name):

Request
HTTPS://www.mediafire.com/api/user/update.php?session_token=&subdomain=t17&company_name=Test17&response_format=json&signature=
Response
{
   action: user/update,
   pkey: 78d5351785,
   result: Success,
   new_key: yes,
   current_api_version: 1.4,
}