Using Apple Business Chat groups and intents

You can let users start a conversation with your bot from a web page or email message using a URL containing the Apple query string parameters. This provides context for the new conversation — for example which web page was the user looking at when they launched the bot. Converse extracts the parameter values and stores them for the duration of the conversation (session).

Note: For detailed information on the URL parameters, refer to the Apple Developer documentation. For example search for "Starting a Chat from a URL".

You can use the query string parameters to determine how the conversation starts. For example if one of the parameters is a time then you could start the conversation by sending an appropriate greeting for the time of day. This figure shows how you might configure it:

This works like this:

  1. The biz-intent-id parameter value in the URL triggers the Good evening message.
  2. The IntentID action evaluates the biz-intent-id parameter value in the URL and selects the next interaction based on the value.

You can use the query string parameter values at any point in the conversation.

Evaluating the query string parameters

To evaluate the values passed in the URL and select the correct intention based on the values, use Action interactions with a condition for each value. See Condition action.

Variables

Use the following Converse variables when setting up the conditions:

Apple query string parameter Converse variable
biz-group-id appleGroupID
biz-intent-id appleIntentID
Note: The body parameter will contain the message typed and sent by the user. This payload is handled by the When we receive fields of your interactions.

Testing the chatbot

You can generate QR code and links for testing that the bot is working correctly. See Generating test URLs and QR codes for Apple Business Chat for details.