Answers
Chatbot elements
Core elements

Core Elements

Core elements are channel independent. These elements are present in the Chatbot receivesChatbot actions, and Infobip products sections in the chatbot editor.

To view elements that are specific to a channel, refer to the Channel elements section.

API

Use the API element to retrieve information from external systems and send information to these systems through your chatbot.

The element contains request and response parameters.

Request

Go to the Request tab and complete the following fields.

Method

Choose one of the following API methods.

  • Get
  • Post
  • Put
  • Delete
  • Patch
  • Head
Request method

URL

Enter the base URL of your external system, along with the required endpoint. You can include placeholders.

The following is an example of a base URL. Do not use it in your code.

https://example.infobip.com/sms/2/text/advanced (opens in a new tab)

where https://example.infobip.com (opens in a new tab) is the base URL used in the send SMS endpoint.

Request URL

Enable escaping of URL parameters

Select this field if your base URL contains attributes that have one or more of the following:

  • Non-ASCII characters
  • Reserved characters
  • Characters that are unsafe by web standards

Selecting this field replaces these characters.

Example: The base URL has parameters that return an empty space. Enabling the escape option escapes that character and returns a valid URL.

​​​​​​​Include certificate in API request

TLS certificates are standard certificates used by web browsers to ensure a safer internet experience. End users are likely to trust websites that are secured by TLS certificates because they encrypt the communication between the web applications and servers, such as web browsers that load a website.

To include a TLS certificate in the API request, you first need to set up the certificate. To do so, contact the Infobip Support team.

After you set up the certificate, select Include certificate in API request, to include it in the API request.

Content type

Specify the type of content for the request header. Example: Choose JSON to indicate that the request data is sent in JSON format.

Request content type

Depending on the content type that you choose, the header and body are as follows:

Content-typeDescriptionHeaderBody
NoneSelect if your API has only a header and does not have a body.No predefined key-value pair.Option to create key-value pairs.N/A
RawUse for unstructured requests. Example: Requests that contain only numbers or blocks of texts. Also, use for custom content types that are not available on the predefined list. Example: text/xml. For custom content-type header, manually enter the required content-type header.No predefined key-value pair.Option to create key-value pairs.Editor
JSONapplication/json: Select for most REST API calls.Predefined key-value pair. (Content-Type, application/json)Option to create key-value pairs.Key-value pairEditor
Texttext/plain: The content is in a human-readable format.Predefined key-value pair.(Content-Type, application/json)Option to create key-value pairs.Editor
XMLapplication/xml: The content format is intended for computers.Predefined key-value pair.(Content-Type, application/json)Option to create key-value pairs.Editor
URL-encodedapplication/x-www-form-urlencodedPredefined key-value pair.(Content-Type, application/json)Option to create key-value pairs.Key-value pair
Form Datamultipart/form-data: Use when sending binary (non-alphanumeric) data or a large sized payloadPredefined key-value pair.(Content-Type, application/json)Option to create key-value pairs.Key-value pair

Headers (Optional)

Use the request header to provide information about the request so that the server can customize the response. Example: Use the Accept-Encoding header to specify the required encoding for the response.

This metadata is specified in key-value pairs of parameters and is sent along with the request. For some content types, the key-value pair has a predefined value that specifies the type.

Default key-value pair

If you need additional values in your header, do the following:

  1. Click Add key-value pair.
  2. In the Key field, select the required criterion from the list. Example: Accept-language.
  3. In the Value field, enter the value. You can also add an attribute that contains the value.
Request header - key-value pair

If a key-value pair is not in the list, do the following to add the values that you need for your API call.

  1. Click Add key-value pair.
  2. In the Key field, select Enter custom.
  3. Enter the name of the key.
  4. Click the checkmark.
  5. In the Value field, enter the value. You can also add an attribute that contains the value.
Choose key value pair
Note

You cannot add multiple key-value pairs that have the same key. Example: You cannot add two key-value pairs that have the Accept-language key.

Body (Optional)

Specify the body of the API call. Depending on the content type, you can use a Key-value pair and/or the Editor.

Key-value pair: To add a key-value pair, do the following:

  1. Click Add key-value pair.
  2. In the Key field, enter the required criterion. Example: Language. You can also add an attribute that contains the key.
  3. In the Value field, enter the value. You can also add an attribute that contains the value.
Note

You cannot add multiple key-value pairs that have the same key. Example: You cannot add two key-value pairs that have the Language key.

Editor: Specify the text to include as the body of your request.

Response

Responses to API calls are saved in attributes.

For information about saving any XML files that you receive, refer to the how to section.

To save the response that you expect to receive, go to the Response tab, and complete the following fields.

Save response code to attribute (Optional)

To save response types to your APIs, do the following:

  1. Create an attribute.
  2. Select the attribute from the Save response code to attribute list.

