Notifications1.1

Get Cache


Description : Gets and clears a specified number of the most recent cache-only notifications for the current user.

Required Parameters


Optional Parameters
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • start : Number of records to skip (default 0).
  • limit : Number of records to return (default 100).
  • response_format : 'xml' or 'json' (default 'xml')
Note: Calling this API will decrement the number of unviewed notifications appropriately.


GET http://www.mediafire.com/api/1.1/notifications/get_cache.php
POST http://www.mediafire.com/api/1.1/notifications/get_cache.php

Response Properties
  • num_older: Number of recent notifications
  • 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/notifications/get_cache.php?session_token=SESSION_TOKEN
Response:
<response>
    <action>notifications/get_cache</action>
    <notifications>
        <notification>
            <actor>CONTACT_KEY</actor>
            <timestamp>TIMESTAMP</timestamp>
            <message>Joe Blow granted access to file "test.jpg"</message>
            <resource>QUICKKEY</resource>
            <viewable>1</viewable>
        </notification>
    </notifications>
    <num_older>0</num_older>
    <result>Success</result>
    <current_api_version>1.1</current_api_version>
</response>

Example 2 (in JSON Format):

Request
http://www.mediafire.com/api/notifications/get_cache.php?response_format=json&session_token=0f9bff75f37d132cfe68c4dc25ab0174e0dba329263ea9e5414f181dae67e95cb3c4ccddfe56b43adb7781cf01fe0ec1f16d9d8723af0de326b4e7da47429f928146e90dfb16d8d3
Response:
{
  "response": {
    "action": "notifications/get_cache",
    "notifications": [
      {
        "actor": "wdpiatu",
        "timestamp": "1405469190",
        "resource": "e6wzpz7hkiwq3m7",
        "viewable": "1",
        "message": "Joe Blow granted access to file \"test.jpg\""
      }
    ],
    "num_older": "0",
    "result": "Success",
    "current_api_version": "1.1"
  }
}

Peek Cache


Description : Gets the number of cache-only notifications for the current user.

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/notifications/peek_cache.php
POST http://www.mediafire.com/api/1.1/notifications/peek_cache.php

Example:

Request
http://www.mediafire.com/api/1.1/notifications/peek_cache.php?session_token=SESSION_TOKEN
Response
<response>
    <action>notifications/peek_cache</action>
    <num_total>27</num_total>
    <num_unread>3</num_unread>
    <result>Success</result>
    <current_api_version>1.1</current_api_version>
</response>

Send Message


Description : Sends a generic message with a list of file and folder keys to one or more contacts.

Required Parameters


Optional Parameters
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • message : A user-specified text message.
  • message_template : Specifies the message template. 'standard' or 'access_request' (default 'standard').
  • fb_access_token : The Facebook Access Token of the Facebook user for whom you would like to send a message.
  • tw_oauth_token : The Twitter OAuth Token of the Twitter user for whom you would like to send a message.
  • tw_oauth_token_secret : The Twitter OAuth Token Secret Key.
  • response_format : 'xml' or 'json' (default 'xml')


GET http://www.mediafire.com/api/1.1/notifications/send_message.php
POST http://www.mediafire.com/api/1.1/notifications/send_message.php

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

Error Responses for Supplying a Bad Contactkey:
  • contackey: The contactkey you were attempting to send a message to
  • error: '-1'

Error Responses for Supplying a Bad Resourcekey:
  • contactkey: The contactkey you were attempting to send a message to
  • error: '-6'

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/notifications/send_message.php?session_token=SESSION_TOKEN
Response
<response>
    <action>notifications/send_message</action>
    <result>Success</result>
    <current_api_version>1.1</current_api_version>
</response>