messaging.message

Retrieve/Delete/Send individual messages.

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
id (required)integerMessage id

CREATE

ParametersTypeDescription
token (required)Valid token
subject (required)varcharMessage subject
message (required)varcharMessage body
to (required)integerReceivers id

DELETE

ParametersTypeDescription
token (required)Valid token
id (required)integerMessage id

UPDATE

ParmetersTypeDescription
token (required)Valid token
id (required)integerMessage id
read (accepted)enum [0,1]Is message read

0: Message is not read
1: Message is read

DOCUMENTATION

GET
Retrieves a specific message by id.
Level 5 is required

--

Example Request:

{
        "module":"messaging.message",
        "method":"GET",
        "request":{
           "id":"1928"
        }
     }

Example Response:

{
        "status":1,
        "data":{
           "id":"1928",
           "from":{
              "id":"3334",
              "name":"Alan Ford"
           },
           "to":{
              "id":"3334",
              "name":"Alan Ford"
           },
           "type":"1",
           "replyto":"0",
           "date_sent":"1339601203",
           "date_read":"0",
           "subject":"test",
           "message":"test",
           "message_formatted":"test",
           "date_sent_formatted":{
              "id":1141,
              "timestamp":1339545600,
              "month":6,
              "day":07,
              "year":2012,
              "week":24,
              "dayid":3,
              "weekday":"Tue",
              "mname":"Jun",
              "formatted":"Jun 07, 2017"
           },
           "date_read_formatted":[
 
           ]
        },
        "token":"xxxxxxx"
}

CREATE
Creates new message.
Level 5 is required

--

Example Request:

{
        "module":"messaging.message",
        "method":"CREATE",
        "request":{
           "subject":"subject",
           "message":"body",
           "to":"31256"
        }
     }

Example Response:

{  
    "status":1,
    "data":{  
        "id":"1929",
        "from":{  
            "id":"3334",
            "name":"Alan Ford"
        },
        "to":{  
            "id":"31256",
            "name":"Bob Rock"
        },
        "type":"1",
        "replyto":"0",
        "date_sent":"1339601203",
        "date_read":"0",
        "subject":"subject",
        "message":"body",
        "message_formatted":"test",
        "date_sent_formatted":{  
            "id":1141,
            "timestamp":1339545600,
            "month":6,
            "day":07,
            "year":2012,
            "week":24,
            "dayid":3,
            "weekday":"Tue",
            "mname":"Jun",
            "formatted":"Jun 07, 2017"
        },
        "date_read_formatted":[  

        ]
    },
    "token":"xxxxxxx"
    }

UPDATE
Updates message.
Level 5 is required

--

Example Request:

{
        "module":"messaging.message",
        "method":"UPDATE",
        "request":{
           "id":"1929",
           "read":"1"
        }
     }

Example Response:

{  
    "status":1,
    "data":{  
        "id":"1929",
        "from":{  
            "id":"3334",
            "name":"Alan Ford"
        },
        "to":{  
            "id":"31256",
            "name":"Bob Rock"
        },
        "type":"1",
        "replyto":"0",
        "date_sent":"1339601203",
        "date_read":"0",
        "subject":"new subject",
        "message":"new body",
        "message_formatted":"test",
        "date_sent_formatted":{  
            "id":1141,
            "timestamp":1339545600,
            "month":6,
            "day":07,
            "year":2012,
            "week":24,
            "dayid":3,
            "weekday":"Tue",
            "mname":"Jun",
            "formatted":"Jun 07, 2012"
        },
        "date_read_formatted":{  
            "id":1141,
            "timestamp":1359500400,
            "month":1,
            "day":30,
            "year":2013,
            "week":5,
            "dayid":4,
            "weekday":"Wed",
            "mname":"Jan",
            "formatted":"Jan 30, 2017"
        }
    },
    "token":"xxxxxxx"
 }

DELETE
Deletes message.
Level 5 is required (all users can fetch this module)

--

Example Request:

{
        "module":"messaging.message",
        "method":"DELETE",
        "request":{
           "id":"132"
        }
     }

Example Response:

{
        "status":1,
        "data":"",
        "token":"xxxxxxx"
     }