Response headers attributes

To save the response header to an attribute, do the following:

  1. Create one or more attributes to save the response header.
  2. Select Add attribute.
  3. In the Attribute field, select the attributes from the list.
  4. In the Header name field, enter the name of the header. This field is not case sensitive.

Response body attributes

When you expect values in the return body of your API call and want to save them, do the following:

  1. Create one or more attributes to save the response body.
  2. Select Add attribute.
  3. In the Attribute field, select the attributes from the list.
  4. In the Path field, enter the path to the attribute. The path is the location in the JSON file hierarchy where the value of that attribute is located. Depending on the level where the attribute is located, include all the previous levels separated by a dot “ .” in the attribute path.

Timeout

Specify how long you want to wait for the response. The minimum value is 1 second and the maximum value is 60 seconds. The default value is 10 seconds.

SOAP API calls

SOAP API calls can be sent only in XML format. There can be only one root element, which acts as the envelope, in the file.

Most SOAP APIs use Web Service Definition Language (WSDL (opens in a new tab)). WSDL defines the structure of the xml. Example: Whether an element or attribute can appear multiple times, whether it is required or optional, and the order of the elements. If the service with which you are interfacing has a WSDL, it will be easier to connect with it.

SOAP calls accept the values of text, xml, and xml list. Choose the format depending on how you want to use the values later in the Code element. Example: Whether there are xml tags that you want to extract from the response you receive.

Request

You can write XML for SOAP API calls in the following ways:

Content typeHeaderWhen to use
RawKey: Content-Type
Value: text/xml
If end user can read the source xml document
XMLPredefined header (Key: Content-Type, Value: application/xml)All other cases

Response

SOAP response xml follows the same logic as the incoming request. In case of an error, the xml contains the message details.

SOAP versus REST API

Consider using REST communication protocol for the following reasons.

  • SOAP APIs are slower and more complex than REST APIs.
  • SOAP APIs can handle only XML files.
  • SOAP APIs do not cache information.

Attribute

Use the Attribute element to capture information from end users and save this information in attributes. You can then use the attribute value to do various things such as branching the flow.

For an example of how to use the Attribute element, refer to the How attributes work documentation.

Attribute element

To add an Attribute element to the chatbot, in the chatbot editor, drag the element from the Chatbot receives section.

In the element, configure the following fields.

Skip question if attribute is not empty

In some cases, the attribute that you select in the Attribute element might already have a value. Example: Your NER-enabled chatbot already captured this information from a different message, or the end user already sent you the required information in a different message.

If you do not want to overwrite the attribute value, select the Skip question if attribute is not empty field. If you select this option, the chatbot sends the message in the Message field only if the attribute is empty.

Message

Enter the message that asks the end user for information. Example: Specify the order ID.

The message can contain a maximum of 4.096 characters including spaces, special characters, new line, emojis, and attributes.

Note

If you add the Attribute element after a button, reply, or quick reply, leave the Message field empty. The postback value from the button, reply, or quick reply will be used as the user response and saved in the attribute.

To add variations of the message, select Add variation. You can create a maximum of 5 variations. The chatbot randomly selects one of these messages to send to the end user.

Link preview

Set whether the end user can see a preview of links that you share in the Message field. This field is available only if the chatbot uses the WhatsApp channel.

Save answer to

Save the response from the end user in an attribute.

Do one of the following.

  • If you have already created the attribute, select the attribute.
  • Create a new attribute.

Enable custom validation

You can use regex to check, match, or validate the attribute value. Example: Check if the attribute value contains a phone number.

Select Enable custom validation. In the Validation regex pattern field, enter the regex pattern.

The validation supports Basic regular expressions (BRE) standard.

Repeat message

If the end user sends an invalid response to your message, the chatbot needs to know what to do.

Use the Repeat option to ask the end user to send the response again. This option repeats the message from the Message field.

How many times to repeat the message

Choose the number of times to repeat the message. You can repeat the message a maximum of 3 times. The default value is No repeat.

If the end user still does not send the correct response, the Fallback action is triggered.

Message content (Optional)

Send a message to the end user asking them to resend their response. Example: Sorry, I did not understand that. Please try again.

Link preview

Set whether the end user can see a preview of links that you share in the Message content field. This field is available only if the chatbot uses the WhatsApp channel.

Configure Repeat

Fallback

If the end user sends an incorrect response or the message sending fails, Fallback option is triggered.

Fallback action

Specify the action that the chatbot needs to take when fallback is triggered. You can either transfer the chat to an agent (Connect to agent) or send the end user to another dialog (Go to dialog).

Dialog

If the Fallback action is Go to dialog, choose the relevant dialog. Example: You can go back to the default dialog, the menu dialog, or the closing dialog.

Fallback message (Optional)

