Skip to main content
[Ultimate bot] - How to collect AI output from SnapCall?
Alessandro Angioni avatar
Written by Alessandro Angioni
Updated over 2 months ago

This guide explains how to extract AI output from SnapCall for use with uGPT in Ultimate, enabling you to build further automations. The process can be broken down into three main steps.

Collect the conversation id from the chat

The first step is to obtain the conversation ID from the chat. You can do this by adding an action to any step in the bot configuration. If you have already collected this parameter in your flow, you can skip this step and move to the next.
​
Select any step, then click on the button 'Add/Edit action' from the right side of the screen, you will be shown a pop up menu with a blue button on the top right side of the screen. Click there to continue.
​
You will be asked now to define a few information in a pop up window, you can set them all up as shown below:

  • Set 'Target' as 'Sunshine conversation'

  • 'Action' should be set as 'Get Conversation Metadata'

  • Define the 'Field to retrieve' as 'id'

  • On the field just next to it, 'Save as parameter', define this as 'conversation_id'

  • Click on the 'Apply' button

Add SnapCall to your bot configuration (webview configuration)

Now that you have the conversation_id of the chat, you can provide the end user with a link to record a video or another type of media. You will need a SnapCall account for it, as well as a Public Page set up.

To have a sponsored account at SnapCall, you can use the following link, once signed up you can click here to get your unique link, you will find it on the top right side of the screen. Before adding the link to the bot, add the following string at its end:

?ticket=smooch_{{conversation_id}}

You can add the link in a webview for example, using the following instruction:

  • Select a 'Bot message' step in the flow where you want to add a Webview, then click on the button 'Add/Edit action' from the right side of the screen, you will be shown a pop up menu with a blue button on the top right side of the screen. Click there to continue.

  • Define rest of the requested information as shown on the image below.

  • Message text, Fallback and Button text fields can be set up as you prefer, while the URI field needs to have the URL that you located earlier in your dedicated Public Page.

Collect SnapCall metadata

Similarly to step 1, we will focus now on collecting and storing all the output provided by SnapCall as a variables, so that they can be used further into your bot configuration.

When a user upload a media with SnapCall, we will process the AI output and store them in the metadata of the conversation using the following format. \

"conversation": { 
"id": "66fd6f243c410d8c9e000d2a",
"type": "personal",
"brandId": "18130750166290",
"isDefault": true,
"businessLastRead": "2024-10-02T16:05:41.759Z",
"lastUpdatedAt": "2024-10-02T16:05:41.759Z",
"createdAt": "2024-10-02T16:04:52.492Z",
"metadata": {
"userId": "66fd6f243c410d8c9e000d21",
"origin_source_integration": "660ff11fe39567eab5704c85",
"snapcall_transcript": "Hello ?I've got an issue with my MacBook pro.The battery is not working anymore, and I can't use it, and i need to replace it.I want to know how I can perform that.Thanks for your",
"snapcall_summary": "Here's the English translation of your request:- **I have a problem** with my MacBook Pro.- **The battery no longer works**, and I can't use it.- **I need** to replace it.- I want to know how I can get it replaced.",
"snapcall_description": "The images show a desk setup with a closed laptop and a white keyboard in front. A red cable is placed on the laptop, and a screen displaying messaging applications is visible in the background." },
"activeSwitchboardIntegration": {
"id": "660ff7c37ab96e947259a045",
"name": "ultimate",
"integrationId": "660ff7a9e4a711b885b41692",
"integrationType": "ultimate"
}
}
}

You can see the summary and transcript as part of the SnapCall metadata, while the AI video output is included within the 'snapcall_description' variable.

To store any of these as a variable, select any step after the webview configured on the earlier part of this article, then click on the button 'Add/Edit action' from the right side of the screen.

You will be shown a pop up menu with a blue button on the top right side of the screen, click there to continue.
​
You will be asked now to define a few information in a pop up window, you can set them all up as shown below:

  • Set 'Target' as 'Sunshine conversation'

  • 'Action' should be set as 'Get Conversation Metadata'

  • Define the 'Field to retrieve' as '<Metadata>'

  • They 'Key' value depends on the variable you'd like to store. For example, if you would like to store the summary provided by SnapCall, define this as 'snapcall_summary'.

  • On the field just next to it, 'Save as parameter', define this as 'description'

  • Click on the 'Apply' button

  • You can repeat the same step for any other variable you'd like to store from SnapCall (such as 'snapcall_description' or 'snapcall_transcript')

You can now continue your configuration and use these variables like any other collected earlier or later within the flow.

Did this answer your question?