Service

https://mci.crocodealer.com

Sending messages

Request

POST /v2/messages/send

{
"app":" →  Application IDstring","parent":" →  Parent message IDstring","sender": {  →  Sender detailsobject"name":" →  Sender namestring","phone":" →  Sender phonestring","email":" →  Sender emailstring"
},
"recepient": {  →  Recepient detailsobject"user":" →  Recepient IDstring","phone":" →  Recepient Emailstring","email":" →  Recepient Emailstring"
},
"subject": {  →  Message subject objectobject"title":" →  Message subject titlestring","field":" →  Message subject field name 'product'string","value":" →  Message subject field valuestring"
},
"message": {  →  Message dataobject"fields": [  →  An array with custom fieldsarray{"field":" →  Field namestring","title":" →  Field titlestring","value":" →  Field valuestring"}
],
"content":" →  Message contentstring!"
},
"files": [  →  An array with user filesarray{"name":" →  File namestring","action":" →  File action; 'update' to apply changes, 'insert' to upload a new file, 'delete' to delete filestring","order":" →  A file ordernal number. If this parameter is not set, the array index will be used as the ordernal number. Instead of the file array, an object may also be used where the keys are file ordernal numbersstring"}
],
"type":" →  Message type 'email','sms','push','task','chat','lead','review'string!","session":" →  User uthorization tokenstring!","visitor":" →  Visitor IDstring!"
}
Response
{
"status":" →  Status '1' - success or '0' - errorstring","message":" →  Request result messagestring","id":" →  Sent message IDstring","files":" →  Uploaded file name arrayarray"
}

Getting messages

Request

POST /v2/messages/read

{
"app":" →  Application IDstring","parent":" →  Dialog IDobject","type":" →  Message type 'email','sms','push','task','chat','lead','review'string!","subject": {  →  Message subject objectobject"field":" →  Message subject field name 'product'string","value":" →  Message subject field valuestring"
},
"session":" →  User uthorization tokenstring!","visitor":" →  Visitor IDstring!","start":" →  Start output positionstring","limit":" →  Оutput list lengthinteger"
}
Response
{
"status":" →  Status '1' - success or '0' - errorstring","message":" →  Request result messagestring","total":" →  Total number of messagesobject","messages": [  →  Message arrayobject{"id":" →  Message IDstring","parent":" →  Parent message IDstring","date":" →  Date the message was sentstring","sender": {  →  Sender detailsobject"id":" →  Sender IDstring","name":" →  Sender namestring"
},
"subject": {  →  Message subject objectobject"title":" →  Message subject titlestring","field":" →  Message subject field name 'product'string","value":" →  Message subject field valuestring"
},
"message": {  →  Message dataobject"fields": [  →  An array with custom fieldsarray{"field":" →  Field namestring","title":" →  Field titlestring","value":" →  Field valuestring"}
],
"content":" →  Message contentstring!"
}
}
],
"files": [  →  An array with user filesarray{"name":" →  File namestring","action":" →  File action; 'update' to apply changes, 'insert' to upload a new file, 'delete' to delete filestring","order":" →  A file ordernal number. If this parameter is not set, the array index will be used as the ordernal number. Instead of the file array, an object may also be used where the keys are file ordernal numbersstring"}
]
}