Send the end user a message when to inform them that there is an issue. Example: Sorry, I did not understand that. I am taking you to the main menu.

The message can contain a maximum of 4.096 characters including spaces, special characters, new line, emojis, and attributes.

To add variations of the message, select Add variation. You can create a maximum of 5 variations. The chatbot randomly selects one of these messages to send to the end user.

Link preview (Optional)

Set whether the end user can see a preview of links that you share in the Fallback message field. This field is available only if the chatbot uses the WhatsApp channel.

Configure fallback

Timeout

In some cases, the chatbot waits for a long time for the end user to provide a response. You can configure a timeout for such situations.

If the end user does not respond to your message within a specified time duration, you can choose to take actions such as directing the end user to the main menu or transferring them to an agent.

Enable Timeout and configure the following fields.

Minutes

Set the time the chatbot needs to wait for a response from the end user.

Note

The timeout duration must be less than the session timeout duration.

Timeout action

You can either transfer the chat to an agent (Connect to agent) or send the end user to another dialog (Go to dialog).

Dialog

If the Timeout action is Go to dialog, choose the relevant dialog. Example: You can go back to the default dialog, the menu dialog, or the closing dialog.

Timeout message (Optional)

Send the end user a message when to inform them that there is an issue. Example: Sorry, I have not received a response from you.

The message can contain a maximum of 4.096 characters including spaces, special characters, new line, emojis, and attributes.

To add variations of the message, select Add variation. You can create a maximum of 5 variations. The chatbot randomly selects one of these messages to send to the end user.

Link preview

Set whether the end user can see a preview of links that you share in the Timeout message field. This field is available only if the chatbot uses the WhatsApp channel.

Configure timeout

Authentication

The Authentication element is only available for the Authentication dialog and is used to trigger authentication at the end of authenticated dialog flows.

Set up a secured chatbot using authentication

Close Session

Use this element to terminate the entire session. This element is not configurable and only works by ending the chat with the end user when they reach this stage of the conversation.

If the user continues to talk with a chatbot that has closed the session, the chatbot will treat it as a new session and will start afresh.

It requires no configuration – but bear in mind that when you add it to the dialog, the element will finish the conversation between the end user and the chatbot. In case the user wants to continue talking with the bot, they will have to start the conversation from the beginning.

Code

Coding element gives you more flexibility when designing a dialog and what you can do with attribute values, and also provides encryption capabilities.

Currently, two classes are available:

  • attributeAPI which enables you to work with the attributes in the platform using the following functions:

  • GET

  • SET

  • encryptionUtils which currently supports the following hash functions:

  • MD5

  • SHA-1

  • SHA-256

  • SHA-512

Note

Use JavaScript when writing the code.

You can use the element for the following:

  • randomization of available information
const items = [1, 2, 3, 4, 5];
const item = items[Math.floor(Math.random() * items.length)];
attributeApi.set('random', item);
  • Usage of counters (can be followed by the Conditions element to branch the results)

let correct = attributeApi.get('correct');
correct = correct == null ? 1 : (correct + 1);
attributeApi.set('correct', correct);

  • Transfer of large json files into variables (for easier manipulation of attributes)

const qa = attributeApi.get('qa');
let answers = [...qa.incorrect_answers, qa.correct_answer];
answers.sort();
 
const answerId = answers.findIndex(a => a === qa.correct_answer);
 
attributeApi.set('answers', answers);
attributeApi.set('answerId', String(answerId + 1));

  • Secure hashing of attributes
const encryptedMd5 = encryptionUtils.md5('test');
const encryptedSha1 = encryptionUtils.sha1('test');
const encryptedSha256 = encryptionUtils.sha256('test');
const encryptedSha512 = encryptionUtils.sha512('test');
Coding element with sample code

The Answers platform compiles and validates whether the code syntax is correct (will not display where the error occurs). The validation happens at the moment you activate the bot and an error will occur in case validation fails.

const encryptedMd5 = encryptionUtils.md5('test');

const encryptedSha1 = encryptionUtils.sha1('test');

const encryptedSha256 = encryptionUtils.sha256('test');

const encryptedSha512 = encryptionUtils.sha512('test');

const qa = attributeApi.get('qa');

let answers = [...qa.incorrect_answers, qa.correct_answer];

answers.sort();

const answerId = answers.findIndex(a => a === qa.correct_answer);

attributeApi.set('answers', answers);

attributeApi.set('answerId', String(answerId + 1));const encryptedMd5 = encryptionUtils.md5('test');
const encryptedSha1 = encryptionUtils.sha1('test');
const encryptedSha256 = encryptionUtils.sha256('test');
const encryptedSha512 = encryptionUtils.sha512('test');

Note

If you want to see examples of coding for some chatbot use cases, check theCode in Coding element.

Conditions

