Device1.1

Empty Trash


Description : Empties out the content of the trash can. If the trash has too many items, then the API will return immediately with the property asynchronous=yes and the operation will be performed in the background.

Required Parameters


Optional Parameters
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • device_id : The ID of the device. If not passed, it would return files and folders from the cloud.
  • response_format : 'xml' or 'json' (default 'xml')


GET http://www.mediafire.com/api/1.1/device/empty_trash.php
POST http://www.mediafire.com/api/1.1/device/empty_trash.php

Response Properties
  • asynchronous: This property tells whether the request is being processed real-time. If the job is processed asynchronously, callers will need to poll device/get_status to determine when their job is complete. 'yes' or 'no'
  • device_revision: The revision number of the device
  • result: Indicates if the API call was successful: 'Success' or 'Error'
  • current_api_version: The API version

Error Responses From Supplying a Bad Session Token:
  • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
  • error: Error number for a supplying a bad session token: '105'

Example:

Request
http://www.mediafire.com/api/1.1/device/empty_trash.php?session_token=0a7ae1b77061da54796078b3906b7a7bab9747dc6e7848876674eca0055821c85196e164f1fa1d17cfcf9b2dea8268b42b920b3b7948f4de4cbab9c716bcb827267e3f3a6341dc60
Response
<response>
  <action>device/empty_trash</action>
  <asynchronous>yes</asynchronous>
  <result>Success</result>
  <current_api_version>1.1</current_api_version>
</response>

Follow Resource


Description : Grants the current user read permissions for the specified resource .

Required Parameters


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


GET http://www.mediafire.com/api/1.1/device/follow_resource.php
POST http://www.mediafire.com/api/1.1/device/follow_resource.php

Response Properties
  • device_revision: The revision number of the device
  • result: Indicates if the API call was successful: 'Success' or 'Error'
  • current_api_version: The API version

Error Responses From Supplying a Bad Session Token:
  • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
  • error: Error number for a supplying a bad session token: '105'

Error for providing a quickkey the user does not own:
  • message:'Access Denied
  • error:'114'
Error for providing a contactkey that does not exist:
  • message: This contact does not exist
  • error: '138'

Example:

Request
http://www.mediafire.com/api/1.1/device/follow_resource.php?resource=QUICKKEY_OR_FOLDERKEY&session_token=TOKEN&signature=SIGNATURE
Response
<response>
    <action>device/follow_resource</action>
    <device_revision>123</device_revision>
    <result>Success</result>
    <current_api_version>1.1</current_api_version>
</response>

Get Changes


Description : Returns the list of all files and folders with revisions greater than the passed parameter revision and less than or equal to the next 500-multiplier. For example, if revision=1211, then all files and folders with revision greater than 1211 and less than or equal 1500 are returned.

Required Parameters

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • revision : The device revision after which the changes to be returned occur.

Optional Parameters
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • device_id : The ID of the device. If not passed, it would return files and folders from the cloud.
  • response_format : 'xml' or 'json' (default 'xml')


GET http://www.mediafire.com/api/1.1/device/get_changes.php
POST http://www.mediafire.com/api/1.1/device/get_changes.php

Response Properties
  • changes_list_block: Indicated which 500 block was specified for the call
  • device_revision: The revision number of the device
  • result: Indicates if the API call was successful: 'Success' or 'Error'
  • current_api_version: The API version

Returned responses for updated files
  • quickkey: The quickkey of the file that was updated
  • filename: The name of the updated file
  • mimetype: The mimetype of the updated file
  • filetype: The filetype of the updated file: 'presentation,' 'spreadsheet,' 'image,' 'document,' etc.
  • revision: The revision of the updated file
  • created: The date and time the file was created
  • grafted: 'yes' or 'no'
  • parent_folderkey: The parent folderkey of the updated file
  • parent_foldername: The parent foldername of the updated file
Returned responses for updated folders
  • folderkey: The folderkey for the updated folder
  • revision: The revision of the updated folder
  • grafted: 'yes' or 'no'
  • parent_folderkey: The parent folderkey of the updated folder
