If you are sending two messages in the same call, we strongly recommend that you use this object to mark a one-second pause between each message. This ensures that the messages are published in the correct order.
You can send a close conversation message such as:
Field
Description
Type
Required
Example
type
Type of the conversation object
String
✓
close
A conversations is automatically closed after 5 minutes if nothing happens in the conversation.
Transfer object
Transferring a conversation is quite straightforward. You can send the following messages:
The timeout object (in the transferOptions key) allows you to specify the period of time during which iAdvize will try to perform the transfer. If the timeout is reached and the transfer could not be performed, the scenario continues and iAdvize will display the following messages.
Field
Description
Type
Required
Example
type
Type of the conversation object
String
✓
transfer
distributionRule
Distribution/routing rule to transfer the visitor
UUID
✓
f1cfbc00-1272-4780-9482-6597f56b39c3
transferOptions.timeout.unit
Unit type
millis | seconds | minutes
✓
seconds
transferOptions.timeout.value
Delay value
Integer
✓
20
Example
In the following example, we send a transfer message and schedule a failed transfer message afterward.
If the transfer is successful, the next message for failed transfer is not published in the conversation.
If the transfer fails, the message is sent to the conversation. This way you can notify your user about it and continue the conversation.
Message object payloads
Several kinds of payloads can be used within your bot replies in order to enrich your responses. You will find in this section information about every type of content you can send with your iAdvize bot.
A generic card is a payload you can use to send a more structured message.
It always contains at least one link and can be used to help a visitor to navigate on a website by redirecting him to specific pages.
You can specify multiple links on a single generic card. Generic card can also include a title, a description and an image. This help give context to the visitor about the links you are sending.
Example 1: Generic one with title, text and picture
Example of a generic card with title, text and picture set
Example 2: Only text and links
Example of a generic card with several links
ProductOffer
A product offer payload lets you send a product offer to your visitor. Using the product offer you can showcase various attributes of your product such as the price, the photography of your product, the availability or a special offer. To show your visitors a carousel of product offers please see Product offer bundle
An attachment lets you send files directly in the chatbox. If you send an image it will be directly shown to the visitors if it is in a supported format by the visitor's browser. For a non-picture file it will offer the possibility to download it.
Field
Description
Type
Required
Example
type
Type of the conversation object
String
✓
message
payload
Payload described below
JSON Object
✓
see below
payload.contentType
Type of the message’s content
String file
✓
file
payload.fileName
Name of the file to be displayed
String
✓
Can I add more information about my order?
payload.mimeType
Mime type of the file
One of: image/gif, application/pdf, image/png or image/jpeg
Example 2: a picture directly shown in the conversation
Example of a picture payload
CardBundle
With the generic card bundle you can create a carousel for the visitor. Sliders are an efficient tool to present multiple services, offers or products to your visitors.
Example of a generic card with title, text and picture set
ProductOfferBundle
A product offer bundle is an efficient tool to showcase multiple products at one to your visitor. The visitor can navigate among the offers you sent using a slider.
Actions can be used to offers options to one visitor. Today, only link actions can be used. A link action is one action that can redirect one user to a given url link.
A quick reply is used for offering several choices to a visitor. Each choice needs to be specified in the "quickReplies" field of a reply. The answer sent by the visitor to the multiple choice question can only contain text. There is no maximum number of quick replies you can display. However we recommend not to use more than 3 quick replies for a single question.
Field
Description
Type
Required
Example
contentType
Type of the message’s content
text/quick-reply
✓
text/quick-reply
value
Textual content of the quick-reply
String
✓
Yes
Example
Example of a text payload reply with two quick replies
{
"type": "message",
"payload": {
"contentType": "text",
"value": "Hi, i am a simple message."
}
}
{
"type": "message",
"payload": {
"contentType": "card/content",
"image": {
"url": "http://image.net/delivery.jpg",
"description": "delivery picture"
},
"title": "Delivery & Pickup",
"text": "Learn more about dispatch and delivery times, methods and costs.",
"actions": [
{
"type": "LINK",
"name": "See more",
"url": "http://mylink.com/delivery"
}
]
}
}
{
"type": "message",
"payload": {
"contentType": "card/content",
"actions": [
{
"type": "LINK",
"name": "How to print on an A4 page",
"url": "http://mylink/a4page"
},
{
"type": "LINK",
"name": "I could not print my stamps",
"url": "http://mylink/stamps"
},
{
"type": "LINK",
"name": "What are the different support and formats for etiquette?",
"url": "http://mylink.com/etiquette"
}
]
}
}
{
"type": "message",
"payload": {
"contentType": "file",
"fileName": "Can I add more information about my order?",
"mimeType": "application/pdf",
"url": "http://my-website.com/order.pdf"
}
}