Use the Conditions element to branch the end user's journey based on specific conditions.

Conditions can be based on the following:

  • End user's response. Example: Depending on the option that the end user selects, the chatbot takes the relevant action.
  • Internal events. Example: If the chatbot is successful in updating the Person profile in People, it takes a specific action. If the chatbot is not successful, it takes a different action.

The Conditions element uses attributes to evaluate the conditions. The chatbot checks whether the attribute value matches the value specified in the condition.

The Conditions element contains multiple conditions. After you configure the element, you can specify the action that the chatbot needs to take for each condition.

In the following example, depending on the end user's response, they are directed to the relevant dialog.

Example of using the Conditions element

Add a Conditions element to the chatbot

Guidelines

  • You can add only one Conditions element to a dialog.
  • The element has an inbuilt Else condition. You cannot remove or rename this condition.
  • You must add a minimum of 1 condition in addition to the inbuilt Else condition.
  • Add as many conditions as required to branch the conversation.

Add the Conditions element

In the chatbot editor, drag the Conditions element from the Chatbot Actions section.

Do the following for each condition within the element.

  1. Select the attribute that contains the information to evaluate. You can select one of the following:

    • Use a predefined attribute. Use this option when you want to validate internal events.
    • Use an existing standard or NER attribute.
    • Create a new standard or NER attribute.
  2. Specify the operator. The available operators depend on the attribute type. Example: If an attribute is Boolean, only is and is not are available.

  3. Specify the value against which the attribute needs to be matched. You can also select another attribute in this field. The operators is null and is not null do not require any value.

  4. To evaluate the attribute against multiple values, select And and Or.

For more information about how attribute values are validated in the Conditions element, refer to the Attribute validation documentation.

Example

Simple condition

In the following example, a standard attribute solution is matched against the value Conversations by using the operator is.

The condition is (solution is Conversations).

Example of a simple condition

Condition that uses OR operator

In the following example, the OR operator is used to include multiple criteria within the same condition. If one of the criteria is met, the chatbot takes the relevant action for this condition.

The condition is (solution is Moments OR solution is Broadcast).

Example of using the OR option in a condition

Condition that uses AND operator

In the following example, the AND operator is used to include multiple criteria within the same condition. If both the criteria are met, the chatbot takes the relevant action for this condition.

The condition is (solution is Answers AND channel is WhatsApp).

Example of using the AND option in a condition

Condition that uses OR and AND operators

In the following example, both AND and OR operators are used to include multiple criteria within the same condition.

The condition is ((channel is Messenger AND solution is Answers) OR (channel is Viber AND solution is Answers)).

Example of using both OR and AND options in a condition

Delete a condition

To delete a condition, select the three dots and select Delete.

How to delete a condition

Remove all conditions

Select Remove all conditions.

How to remove all conditions

Delete criteria within a condition

You can delete a specific criterion within the condition.

Example: The condition shown in the following image is (solution is Moments OR solution is Broadcast). You can remove one of the criteria, solution is Broadcast, without deleting the other criteria in the condition.

Select the Delete icon.

How to delete a specific criterion within a condition

Duplicate a condition

To duplicate a condition, select the three dots and select Duplicate.

How to duplicate a condition

Reorder conditions

Select the six dots in front of the condition name and drag the condition to the required location.

How to reorder conditions

Rename a condition

Select the pencil icon next to the name of the condition.

How to rename a condition

Add the name and select the checkmark.

How to save changes when you rename a condition

Next steps

Specify the next step for each condition by adding Answers elements to the conditions.

The following are examples of the next steps.

  • Send a message to the end user through channel-specific elements. Example: If the end user input matches the value Yes, send a Thank you message to the end user.
  • Use the To dialog element to direct the end user to the relevant dialog.
  • Use the Attribute element to save the result of a validation. Example: If the end user input matches the value Yes, update the OptInObtained attribute to True.
  • Update databases. Example: If the end user's phone number has changed, use the People profile element to add the phone number in People.
Add elements to each branch of the condition element

Guidelines

  • Add a minimum of 1 element and a maximum of 2 elements for each condition, including Else.

  • You can add some elements only in a specific, logical order.
    Example:

    • You cannot add some core elements, such as the Attribute element, after a channel-specific element, such as Text.
    • You cannot add some core elements, such as the To dialog element, before a channel-specific element, such as Text.
  • You cannot add 2 channel specific elements to the same condition. Example: You cannot add 2 Text elements, or a Text element and an Image element.

  • You cannot add the following core elements.

    • User input
    • AI assistant
    • Another Conditions element
  • For AI chatbots, if you do not add theTo dialog element, the NLP engine resolves the intent of the end user's message and directs the flow to the relevant dialog.

CSAT survey

Use customer satisfaction surveys to gather feedback from the end user about the service they received through the chatbot. End users can provide a numeric score and provide comments. You can then use this feedback to optimize the chatbot.

