Before you start building a Zobot for your business, you need to know about the objects that are available inside the Zobot. This tip aims to give you an idea of the core objects that are found throughout the custom bot implementation. These objects serve as a guideline for input parameters and output response formats for the scripts used in the bots. The following are the actions that can be performed by the Zobot:
- Handling visitor chats
- Forwarding chats to humans
- Blocking a visitor
- Collecting inputs via Calendar
- Multiple input collection for one response, etc.
So, we'll take a look at all of these object one by one.
The request object is a map that contains the details of a request. You can retrieve details such as
- the request ID that is unique to each action
- the embed inside which the chat is going on
- the OS and browser used by the visitor
- the location of the visitor and
- the IP address of the visitor.
Syntax:
- {
- "id" : "4fhgtd-hbnjwj-hbewjd-gyywye6" ,
- "app_id" : "800009278986899",
- "os" : "Apple Macintosh",
- "browser" :"Apple Safari"
- "ip" : "127.89.077.12",
- "location" : {
- "country" : "US",
- "city": "Los Angeles",
- "state": "California",
- "lat" : "51.023",
- "long" : "12.34"
- }
- }
Then comes the visitor object which is a map that contains all of the profile information of the website visitor. Using this, you can get details like
- Name, email, phone, browser, IP address of the visitor
- URL of the page where the visitor is currently accessing
- Title of the visitor's current website page
- Count on number of past chats with the visitor
- Source from where the visitor is referred from
- Category and potential of the visitor in CRM and
- Custom information about the visitor.
The attachment is a collection object, which contains the files and the respective details of the file that were shared by the visitor during the conversation, as a message. It contains attributes like:
Each text message in the conversation between the Zobot and the visitor will be considered as the message object. It has two major attributes.
- text which is mandatory. This is the content of the conversation.
- And meta which is not a mandatory attribute. These are the details of the visitor message such as card data, type, etc
- Then, finally, we have the response object. This contains the output responses given by the bot during the conversation. It has four attributes.
- action - Action performed by the bot
- replies - The replies given by the bot for the particular action
- input - The input type displayed to the visitor by the Zobot
- suggestions - The response suggestions given by the Zobot to the visitor. When a response contains both input and suggestions, the Zobot will consider only the input and ignore the suggestions. Any interaction can have one type of input - either an input widget or free form text supported by suggestions.Also, you need to remember that visitors cannot enter any text manually when suggestions are displayed in the chat widget.
Note: Out of these four attributes, action and replies are mandatory ones.
To learn more about using objects, start building your own Zobot right away.
We also have Sample Scripts that use all of the response types mentioned above.
Regards,
Michelle