Messages
GET Get/{leadId}
Returns the messages for the specified lead ID
[{
"id": "int",
"leadId": "int",
"bot": "bool",
"type": "string",
"message": "string",
"url": "string",
"createdOn": "DateTime",
"manual": "bool"
}]
Id: Message identifier
LeadId: Lead identifier
Bot: Whether the message was sent by the bot or by the lead.
Type:
"text"
"audio"
"video"
"image:
"document"
Message: Content of the message.
Url: When type is not "text" it contains the url of the media. Empty when type is "text".
CreatedOn: Moment when the message was sent.
Manual: Whether message was sent manually or by the bot.
POST Message/Send
This request can only be used when the lead has sent a message in the latst 24 hours. If you want to initiate a conversation, Message/SendTemplate must be used instead.
{
"leadId": "int",
"text": "string",
"type": "MessageType", //int
"url": "string"
}
//Returns a bool indicating whether the message was successfully sent or not
LeadId: Id of the lead to send the message to.
Text: Content of the message
MessageType:
Text = 1
Image = 2
Video = 3
Document = 4
Audio = 5
Url: When not sending a text message, this field should contain the url of the media to be sent.
POST Message/SendTemplate
This request should only be used when the lead has not sent any message in the last 24 hours.
NOTE: For Whatsapp, this request can take longer than expected since Meta verifies and approves the content of the message before sending it.
{
"leadId": "int",
"text": "string"
}
//Returns a bool indicating whether the message was successfully sent or not
LeadId: Id of the lead to send the message to.
Text: Content of the message
Last updated