Use the CSAT survey element to obtain feedback.

To configure this element, complete the following fields.

Scoring question

Scoring scale

Use a scoring scale for end users to rate your product, service, or business.

Choose one of the following scales.

  • 1-2
  • 1-5
  • 1-10

Answers uses the following logic for the CSAT scores:

  • 1 - 2 scale: 1 = negative | 2 = positive
  • 1 - 5 scale: 1 to 3 = not satisfied | 4 to 5 = satisfied
  • 1 - 10 scale: 1 to 6 = not satisfied | 7 to 10 = satisfied
Scoring scale

Scoring question message

Add a message for the end user. Example: You can request them to provide a score or guide them with the scoring logic.

The message can contain a maximum of 4,096 characters, including spaces, special characters, new line, emojis, and attributes.

Repeat count

In case you do not receive a valid response from the end user, the chatbot sends the scoring question message again.

This field has a predefined value of 1.

Fallback message

The message that the chatbot sends in case in case the end user enters an invalid response or performs an unknown action.

The message can contain a maximum of 4,096 characters including spaces, special characters, new line, emojis, and attributes.

Note

If the end user does not respond to the survey, it times out after 5 minutes.

Feedback question (Optional)

Send a message to the end user asking them for additional feedback or information.

The chatbot sends this message after the end user sends a valid response to the scoring scale. Whereas the end user's response to the scoring scale is a numeric value, the response to the feedback question message is text.

The feedback question message can contain a maximum of 4,096 characters including spaces, special characters, new line, emojis, and attributes.

Thank you message (Optional)

Send a message to the end user thanking them for providing feedback. This message is also an acknowledgement that the chatbot has received the survey response.

The chatbot sends this message when end users complete the CSAT survey.

The message can contain a maximum of 4,096 characters including spaces, special characters, new line, emojis, and attributes.

Thank you message

Next steps

  • If you add the CSAT survey element to a standard dialog, add the Close session element after the CSAT survey element, to close the session.
  • If you add the CSAT survey element to the Session Expire dialog, you do not need to do anything else.

Guidelines and best practices

Add the CSAT survey element to the Session Expire dialog.

Analytics

You can view CSAT analytics in the User analytics.

If you have advanced analytics (Early access), you can view CSAT analytics in the following sections:

Delay

Use the delay element to add as long or as short pauses as desired to mimic the natural tempo of talking to a human. Delay simply adds a pause between elements.

Insert the delay between any elements where it would fit in a normal conversation, and set the delay time in seconds.

People Custom Event

Use the People Custom Event element to pass an event from Answers to People. You can save the event in the specified person profile. You can then use the event information when the end user interacts with your chatbot again or use the information in other Infobip solutions.

Drag the People Custom Eventelement from Infobip products. Complete the following information.

Contact information

You need to specify the Person profile in which you want to save the event.

Contact information attribute : In this field, select the Answers attribute that contains the end user's contact information. You can select one of the following:

  • The predefined attribute, endUserDestination. The attribute value is automatically obtained through the chatbot session.
  • A standard attribute that you create. Example: phoneNumber. Use other chatbot elements to get the contact information from the end user and save it in this attribute.

The attribute value is matched with the attribute in the person profiles in People. If a match is found, the custom event is added to the corresponding person profile.

Configure the contact information

Contact information attribute type: Select the attribute type. Make sure this field matches the data type of the attribute that you selected in the Contact information attribute field. You do not need to configure this field if you selected endUserDestination in the Contact information attribute field.

Answers supports the following field values: Phone Number, Email, Internal ID, External ID, Push registration ID, and channel-specific IDs, for example, Facebook ID.

Custom events

In the Custom events section, specify the event that will be saved against the Person profile.

Do the following:

  1. Select Add custom event.

    Add custom event
  2. Either create a new event in People or select an existing event from People. Example: AddedToCart.

    Map Answers and People
  3. (Optional) To add properties to the event, select Add attribute mappings. For each attribute, do the following.

    Add the mapping
  4. Choose the Answers attribute that contains the event properties. Example: addedCart, productID, productName, and productPrice.

    Map the Answers attribute
  5. Choose an equivalent event property, which you created for the event in People. Example: addedCart, productID, productName, and productPrice. Make sure that the Answers attribute type and People event property are compatible.

    Answers does not support dateTime property. If you want to pass a dateTime value into an event, save the value in a Text attribute in your chatbot and map the attribute to a Text property type.

    Map the People property
  6. Select Add.

For more information about using the People Custom Event element in your chatbot, refer to the Custom Events in People documentation.

People profile

When end users contact your chatbot, you might want to store information about them in People or use existing information about them, which you have stored in their profiles in People, during the conversation.

