Send URLs with Link Previews
With link previews for Bring Your Own Channel for Messaging, customers and reps receive rich link URLs without the need for admins to configure enhanced link messaging components. A customer or rep sends a URL in a Messaging session, and a link preview shows rich link details, including a thumbnail image, title, and URL.
-
Register link previews to specify that your integration supports a
formatType
ofLinks
forStaticContentMessage
by using the Interaction Service Register Capabilities API (PATCH /api/v1/capabilities
).Registering
RichLink
as one of the supported format types for messaging sets the capability for inbound and outbound messages. Invoke this API only once. We recommend invoking the API on load of your middleware or connector.Here’s an example payload.
-
Set up regex detection to detect URLs in inbound messages and preprocess them to separate messages into text and URLs.
-
To send a URL in an inbound message, during the call to the Interactions API (
POST /api/v1/interactions
), send an inbound message ofStaticContentMessage
message type withLinks
format type.Here’s an example payload.
SCRT2 parses the metadata from the URL and sends a rich link to Salesforce that includes a thumbnail, a brief description of the site, the title, and the URL. In the Conversation component in Salesforce, the rep sees a rich link rendered.
-
Set up your environment to handle the URL’s metadata to render a link preview for the Messaging end user. When a rep sends an outbound message to a customer, Salesforce automatically sends it using a rich link.
See Also
- GitHub: Interaction Service APIs