LeadML Messaging Verbs
Verbs are XML elements that describe operations that will be executed by LeadDesk. All the verbs will be executed sequentially as listed in the XML document.
Response
Not a verb itself, the LeadML application will respond with a valid XML Response containing one or more verbs that will be executed in order.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>
Example LeadML application
</Message>
</Response>
Message
The Message verb will reply with text you define. The message uses the address the original message was sent to as its sender address. That is to say, if you use the message verb to reply to a message that was sent to customer.service@example.com, the reply will be sent from customer.service@example.com.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>
Hello world!
</Message>
</Response>
Supported attributes
Name | Description |
---|---|
from | Supported for messages with type Email or SMS. Not supported for Facebook, LeadLink, or Webchat.
|
contentType | Supported for messages with type Email, Facebook, SMS or Webchat. Not supported for LeadLink.
If content type is text/html:
If content type is text/plain:
|
Supported nouns
Nouns are XML elements that can be used to enhance verbs with added functionality.
Button
Button noun will add a button to a message defined by the Message verb. There can be multiple buttons in one message. At least initially the buttons will only be used by the chatbot LeadML endpoint.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>
Message text
<Button payload="<intent_uuid_here>" href="http://leaddesk.com" target="_blank">
Button label text
</Button>
</Message>
</Response>
Supported attributes
Name | Description |
---|---|
payload | The next chatbot intent UUID |
href | (optional) Link URL. If defined, the button will be a link button. |
target | (optional) Link target (e.g. “_blank”) |
Redirect
The Redirect verb will cause the LeadML processing to jump the the next LeadML URL defined inside the Redirect element. The LeadML document from the redirect URL will be requested with the same parameters as the original request. The Redirect operation is permanent in the session scope. Any further messages received within the same session will be directly sent to the last redirected URL.
Redirect verb will stop LeadML processing for the current document and no verbs after the Redirect verb will be processed.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Redirect>
http://my.leadml.applicatio.comm/nextOperation
</Redirect>
</Response>
Supported attributes
None
Special destinations
In addition to http and https URLs, the Redirect verb also supports special LeadDesk destinations.
Name | URL format | Description |
---|---|---|
Omni Queue | leaddesk:queues/[queue-id]/campaigns/[project-id]/messages | Redirect message and session to Omni Queue. Project must be an inbound project. |
Omni Agent | leaddesk:users/[user-id]/campaigns/[project-id]/messages | Redirect message and session to Omni Agent. Campaign must be an inbound campaign. |
RewriteBody
The RewriteBody verb will cause the LeadML processing to change the current message body text for next steps. This is used to command ChatBot with specific keywords, for example. Should usually be combined with Redirect, in order to send LeadML to the intended destination.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<RewriteBody>rejoin</RewriteBody>
<Redirect>
https://my.leadml.applicatio.comm/nextOperation
</Redirect>
</Response>
Supported attributes
None
AssignContact
The AssignContact verb triggers the LeadML processing to assign a contact to the message and if specified a project to it as well. The element content should be the ID of the contact and the project ID is specified as the element attribute campaign_id.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<assigncontact campaign_id='1'>123456789</assigncontact>
</Response>
Name | Description |
---|---|
campaign_id | Optional. The ID of the project which the message should be associated with. |
MetaMessage
The MetaMesage verb triggers sending metadata Json information to Webchat connector (/api/messages/meta endpoint) from an XML response from a Chatbot or a Flows instance. The Json data will be sent to a webchat widget in the end. This verb can be used together with multiple Message verbs in a single Response.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message><p>Hello! I am RobBot - virtual assistant.</p></Message>
<Message><p>Default</p>
<Button payload="14067">Customer service</Button>
</Message>
<MetaMessage type="chatbot_meta" realtime="true" relatedMessage="">
<allow_delete_conversation>true</allow_delete_conversation>
<chat_status>virtual_agent</chatstatus>
<max_input_chars>110</max_input_chars>
<privacy_policy_url>https://example.com/privacy/ </privacy_policy_url>
</MetaMessage>
</Response>
Name | Description |
---|---|
type | This is the type of the metamessage. This may have any value, as long as the receiver understands it. In this example “chatbot_meta” would be recognised by the chatbot. |
realtime |
|
relatedMessage | Not currently in use. Could contain the UUID of a related message if communicating seen or read data about a message, for example. Intended for future development. If it is “” or does not exist, the property will not be sent. |
The remaining elements in this example meta message are values for initialising the chatbot widget, and are included only as examples. The precise content of your meta message will vary depending on where you are sending them, and what the receiver requires or expects.