Use the People profile element in Answers to share information between Answers and People. You can do the following:

  • Update existing profiles in People. Example: If the end user shares their email address during their conversation with the chatbot, you can save this information in their profile in People.
  • Create a new profile in People and add information to it. Example: If a new end user shares their email address during their conversation with the chatbot, you can create a profile in People and save the email address to the profile.
  • Get information from an existing profile in People. You can then use this information in your chatbot flow. Example: You can use the information to personalize the conversation or to authenticate the end user,

To use the People profile element in a chatbot, drag the element from Infobip products. Complete the following information:

Select action

Select one of the following:

  • Get information: Gets the value of a People attribute from the selected profile and saves it in an attribute in Answers.
  • Create or update person profile: Saves the value of an Answers attribute in a People attribute in the selected profile. If the profile does not exist, creates a new profile in People and then saves the value of the Answers attribute in a People attribute.

Contact information

You need to specify the Person profile to which you want to save or retrieve information.

Contact information attribute : In this field, select the Answers attribute that contains the end user's contact information. You can select one of the following:

  • The predefined attribute, endUserDestination. The attribute value is automatically obtained through the chatbot session.
  • A standard attribute that you create. Example: phoneNumber. Use other chatbot elements to get the contact information from the end user and save it in this attribute.

The attribute value is matched with the attribute in the person profiles in People. If a match is found, the information is added to or retrieved from the corresponding person profile.

Configure the contact information

Contact information attribute type: Select the attribute type. Make sure this field matches the data type of the attribute that you selected in the Contact information attribute field. You do not need to configure this field if you selected endUserDestination in the Contact information attribute field.

Answers supports the following field values: Phone Number, Email, Internal ID, External ID, Push registration ID, and channel-specific IDs, for example, Facebook ID.

Configure the contact information

Map attributes

The People profile element uses attributes to share information between Answers and People.

So, for the selected profile, you need to map attributes in Answers to attributes in People. Make sure that the attribute types are compatible with each other.

  1. Select Map attributes.

    Map attributes
  2. For each attribute that you want to map, do the following:

  3. In the Person attribute section, select the attribute from People.

    Map the People attribute

    You can select a predefined attribute, custom attribute, predefined destination (last contacted) attribute, or computed attribute. If the Select action field is Create or update person profile, you cannot select a computed attribute.

    Map the People attribute
  4. Select an attribute in Answers. You can select either a standard attribute or a predefined attribute. If the Select action field is Get information, you can select only a standard attribute.

    Map the Answers attribute
  5. Select Save.

For more information about using People attributes in your chatbot, refer to the Attributes documentation.

For more information about using the People profile element in your chatbot, refer to the Create a People chatbot documentation.

People tags

When end users contact your chatbot, you can use tags that are present in their person profiles in People to take the relevant action.

Example: The tag for an end user's profile is purchased Moments product. When the end user contacts your chatbot, you can ask them if they want help with the Moments product.

Use the People tags element in Answers to update tags in People.

To use the People tags element in a chatbot, drag the element from Infobip products. Complete the following information:

Select action

Select one of the following:

  • Add tags: Add existing tags to a profile or create new tags.
  • Get tags: Verify whether the specified tags are present in a profile.
  • Remove tags: Remove tags from a profile.

Contact information

You need to specify the Person profile for which you want to add, remove, or get tags.

Contact information attribute : In this field, select the Answers attribute that contains the end user's contact information. You can select one of the following:

  • The predefined attribute, endUserDestination. The attribute value is automatically obtained through the chatbot session.
  • A standard attribute that you create. Example: phoneNumber. Use other chatbot elements to save the contact information in this attribute.

The attribute value is matched with the attribute in the person profiles in People. If a match is found, the tags are added, removed, or obtained from the corresponding person profile.

Configure the contact information

Contact information attribute type: Select the attribute type. Make sure this field matches the data type of the attribute that you selected in the Contact information attribute field. You do not need to configure this field if you selected endUserDestination in the Contact information attribute field.

Answers supports the following field values: Phone Number, Email, Internal ID, External ID, Push registration ID, and channel-specific IDs, for example, Facebook ID.

Configure the contact information

Add existing or create new tags

In the Select tags to add field, select existing tags or create new tags. You can add multiple tags.

To create a new tag, do the following:

  1. Select Create new tag.
  2. Type the name of the tag and select the checkmark. Create new tag

Remove tags

In the Select tags to remove field, select one or more tags.

To remove all the tags from the profile, select Remove all tags from person.

Select tag from list

Get tags

If a specified tag is present in the person profile, the value of the selected Answers attribute is True. Otherwise, the value is False.

  1. Select Map tags.

    Map tags
  2. Do the following for each tag that you want to verify whether it is present in the profile.

  3. Select Add tag mapping.

    Add tag mapping
  4. In the People tag field, select the People tag that you want to verify.

    Select People tag
  5. In the Chatbot attribute field, either select an attribute or create a new attribute to save the result of the verification. You can only use a Boolean attribute.

    Select Answers attribute
  6. Select Save.

