---
schema_version: "1"
id: 7efc8e5ea14b331d18b836cf49a0759ffd4a37240f9a0b7ac03445ccc1a21187
title: Send URLs with Link Previews
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-byoc-ccaas/guides/link-previews.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-byoc-ccaas/guide/link-previews.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3254acd4495314111a189c6922c25edb010bc9a3e14c39794c15e18a8ab65196
products:
  - Bring Your Own Channel for CCaaS
  - Service Cloud Developer Content
---
# Send URLs with Link Previews

With link previews for Bring Your Own Channel for CCaaS, 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.

1. Register link previews to specify that your integration supports a `formatType` of `Links` for `StaticContentMessage` 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.

   ```JSON
{
     "capabilities": {
       "appType": "custom",
       "channelCapabilities": [
         {
           "channelType": "custom",
           "customIntegration": {
           "customIntegrationType": "CustomChannelIntegration",
           "integrationNamespace": "testdot3",
           "conversationChannelDefinitionDevName": "CCaaSDot_ChannelDefinition1"
           },
           "messageTypeCapabilities": [
             {
               "messageType": "StaticContentMessage",
               "formatTypeCapabilities": [
                 {
                 "formatType": "Links"
                 }
               ]
             }
           ]
         }
       ]
     }
   }
```

2. Set up regex detection to detect URLs in inbound messages and preprocess them to separate messages into text and URLs.
3. To send a URL in an inbound message, during the call to the Interactions API (`POST /api/v1/interactions`), send an inbound message of `StaticContentMessage` message type with `Links` format type.

   Here’s an example payload.

   ```JSON
{
      "id": "57904eb6-5352-4c5e-adf6-5f100572cf5d",
      "inReplyToMessageId": "789204eb6-4322-3234-vd23-323vdf2fdfs"
      "messageType":"StaticContentMessage",
      "staticContent": {
        "formatType":"Links",
        "links": [
          {
            "url": "https://en.wikipedia.org/wiki/Flower"
          }
        ]
      }
   }
```

   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.

   ![A rich link with thumbnail image, URL, and title in the enhanced Conversation component showing a message from an end user](https://developer.salesforce.com/docs/media/messaging-partner/byoc-link-preview.png '{"class": "image-sm"}')

4. 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.


For a sample implementation in the Bring Your Own Channel for CCaaS demo connector, see the [main.js](https://github.com/salesforce-misc/byo-demo-connector/blob/main/src/byo-ott-app/main.js) and [ottAppServer.mjs](https://github.com/salesforce-misc/byo-demo-connector/blob/main/src/server/ottAppServer.mjs) files in GitHub.

**See Also**

- [Interaction Service API](https://developer.salesforce.com/docs/service/interaction-service-api/guide/get-started.html)
- _GitHub_: [Interaction Service APIs](https://github.com/salesforce-misc/interaction-service-apis)