Returned responses for deleted files
  • quickkey: The quickkey of the file that was deleted
  • revision: The revision of the deleted file
  • created: The date and time the file was created
  • grafted: 'yes' or 'no'
  • parent_folderkey: The parent folderkey of the deleted file
  • Returned responses for deleted folders
    • folderkey: The folderkey for the deleted folder
    • revision: The revision of the deleted folder
    • grafted: 'yes' or 'no'
    • parent_folderkey: The parent folderkey of the updated folder
    Error Responses From Supplying a Bad Session Token:
    • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
    • error: Error number for a supplying a bad session token: '105'

    Example:

    Request
    http://www.mediafire.com/api/1.1/device/get_changes.php?session_token=de8f7c427c7a1e84134175880ca5f7f959a6d2894a47fcc7457ecb65fd930785f72801bc6b2b54be2284baf05a17b4098b47074eff4685259f3a205929e6832ce5e6e9c9affdb3d3&revision=53
    
    Response
    <response>
        <action>device/get_changes</action>
        <updated>
            <files>
                <file>
                    <quickkey>fl4fo8nfc4np3cv</quickkey>
                    <revision>61</revision>
                    <created>2013-04-23 12:01:21</created>
                    <parent_folderkey/>
                </file>
                <file>
                    <quickkey>2xd01t7y56z5vml</quickkey>
                    <revision>64</revision>
                    <created>2013-04-21 22:42:16</created>
                    <parent_folderkey>pdwq948fyr7r7</parent_folderkey>
                </file>
                <file>
                    <quickkey>94bc9vocqwu3dh</quickkey>
                    <revision>62</revision>
                </file>
            </files>
            <folders>
                <folder>
                    <folderkey>vnp2fvf2mionv</folderkey>
                    <revision>72</revision>
                </folder>
                <folder>
                    <folderkey>apfsoiaspoisd</folderkey>
                    <revision>71</revision>
                </folder>
            </folders>
        </updated>
        <deleted>
            <files>
                <file>
                    <quickkey>qnbvekwvndddfg5</quickkey>
                    <revision>77</revision>
                    <created>2013-04-16 02:10:33</created>
                    <parent_folderkey/>
                </file>
            </files>
            <folders>
                <folder>
                    <folderkey>gvbweicun3b9y</folderkey>
                    <revision>73</revision>
                </folder>
            </folders>
        </deleted>
        <device_revision>105</device_revision>
        <result>Success</result>
        <current_api_version>1.1</current_api_version>
    </response>
    

    Example 2 (A Response Showing No Changes):

    Request
    http://www.mediafire.com/api/1.1/device/get_changes.php?session_token=de8f7c427c7a1e84134175880ca5f7f959a6d2894a47fcc7457ecb65fd930785f72801bc6b2b54be2284baf05a17b4098b47074eff4685259f3a205929e6832ce5e6e9c9affdb3d3&revision=530
    
    Response
    {
      "response":
      {
        "action":"device\/get_changes",
        "updated":"",
        "deleted":"",
        "device_revision":"42282",
        "changes_list_block":"530",
        "result":"Success",
        "current_api_version":"1.1"
      }
    }
    

    Get Foreign Resources


    Description : Gets information about resources shared with the current user.

    Required Parameters


    Optional Parameters
    • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
    • chunk : Which segment of the data to return (0 = all).
    • sort_by : Key of the column by which to sort (currently supports 'name', 'size', 'sync', 'date_created', 'date_shared').
    • reverse : If '1', sort descending; otherwise, ascending.
    • type : Filter foreign resources by resource type ('files' or 'folders').
    • sync : Filter foreign resources by resource 'sync to desktop' status (0 = no, 1 = yes).
    • contact : Filter foreign resources by user's contact key.
    • filetype : Filter foreign resources by file type ('application', 'archive', 'audio', 'development', 'document', 'image', 'presentation', 'spreadsheet', or 'video')
      No need to filter by 'type' if you specify this as only files will be returned.
    • response_format : 'xml' or 'json' (default 'xml')


    GET http://www.mediafire.com/api/1.1/device/get_foreign_resources.php
    POST http://www.mediafire.com/api/1.1/device/get_foreign_resources.php

    Response Properties
    General Responses
    • result: Indicates if the API call was successful: 'Success' or 'Error'
    • current_api_version: The API version

    Responses for Files
    • md5: The hash of the file
    • quickkey: The quickkey of the file
    • filename: The name of the file
    • created: The date and time the file was created
    • desc: The description of the file
    • revision: The revision number of the file
    • size: The size of the file (in bytes)
    • mimetype: The MIME type of the file
    • share_link_enabled: Share link enabled. '0' for no and '1' for yes.
    • filetype: The filetype: 'presentation,' 'spreadsheet,' 'image,' 'document,' etc.
    • 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].
    • date_shared: The date the file was shared with you
    • resource_key: The quickkey of the file
    • attributes: Indicates if the resource is a file or a folder. Bit 0 = folder; 1 = file
    • permissions: The permissions granted to the user for this file. Bit 0 = read; 1 = read + write; 2 = manage.
    • options: A bit-mask value indicating special details about the session user and the account. The following is a list of bits and their meanings. If meanings are not listed, they are internal MediaFire notations not for public use:
      • 1: File is owned by the session user.
      • 2: File is supported for preview.
      • 4: File is editable.
      Returned Responses for Folders
      • folderkey: The folderkey of the shared folder
      • name: The foldername of the shared folder
      • desc: The description of the folder
      • created: The date and time the folder was created
      • revision: The revision number of the folder
      • share_link_enabled: Whether or not the folder is public (share link enabled) or private. '0' for share link is not enabled (private) or '1' for share link is enabled (public)
      • date_shared: The date and time the folder was shared
      • resource_key: The folderkey for the folder
      • attributes: Indicates if the resource is a file or a folder. Bit 0 = folder; 1 = file.
      • permissions: The permissions granted to the user for this file. Bit 0 = read; 1 = read + write; 2 = manage.
      • options: A bit-mask value indicating special details about the session user and the account. The following is a list of bits and their meanings (if the meaning is not listed, it is an internal MediaFire notation and not for public use):
        • 1: Folder is owned by the session user.
        • 2: Folder is supported for preview.
        • 4: Folder is editable.
      • sharer: The contactkey of the person who shared the folder
      Error Responses From Supplying a Bad Session Token:
      • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
      • error: Error number for a supplying a bad session token: '105'

      Example:

      Request
      http://www.mediafire.com/api/1.1/device/get_foreign_resources.php?session_token=TOKEN&signature=SIGNATURE&chunk=1&filter={"type":"files"}
      
      Response
      <response>
          <action>device/get_foreign_resources</action>
          <result>Success</result>
          <files>
              <file>
                  <TYPICAL_FILE_INFO>...</TYPICAL_FILE_INFO>
                  <share_link_enabled>1</share_link_enabled>
                  <sharer>CONTACT_KEY_OF_SHARER</sharer>
                  <date_shared>2013-02-01 01:02:03</date_shared>
                  <attributes>2</attributes>
                  <permissions>1</permissions>
                  <options>0</options>
              </file>
          </files>
          <folders></folders>
          <current_api_version>1.1</current_api_version>
      </response>
      

      Get Patch


      Description : Returns the direct download link of a patch file.

      Required Parameters

      • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
      • quick_key : The quickkey that identifies the patch file. Patches have the same quickkeys as the full file they apply to.
      • source_revision : The source revision of the patch.
      • target_revision : The target revision of the patch.

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


      GET http://www.mediafire.com/api/1.1/device/get_patch.php
      POST http://www.mediafire.com/api/1.1/device/get_patch.php

      Response Properties
      • patch_link: The link of the patch file
      • patch_hash: The hash of the patch file
      • result: Indicates if the API call was successful: 'Success' or 'Error'
      • current_api_version: The API version

      Error Responses From Supplying a Bad Session Token:
      • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
      • error: Error number for a supplying a bad session token: '105'

      Example:

      Request
      http://www.mediafire.com/api/1.1/device/get_patch.php?session_token=f96070e121f994291afa8f9e829b517b6936e58ec9d61293d9b65c4979d0159e031e852037bf4a827a25b9d60d0e16238bdb8abd5ee36cf258446fd4dcdfa8a79c171bc444a3684b&quick_key=2oc3180v9w8vohv&source_revision=11398&target_revision=11399
      
      Response
      <response>
          <action>device/get_patch</action>
          <patch_link>http://205.196.123.34/uc3jppfi4cmg/2od3180v9w8vohv/desktop.ini.patch.50398.50399</patch_link>
          <patch_hash>3e216115bf425e7851cb3310656279109884e672aca190db13601ca2a5e4af57</patch_hash>
          <result>Success</result>
          <current_api_version>1.1</current_api_version>
      </response>
      

      Get Resource Shares


      Description : Returns a list of contacts, along with their permissions, of a shared file or folder.

      Required Parameters


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

      GET http://www.mediafire.com/api/1.1/device/get_resource_shares.php
      POST http://www.mediafire.com/api/1.1/device/get_resource_shares.php

      Response Properties
      • contact_key: Key representing a user relationship, found in lr_contacts.contacts
      • contact_type: The type of the contact (mediafire, gmail, twitter, etc)
      • contact_indirect: Whether the contact is indirect (0 or 1). A contact is indirect if the user did not directly share with this contact but rather the contact is following this resource because it was publicly shared.
      • display_name: Name or e-mail of the contact
      • avatar: URI for the contact's avatar image
      • permissions: Bit @offset 0 = read; @offset 1 = read + write; @offset 2 = manage(NOT IN USE).
      • result: Indicates if the API call was successful: 'Success' or 'Error'
      • current_api_version: The API version

      Error Responses From Supplying a Bad Session Token:
      • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
      • error: Error number for a supplying a bad session token: '105'

      Example:

      Request
      http://www.mediafire.com/api/1.1/device/get_resource_shares.php?session_token=TOKEN&resource=QUICKKEY_OR_FOLDER_KEY
      
      Response:
      <response>
          <action>device/get_resource_shares</action>
          <shares>
              <share>
                  <contact_key>1234567</contact_key>
      			<contact_type>1</contact_type>
      			<contact_indirect>0</contact_indirect>
                  <display_name>Johnny MediaFire</display_name>
                  <avatar>URI_FOR_AVATAR_IMAGE</avatar>
                  <permissions>2</permissions>
              </share>
          </shares>
          <result>Success</result>
          <current_api_version>1.1</current_api_version>
      </response>
      

      Get Status


      Description: Returns the status of a device specified by device_id. Some of the information returned is:

      • async_jobs_in_progress : Whether or not there are any currently-in-progress jobs.
      • device_revision : The revision number of the device.

      Required Parameters:
      Optional Parameters:
      • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
      • device_id : The ID of the device. If not passed, it would return the status of the cloud device.
      • simple_report : 'yes' or 'no' (default 'no'). Determines if the async_jobs_in_progress field is returned.
      • response_format : 'xml' or 'json' (default 'xml')


      GET http://www.mediafire.com/api/1.1/device/get_status.php
      POST http://www.mediafire.com/api/1.1/device/get_status.php

      Response Properties
      • device_revision: Holds the current revision number for the device.
      • async_jobs_in_progress: Indicates whether the user has asynchronous jobs running on the back-end. 'yes' or 'no'
      • result: Indicates if the API call was successful: 'Success' or 'Error'
      • current_api_version: The API version

      Error Responses From Supplying a Bad Session Token:
      • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
      • error: Error number for a supplying a bad session token: '105'

      Example:

      Request
      http://www.mediafire.com/api/1.1/device/get_status.php?session_token=de8f7c427c7a1e84134175880ca5f7f959a6d2894a47fcc7457ecb65fd930785f72801bc6b2b54bd2284baf05a17b4098b47074eff4685259f3a205929e6832ce5e6e9c9affdb3d3
      
      Response
      <response>
          <action>device/get_status</action>
          <async_jobs_in_progress>yes</async_jobs_in_progress>
          <result>Success</result>
          <current_api_version>1.1</current_api_version>
      </response>
      

      Get Trash


      Description : Returns the trash can folder data and the list of immediate files and folders in the trash can. Contents of subfolders in the trash can will not be returned.

      Required Parameters


      Optional Parameters
      • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
      • device_id : The ID of the device. If not passed, it would return files and folders from the cloud's trash can.
      • data_only : Return trash can folder data only, 'yes' or 'no' (default 'no').
      • content_type : The type of content requested. "folders" or "files" (default: "folders").
      • chunk : The chunk number starting from 1.
      • response_format : 'xml' or 'json' (default 'xml')

      GET http://www.mediafire.com/api/1.1/device/get_trash.php
      POST http://www.mediafire.com/api/1.1/device/get_trash.php

      Response Properties
      General Responses:
      • folder_count: The amount of folders in the user's trash
      • file_count: The amount of files in the user's trash
      • result: Indicates if the API call was successful. 'Success' or 'Failure'
      • current_api_version: The API version

      Responses for Folders
      • folderkey: The folderkey
      • name: The folder name
      • description: The description of the folder
      • tags The tags of the folder
      • privacy: The privacy of the file: 'public' or 'private'
      • created: The date and time the folder was created
      • revision: The revision of the folder
      • flag: The flags associated with the folder
      • file_count: The amount of files in the folder
      • folder_count: The amount of folders in the folder
      • dropbox_enabled: Indicates if the folder is dropbox enabled: 'yes' or 'no'
      • delete_date: The date and time the folder was deleted

      Responses for Files
      • quickkey: The quickkey of the file
      • hash: The hash of the file
      • filename: The filename
      • description: The description of the file
      • size: The size of the file in bytes
      • privacy: Indicates the privacy level of the file: 'public' or 'private'
      • created: The date and time the file was created
      • password_protected: Indicates if the file is password protected: 'yes' or 'no' [deprecated]
      • mimetype: The mimetype of the file
      • filetype: The file type
      • view: Specifies if this file is viewable via MediaFire and, if so, by what system. 0 [not-viewable], 1 [PDF Viewer], 2 [PDF Viewer], 3 [deprecated].
      • edit: Specifies if this file can be edited via MediaFire and, if so, by what system. 0 [not-editable], 1 [Text Editor], 2 [deprecated].
      • revision: The revision of the file
      • flag: The flag of the file
      • downloads: The amount of times the file has been downloaded
      • views: The amount of times the file has been viewed
      • delete_date: The date and time the file was deleted
      • view: The view link of the file (This response is under the tag "links")
      • normal_download: The normal download link of the file (This response is under the tag "links")
      • watch: The watch link of a video file (This response is under the tag "links")
      • listen: The listen link of a sound file (This response is under the tag "links")

      Error Responses From Supplying a Bad Session Token:
      • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
      • error: Error number for a supplying a bad session token: '105'

      Example:

      Request
      http://www.mediafire.com/api/1.1/device/get_trash.php?session_token=de8f7c427c7a1e84134175880ca5f7f959a6d2894a47fcc7457ecb65fd930785f72801bc6b2b54be2284baf05a17b4098b47074eff4685259f3a205929e6832ce5e6e9c9affdb3d3
      
      Response
      <response>
        <action>device/get_trash</action>
        <name>Trash</name>
        <folder_count>0</folder_count>
        <file_count>3</file_count>
        <chunk_size>100</chunk_size>
        <content_type>files</content_type>
        <chunk_number>1</chunk_number>
        <files>
          <file>
            <quickkey>zwofgsdyae4kadu</quickkey>
            <filename>presentation(3).rtf</filename>
            <description/>
            <size>1564</size>
            <privacy>public</privacy>
            <created>2013-02-18 13:41:30</created>
            <password_protected>no</password_protected>
            <filetype>document</filetype>
            <mimetype>text/rtf</mimetype>
            <flag>22</flag>
            <hash>2288fbc2f2ad7573b5a718c40de5a2052cbc370bd61dc8a875c7990994521191</hash>
            <downloads>0</downloads>
            <views>0</views>
          </file>
          <file>
            <quickkey>bumi3qrvdedun6l</quickkey>
            <filename>test_2013.rtf</filename>
            <description/>
            <size>1559</size>
            <privacy>public</privacy>
            <created>2013-02-18 11:16:50</created>
            <password_protected>no</password_protected>
            <filetype>document</filetype>
            <mimetype>text/rtf</mimetype>
            <flag>22</flag>
            <hash>2fcae6e06f5392a01422b38f916504c13feb2419f64091a696ccc9e2f193267f</hash>
            <downloads>0</downloads>
            <views>0</views>
          </file>
          <file>
            <quickkey>pbj6wh2zbua09uh</quickkey>
            <filename>abc.rtf</filename>
            <description/>
            <size>1564</size>
            <privacy>public</privacy>
            <created>2013-02-18 13:48:18</created>
            <password_protected>no</password_protected>
            <filetype>other</filetype>
            <mimetype>text/rtf</mimetype>
            <flag>2</flag>
            <downloads>0</downloads>
            <views>0</views>
          </file>
        </files>
        <result>Success</result>
        <current_api_version>1.1</current_api_version>
      </response>
      

      Get Updates


      Description : Returns the list of patches for a file that belongs to the session user for a certain revision range. It will also return the current revision of the file.

      Required Parameters


      Optional Parameters
      • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
      • target_revision : This is the end revision. If not passed, the current file revision would be the target revision.
      • response_format : 'xml' or 'json' (default 'xml')


      GET http://www.mediafire.com/api/1.1/device/get_updates.php
      POST http://www.mediafire.com/api/1.1/device/get_updates.php

      Response Properties
      • current_revision: The revision number of the file
      • current_hash The hash of the file
      • result: Indicates if the API call was successful: 'Success' or 'Error'
      • current_api_version: The API version

      Error Responses From Supplying a Bad Session Token:
      • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
      • error: Error number for a supplying a bad session token: '105'

      Example:

      Request
      http://www.mediafire.com/api/1.1/device/get_updates.php?session_token=6945fe8378790a36dbc7463646b89521c954a0108ae2085d82ce8d220714c86710931c195fb32584ca59abc07dbc7a70c1844e303ec6e83257b8332950153d3ca8ea23bdb8f99942&quick_key=plga785dlu6bxaq&revision=8
      
      Response
      <response>
          <action>device/get_updates</action>
          <current_revision>91</current_revision>
          <updates>
              <update>
                  <source_revision>85</source_revision>
                  <source_hash>8b757fba0754c3ae6631742fb51add94443d4cc4b3745898c70b33e32b308017</source_hash>
                  <target_revision>88</target_revision>
                  <target_hash>973ef04268f32a0cff1b4d069b125c78694b3dd357c601d6c6310d73ac75c385</target_hash>
                  <timestamp>2013-06-15 22:53:11</timestamp>
              </update>
              <update>
                  <source_revision>88</source_revision>
                  <source_hash>973ef04268f32a0cff1b4d069b125c78694b3dd357c601d6c6310d73ac75c385</source_hash>
                  <target_revision>91</target_revision>
                  <target_hash>00df938ff86618903e66857bda65c7ee5b73b3ee3dcf71cc06a195715a737cd9</target_hash>
                  <timestamp>2013-06-16 09:15:51</timestamp>
              </update>
          </updates>
          <result>Success</result>
          <current_api_version>1.1</current_api_version>
      </response>
      

      Get User Shares


      Description : Returns a list of files and folders that you have shared with others.

      Required Parameters


      Optional Parameters
      • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
      • contacts : Comma-separated list of contact keys by which to filter results (defaults to all contacts).
      • limit : Number of most recent shares to return (defaults to 100).
      • response_format : 'xml' or 'json' (default 'xml')

      Response:
      • contact_key : Key representing a user relationship.
      • display_name : Name or e-mail of the contact.
      • avatar : URI for the contact's avatar image.
      • resource :Quick key or folder key of the shared resource.
      • attributes : Bit 0 = folder; 1 = file.
      • permissions : Bit 0 = read; 1 = read + write; 2 = manage.

      • GET http://www.mediafire.com/api/1.1/device/get_user_shares.php
        POST http://www.mediafire.com/api/1.1/device/get_user_shares.php

        Response Properties
        • contact_key: Key of the contact with which the resource was shared
        • contact_type: ID of the type of the contact
        • contact_indirect: Whether the contact is indirect (a contact is indirect if you did not directly share your file with them): '0' or '1'
        • display_name: Name or e-mail of the contact
        • avatar: URI for the contact's avatar image
        • resource_key: Quickkey or folder key of the shared resource
        • attributes: Bit 0 = folder; 1 = file
        • permissions: Bit 0 = read; 1 = read + write; 2 = manage
        • result: Indicates if the API call was successful: 'Success' or 'Error'
        • current_api_version: The API version

        Error Responses From Supplying a Bad Session Token:
        • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
        • error: Error number for a supplying a bad session token: '105'

        Example:

        Request
        http://www.mediafire.com/api/1.1/device/get_user_shares.php?session_token=TOKENcontacts=1234567,7654321&limit=1
        
        Response
        <response>
            <action>device/get_user_shares</action>
            <shares>
                <share>
                    <contact_key>1234567</contact_key>
                    <display_name>Joe Blow</display_name>
                    <avatar>URI_FOR_AVATAR_IMAGE</avatar>
                    <resource_key>a123b456c7890</resource_key>
                    <attributes>2</attributes>
                    <permissions>2</permissions>
                </share>
            </shares>
            <result>Success</result>
            <current_api_version>1.1</current_api_version>
        </response>
        

        Share Resources


        Description : Share files and/or folders with specified contacts.

        Required Parameters

        • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
        • resources : Comma separated list of file or folder keys you wish to share.
        • contacts : Comma separated list of contact keys for whom you wish to share your resources.

        Optional Parameters
        • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
        • permissions : 1 (default) = read; 2 = read + write; 4 = manage.
        • message : Personal message to display in the share invitation.
        • fb_access_token : The Facebook Access Token of the Facebook user to send the message to (this must be obtained from Facebook).
        • tw_oauth_token : The Twitter OAuth Token of the Twitter user to send the message to (this must be obtained from Twitter).
        • tw_oauth_token_secret : The Twitter OAuth Token Secret Key (this must be obtained from twitter).
        • response_format : 'xml' or 'json' (default 'xml')


        GET http://www.mediafire.com/api/1.1/device/share_resources.php
        POST http://www.mediafire.com/api/1.1/device/share_resources.php

        Response Properties
        • device_revision: The revision number of the device
        • result: Indicates if the API call was successful: 'Success' or 'Error'
        • current_api_version: The API version

        Error Responses From Supplying a Bad Session Token:
        • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
        • error: Error number for a supplying a bad session token: '105'

        Error for providing a quickkey the user does not own:
        • message:'Access Denied
        • error:'114'
        Error for providing a contactkey that does not exist:
        • message: This contact does not exist
        • error: '138'

        Example:

        Request
        http://www.mediafire.com/api/1.1/device/share_resources.php?session_token=TOKEN&signature=SIGNATURE&resources=QUICKKEY,FOLDERKEY&contacts=1234567,7654321&permissions=2
        
        Response:
        <response>
            <action>device/share_resources</action>
            <result>Success</result>
            <current_api_version>1.1</current_api_version>
        </response>
        

        Unfollow Resource


        Description : Revokes the session user's permissions to a resource shared to the session user.

        Required Parameters


        Relative Parameters
        • signature : This is the call signature that is required to authenticate a type 2 session token transaction.

        Optional Parameters
        • contact : Contact key of the user you wish to terminate resource sharing. If not passed, all permissions to the resource for all contacts are revoked.
        • response_format : 'xml' or 'json' (default 'xml')


        GET http://www.mediafire.com/api/1.1/device/unfollow_resource.php
        POST http://www.mediafire.com/api/1.1/device/unfollow_resource.php

        Response Properties
        • device_revision: The revision number of the device
        • result: Indicates if the API call was successful: 'Success' or 'Error'
        • current_api_version: The API version

        Error Responses From Supplying a Bad Session Token:
        • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
        • error: Error number for a supplying a bad session token: '105'

        Error for providing a quickkey the user does not own:
        • message:'Access Denied
        • error:'114'

        Example:

        Request
        http://www.mediafire.com/api/1.1/device/unfollow_resource.php?resource=QUICKKEY_OR_FOLDERKEY&session_token=TOKEN&signature=SIGNATURE
        
        Response
        <response>
            <action>device/unfollow_resource</action>
            <device_revision>123</device_revision>
            <result>Success</result>
            <current_api_version>1.1</current_api_version>
        </response>
        

        Unshare Resource


        Description : Unshares the specified resource with all contacts or one specified contact.

        Required Parameters


        Optional Parameters
        • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
        • contact : Comma separated list of contact keys you wish to revoke sharing of a specified resource (default=all).
        • response_format : 'xml' or 'json' (default 'xml')


        GET http://www.mediafire.com/api/1.1/device/unshare_resource.php
        POST http://www.mediafire.com/api/1.1/device/unshare_resource.php

        Response Properties
        • device_revision: The revision number of the device
        • result: Indicates if the API call was successful: 'Success' or 'Error'
        • current_api_version: The API version

        Error Responses From Supplying a Bad Session Token:
        • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
        • error: Error number for a supplying a bad session token: '105'

        Error for providing a quickkey the user does not own:
        • message:'Access Denied
        • error:'114'
        Error for providing a contactkey that does not exist:
        • message: This contact does not exist
        • error: '138'

        Example:

        Request
        http://www.mediafire.com/api/1.1/device/unshare_resource.php?resource=QUICKKEY_OR_FOLDERKEY&session_token=TOKEN&signature=SIGNATURE
        
        Response
        <response>
            <action>device/unshare_resource</action>
            <result>Success</result>
            <current_api_version>1.0</current_api_version>
        </response>
        

        Unshare Resources


        Description : Unshares the specified resource with all contacts or one specified contact.

        Required Parameters


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


        GET http://www.mediafire.com/api/1.1/device/unshare_resources.php
        POST http://www.mediafire.com/api/1.1/device/unshare_resources.php

        Response Properties
        • device_revision: The revision number of the device
        • result: Indicates if the API call was successful: 'Success' or 'Error'
        • current_api_version: The API version

        Error Responses From Supplying a Bad Session Token:
        • message: Error message for supplying a bad session token: 'The supplied Session Token is expired or invalid'
        • error: Error number for a supplying a bad session token: '105'

        Error for providing a quickkey the user does not own:
        • message:'Access Denied
        • error:'114'
        Error for providing a contactkey that does not exist:
        • message: This contact does not exist
        • error: '138'

        Example:

        Request
        http://www.mediafire.com/api/1.1/device/unshare_resources.php?resource=QUICKKEY_OR_FOLDERKEY&session_token=TOKEN&signature=SIGNATURE
        
        Response
        <response>
            <action>device/unshare_resources</action>
            <device_revision>123</device_revision>
            <result>Success</result>
            <current_api_version>1.1</current_api_version>
        </response>