Validate status of profile update

Use the lastPeopleStatusCode predefined attribute to verify whether the tags were updated successfully. You can then take the relevant action.

Example: Use the Conditions element to direct the flow to the relevant dialog.

Validate People status change

To Agent

When there are complex questions or requests that the chatbot cannot manage, use the To Agent element to transfer the chat to a human agent.

Example: The chatbot is not designed or trained to answer a specific question, or the chatbot cannot understand the end user's message.

You must have one of the following enabled to use this element.

When you redirect to an agent, the agent takes over the chat. Chats cannot be sent back to the chatbot.

Tags

Add tags to the conversation to route the support request or chat to the right queue in Conversations and external contact center solutions.

Example: If you add the tag account_management, the request is routed to the account_management queue in Conversations.

Create a tag

  1. In the All tags section, click Create tag. Create a tag
  2. Type the name of the tag. Add a name for the tag

Add a tag to the conversation

In the All tags section, select one or more tags to add to the conversation. The selected tags are displayed in the Selected conversation tags section.

Add a tag to a conversation

To Dialog

Use this element when you are ready to send the user on to another dialog when they reach this point in the conversation. It can be to a dialog with an intent to finish the conversation, or it can simply be a transition to a new dialog based on a different intent where the end user is asking for new information.

For intent-driven chatbots, you can select which attributes to be transferred over to other dialogs. Use the share attribute option to enable the attribute selector.

You can add as many attributes as you have set up already, but make sure to take into consideration those which are used in the intent and have values that can be transferred. Once selected, the attribute is no longer selectable.

User input

Use the User input element to validate the end user's message and branch the chatbot flow accordingly.

The User input element processes the end user's message in the following order.

  • Validates the end user's message against the keywords that you define. If there is a match, the User input element branches the conversation accordingly.

  • Uses natural language processing (NLP) for AI chatbots. The User input element validates the end user's message against the intents that you define. If there is a match, the chatbot directs the flow accordingly.

    NLP is triggered only if keyword matching fails.

  • Uses fallback options.

In the following example, the User input element branches the flow based on keywords.

User input element

To add a User input element to the chatbot, in the chatbot editor, drag the element from the Chatbot receives section.

Note

You can add only one User input element to a dialog.

In the element, configure the following fields.

Keywords

To add keywords, select Add keyword.

Do one of the following.

  • If you have already created keywords, select the keyword.
  • Create a new keyword.

Natural language processing

For AI chatbots, if you want to validate the end user's response against intents, select Enable the intent engine to process user input.

Enable NLP

Repeat message

If the end user sends an invalid response to your message, the chatbot needs to know what to do.

Use the Repeat option to ask the end user to send the response again.

How many times to repeat the message

Choose the number of times to repeat the message. You can repeat the message a maximum of 3 times. The default value is No repeat.

If the end user still does not send the correct response, the Fallback action is triggered.

Message content (Optional)

Send a message to the end user asking them to resend their response. Example: Sorry, I did not understand that. Please try again.

Link preview

Set whether the end user can see a preview of links that you share in the Message content field. This field is available only if the chatbot uses the WhatsApp channel.

Configure Repeat

Fallback

If the end user sends an incorrect response or the message sending fails, Fallback option is triggered.

Fallback action

Specify the action that the chatbot needs to take when fallback is triggered. You can either transfer the chat to an agent (Connect to agent) or send the end user to another dialog (Go to dialog).

Dialog

If the Fallback action is Go to dialog, choose the relevant dialog. Example: You can go back to the default dialog, the menu dialog, or the closing dialog.

Fallback message (Optional)

Send the end user a message when to inform them that there is an issue. Example: Sorry, I did not understand that. I am taking you to the main menu.

The message can contain a maximum of 4.096 characters including spaces, special characters, new line, emojis, and attributes.

To add variations of the message, select Add variation. You can create a maximum of 5 variations. The chatbot randomly selects one of these messages to send to the end user.

Link preview (Optional)

Set whether the end user can see a preview of links that you share in the Fallback message field. This field is available only if the chatbot uses the WhatsApp channel.

Configure fallback

Timeout

In some cases, the chatbot waits for a long time for the end user to provide a response. You can configure a timeout for such situations.

If the end user does not respond to your message within a specified time duration, you can choose to take actions such as directing the end user to the main menu or transferring them to an agent.

Enable Timeout and configure the following fields.

Minutes

Set the time the chatbot needs to wait for a response from the end user.

Note

The timeout duration must be less than the session timeout duration.

Timeout action

You can either transfer the chat to an agent (Connect to agent) or send the end user to another dialog (Go to dialog).

