messaging.conversation

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
id (required)intMessage id

CREATE

ParametersTypeDescription
token (required)Valid token
subject (required)Message subject
message (required)Message text
group_receivers (required)Positions ids
individual_receivers (required)Employees ids
conversation (accepted)intConversation id

DELETE

ParametersTypeDescription
token (required)Valid token
mode (required)enum(inbox,sentbox)Type of message
inbox - received message
sentbox - sent message
messages (required)Messages ids

DOCUMENTATION

GET
Gets message with the given id.
Level 5 is required.

--

Example Request:

{
   "module":"messaging.conversation",
   "method":"GET",
   "request":{
			"id":4804711
   }
}

Example Response:

{
    "status": 1,
    "data": {
        "id": 4804711,
        "conversation": 4804630,
        "sender": 3999372,
        "sent": 1543921736,
        "deleted": 0,
        "subject": "test message subject",
        "message": "test message",
        "grouped": 1,
        "receivers": "{\"schedules\":[\"1837893\"],\"individuals\":[\"3999339\"]}",
        "read": 1543921748
    },
    "token": "xxxxxxx"
}

CREATE
Creates a new message.
If conversation id is being specified, a new message in the conversation is added. Group and individual receivers are same as in conversation, no matter what is sent via API request, but params have to be there. Else, a new message is being created.
Level 5 is required. An employee can create new messages, only if it is enabled in admin settings.

--

Example Request:

{
   "module":"messaging.conversation",
   "method":"CREATE",
   "request":{
			"subject":"Test",
      "message":"Message created via API",
      "group_receivers":"",
      "individual_receivers":"",
      "conversation":"4804630"
   }
}
{
   "module":"messaging.conversation",
   "method":"CREATE",
   "request":{
			"subject":"Test",
      "message":"Message created via API with receivers",
      "group_receivers":"1837938,1837893",
      "individual_receivers":"4443802,3999371"
   }
}

Example Response:

{
    "status": 1,
    "data": {
        "id": 4861946,
        "conversation": 4804630,
        "sender": "3999339",
        "sent": "12/25/2018 10:39",
        "deleted": null,
        "subject": "Test",
        "message": "<p>Message created via API</p>",
        "grouped": 1,
        "receivers": "{\"schedules\":[\"1837893\"],\"individuals\":[\"3999339\"]}",
        "read": null
    },
    "token": "xxxxxxx"
}
{
    "status": 1,
    "data": {
        "id": 4861954,
        "conversation": 4861954,
        "sender": "3999339",
        "sent": "12/25/2018 11:01",
        "deleted": null,
        "subject": "Test",
        "message": "<p>Message created via API with receivers</p>",
        "grouped": 1,
        "receivers": "{\"schedules\":[\"1837893\",\"1837938\"],\"individuals\":[\"4443802\",\"3999371\"]}",
        "read": null
    },
    "token": "xxxxxxx"
}

DELETE
Deletes messages with given ids.
Level 5 is required.

--

Example Request:

{
   "module":"messaging.conversation",
   "method":"DELETE",
   "request":{
			"messages":"4804880,4804882",
      "mode":"sentbox"
   }
}

Example Response:

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