Notifications1.3

Get Cache


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

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

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:

  • 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.


Response Properties

Name Description Type Value
notification A collection of notifications ordered newest to oldest object
notifications -> actor The key of the contact whose action created the notification string
notifications -> timestamp The date and time the notification was created timestamp string
notifications -> resource The folder or file key that the action was applied to string
notifications -> message The description of the action that took place string
num_older Number of recent notifications integer
error The numerical error code integer
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
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 - limit):

Request
HTTPS://www.mediafire.com/api/notifications/get_cache.php?session_token=<token>&limit=5&response_format=json&signature=
Response:
{
   action: notifications/get_cache,
   notifications:[
      {
         actor: 26q5vh6,
         timestamp: 1423701783,
         resource: tip1zg4gbsz4k,
         message: Test 02 made changes to folder "Test 01",
      }
      {
         actor: 26q5vh6,
         timestamp: 1423701767,
         resource: tip1zg4gbsz4k,
         message: Test 02 made changes to folder "Test 01",
      }
      {
         actor: 26q5vh6,
         timestamp: 1423701509,
         resource: 354ziuhvffe29,
         message: Test 02 granted access to folder "Test 001",
      }
      {
         actor: 26q5vh6,
         timestamp: 1423700609,
         resource: tip1zg4gbsz4k,
         message: Test 02 granted access to folder "Test 01",
      }
      {
         actor: 26q5vh6,
         timestamp: 1423700603,
         resource: ,
         message: Test 02 revoked access to folder "Test 01",
      }
   ]
   num_older: 218,
   result: Success,
   new_key: yes,
   current_api_version: 1.3,
}

Example 2 (Success with JSON):

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": "#CURRENT_API_VERSION#"
  }
}

Peek Cache


GET http://www.mediafire.com/api/1.3/notifications/peek_cache.php
POST http://www.mediafire.com/api/1.3/notifications/peek_cache.php

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

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
num_total The total number of notifications in the list integer
num_unread The total number of notifications unread integer
last_timestamp The date and time of the most recently added notification string timestamp
error The numerical error code integer
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
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.3/notifications/peek_cache.php?session_token=SESSION_TOKEN
Response
Response:
<action>notifications/peek_cache</action> <num_total>223</num_total> <num_unread>0</num_unread> <last_timestamp>1423701783</last_timestamp> <result>Success</result> <new_key>yes</new_key> <current_api_version>1.3</current_api_version>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/notifications/peek_cache.php?response_format=json&session_token=0f9bff75f37d132cfe68c4dc25ab0174e0dba329263ea9e5414f181dae67e95cb3c4ccddfe56b43adb7781cf01fe0ec1f16d9d8723af0de326b4e7da47429f928146e90dfb16d8d3
Response:
{
  "response": {
    "action": "notifications/peek_cache",
    "num_total": "27",
    "num_unread": "3",
    "result": "Success",
    "current_api_version": "#CURRENT_API_VERSION#"
  }
}

Send Message


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

Note: This API requires SSL and is restricted. If you wish to enable this feature in your app, please contact customer service.
Description : Sends a generic message with a list of file and folder keys to one or more contacts.

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:

  • message : A user-specified text message.
  • message_template : Specifies the message template. 'standard' or 'access_request' (default 'standard').
  • response_format : 'xml' or 'json' (default 'xml')


Response Properties

Name Description Type Value
error The numerical error code integer 114
message The error description for the error string
deprecated Indicates this API is deprecated and should no longer be used string
result Indicates if the API call was successful. 'Error' or "Success' string
new_key For session token version 2, indicates whether the secret key has changed on the back end. 'no' (default) or 'yes'. Returned only to indicate a key change. yes/no flag
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.3/notifications/send_message.php?session_token=SESSION_TOKEN
Response
<response>
    <action>notifications/send_message</action>
    <result>Success</result>
    <current_api_version>#CURRENT_API_VERSION#</current_api_version>
</response>

Example 2 (Success with JSON):

Request
http://www.mediafire.com/api/notifications/send_message.php?contact_key=s32y7h54,r54d56g&keys=f04rjb4odlg5w7e,2pfo8n929b9vh7r&response_format=json&session_token=0f9bff75f37d132cfe68c4dc25ab0174e0dba329263ea9e5414f181dae67e95cb3c4ccddfe56b43adb7781cf01fe0ec1f16d9d8723af0de326b4e7da47429f928146e90dfb16d8d3
Response:
{
  "response": {
    "action": "notifications/send_message",
    "result": "Success",
    "current_api_version": "#CURRENT_API_VERSION#"
  }
}