Skip to main content

Integrating SnapCall into an Advanced AI Agent procedure

Written by Alessandro Angioni
Updated today

This video explains how to embed SnapCall into an Advanced AI Agent dialogue so the bot can collect and process customer media during the conversation.

Depending on your setup, the flow can either prompt the user to record or upload media through a webview, or it can analyze media that the customer already uploaded through the widget.

The goal is to make SnapCall part of the conversation before an escalation happens, so the AI output can be used directly in the flow or attached to the ticket later.

Configuration

The first step is to configure the actions that the procedure will rely on during the conversation. You need an action that grabs the conversation ID from Sunshine Conversations and stores it as a parameter, because that ID is used later to associate the media and its results with the correct conversation. Please make sure to define the action as shown on the screenshot below.

You also need an action that opens a SnapCall webview in the messaging widget, using the required parameters such as the customer email and conversation ID so the media can be submitted and linked correctly. To configure that, set the parameters requested as following:

  • Name of the action can be whatever you prefer

  • Target: Sunshine conversation

  • Task: Add a webview

Configure the fields as follows:

  • Message text: Customize a message informing customers that they will need to record a video.

  • Button text: Label for the button that will open SnapCall’s webview.

  • URI field: Insert your SnapCall link.

  • Fallback field: Add your Flow Page link plus the following string, without spaces

    &ticket=smooch_{{conversation_id}}&customerEmail={{email}}

Over here we're basically passing parameters to SnapCall so that we will asking the user for the email address (make sure to collect this parameter earlier in the flow) and the conversation_id we extracted earlier (so that SnapCall knows where to return the media analysed).

If you want to collect SnapCall AI output after the media is analysed, you can also define the following action:

  • Target: Sunshine Conversations

  • Task: Get conversation

  • Field to retrieve: (Metadata)

  • Key: snapcall_skill_SKILLID_STEPNUMBER_MEDIANUMBER

  • Save as parameter: ID

An example of key to type would be snapcall_skill_123456_1_1, where the first 1 would be the step 1 or the first defined target media in the flow, while the second 1 would represent the first flow updated by the customer.

To locate your skill ID, go to the AI skills page, open the menu for the skill you want by clicking the button on its right, then select Copy ID. After that, add your step and media number to the end of the copied value.

Procedure setup

Once the actions are ready, you can build the procedure in conversational language inside Advanced AI Agent.

The procedure should first instruct the bot to retrieve the conversation ID, which triggers the action configured earlier, and then tell it to open the SnapCall webview so the customer can submit media.

After that, the procedure should wait silently until SnapCall posts the acknowledgment message back into the conversation, which happens after the media is submitted and processing is complete.

Retrieving AI output

When the acknowledgment message is received, the procedure can move to the next step and extract the AI output returned by SnapCall. To achieve this we can use the action we defined earlier, so that the output will be saved as a parameter and can be used later in the Flow.

Once the output is mapped into a variable, it can be reused in the rest of the flow and pushed into the relevant conversation field if needed.

After processing

At that point, you can continue the dialogue in any way that fits your workflow. The procedure can use the AI output to guide the next response, populate fields, or decide whether the conversation should be escalated to a human agent.

If an escalation happens, the ticket can be created with the media and extracted information already attached, which makes the handoff cleaner and more useful for support teams.


Did this answer your question?