Dialog

If the Timeout action is Go to dialog, choose the relevant dialog. Example: You can go back to the default dialog, the menu dialog, or the closing dialog.

Timeout message (Optional)

Send the end user a message when to inform them that there is an issue. Example: Sorry, I have not received a response from you.

The message can contain a maximum of 4.096 characters including spaces, special characters, new line, emojis, and attributes.

To add variations of the message, select Add variation. You can create a maximum of 5 variations. The chatbot randomly selects one of these messages to send to the end user.

Link preview

Set whether the end user can see a preview of links that you share in the Timeout message field. This field is available only if the chatbot uses the WhatsApp channel.

Configure timeout

Webhook

A webhook is a user-defined HTTP callback in a webpage and is used to interact with external services or APIs to fetch data or perform actions. The webhook is triggered by a specific event that you define. When a trigger occurs, the webhook registers the event, collects the required data, and sends it back to the URL that is specified in your HTTP request. Example: The triggered event requires the end user to provide authorization criteria.

Webhooks are used for real-time notifications and data synchronization.

In a chatbot design, webhooks usually follow the API element. Use the API element to send the webhook URL to an external system. When the requested data or criteria is available, the webhook destination URL sends the request back. The webhook then saves the response in an attribute that you define.

Configure the element

To use the Webhook element in a chatbot, drag the element from Chatbot actions. Complete the following fields:

Webhook URL type: Specify whether to use the sessionID as a parameter in the path or the body of the request.

Session id body parameter name: If Webhook URL type is Body parameter session id, specify the name of the parameter that contains the session ID. This name is automatically added to the webhook URL.

Webhook URL: This URL is predefined. You must not change this URL. Depending on the webhook URL type, the URL is updated automatically.

Method: Set the Method to either POST or GET. If Webhook URL type is Body parameter session id, you can select only POST.

Configure the fields in the Webhook element

Attributes: Define the attributes where the values are saved.

If the Method field is set to POST, do the following:

  • In the Attribute field, select the attribute.
  • In the Path field, define the path to the parameter where the attribute value is saved. The path is the location in the JSON file hierarchy where the value of the attribute is located. Levels are defined by the number of entries separated by a dot “.”. The maximum throughput for each endpoint is 100 requests per second. The maximum throughput for each endpoint for each IP is 50 requests per second.
Save the values in an attribute

If the Method field is set to GET, do the following:

  • In the Attribute field, select the attribute to which you want to save the value.
  • In the Query parameter field, select the parameter that contains the required value.
Save the values in an attribute

Timeout: Enable timeout for the webhook to make sure that the conversation continues even if the response from the external service or API is delayed or unavailable.

Specify how long the chatbot needs to wait for the response. You can set a minimum timeout of 1s and a maximum timeout of 300s (5 minutes).

Configure the timeout

Fallback: Specify the action that the chatbot needs to take when timeout occurs. The Fallback section contains the following fields:

  • Fallback action: You can either transfer the chat to an agent (Connect to agent) or send the end user to another dialog (Go to dialog).

  • Dialog: If the Fallback action is Go to dialog, choose the relevant dialog. Example: You can go back to the default dialog, the menu, or the closing dialog.

  • Fallback message (Optional): Send the end user a message when timeout occurs to inform them that there is an issue. Example: Sorry, we are experiencing technical difficulties. Please try again later.

The message can contain a maximum of 4.096 characters including spaces, special characters, new line, emojis, and attributes.

To add variations of the message, select Add variation. You can create a maximum of 5 variations. The chatbot randomly selects one of these messages to send to the end user, thus making the end user experience varied.

Configure the fallback settings

Link preview: Set whether the end user can see a preview of any link that you share in the Fallback message field. This field is available only if the chatbot uses the WhatsApp channel.

Enable link preview

Webhook request codes

  • 200- Successful
  • 40401- Unsuccessful. No session.
  • 40026- Unsuccessful. Session cannot handle request.

Example of using Webhook element

The following example shows how to use a Webhook element with an API element to authorize your end user through an external authorization service.

  1. Use the API element to send an authorization request, which contains the webhook URL, to the service.
  2. The chatbot waits for the response.
  3. The chatbot receives a response from the external authorization service. The response contains the URL for the user authorization.
  4. In the chatbot, store the URL in an attribute that is defined in the API element.
  5. Use the Text element to send this authorization URL to the end user. Ask them to authorize themselves through the URL.
  6. After the end user authorizes themselves, the webhook receives a request from the external authorization service. This request contains a token that the end user is authorized. This token value is stored in an attribute in the Webhook element, in case further authorization is required.

Need assistance

Explore Infobip tutorials

Encountering issues

Contact our support

What's new? Check out

Release notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Service Terms & ConditionsPrivacy policyTerms of use