openapi: 3.1.0
info:
  title: Web Messenger SDK
  description: |
    The Inbox Web Messenger SDK allows you to implement a customizable, fully featured messenger on your website. Any customer who visits your website or uses your app can contact your support team directly, eliminating the need for your users to use Facebook, WhatsApp, or any other messaging platform.

    ### Create your channel
    Please email customer support (`dev.support@hootsuite.com`) to add a new messenger channel.


    ## Implement Messenger on your website

    ### Get started

    The following steps are required to get Messenger to appear on your website.

    #### Step 1: Add the following code toward the end of the `<head>` section on your page. 

    > **Attention:** Make sure to copy all the code below

    ```html
     <script>
        !function(e,t,n,o){var r,s,c,a=[],i=[];e[n]={init:function(){r=arguments;var e={then:function(t){return i.push({type:"t",next:t}),e},catch:function(t){return i.push({type:"c",next:t}),e}};return e},on:function(){a.push(arguments)},render:function(){s=arguments},destroy:function(){c=arguments}},e.__onWebMessengerHostReady__=function(t){if(delete e.__onWebMessengerHostReady__,e[n]=t,r)for(var o=t.init.apply(t,r),p=0;p<i.length;p++){var u=i[p];o="t"===u.type?o.then(u.next):o.catch(u.next)}for(s&&t.render.apply(t,s),c&&t.destroy.apply(t,c),p=0;p<a.length;p++)t.on.apply(t,a[p])};try{var p=t.getElementsByTagName("script")[0],u=t.createElement("script");u.async=!0,u.src="https://assets.hootsuite.com/sdk/messenger/web/"+o+"/webmessenger."+o+".min.js",p.parentNode.insertBefore(u,p)}catch(e){console.error(e)}}(window,document,"WebMessenger","2.6.9");
     </script>
     ```

    #### Step 2: Paste the following initialization code toward the end of the `<body>` section.
    This initializes a basic Web Messenger without any special customizations. Customizations are described in the next section.

    <details>
      <summary>Initialization script</summary>

      On the third line, insert your specific channel Integration ID. This is one of the pieces of text that is generated on channel creation and will be provided by customer support when the channel is set up.

      ```html
      <script>
        var initPromise = WebMessenger.init({
          integrationId: 'Integration ID here',
          // This makes sure the customer is not able to create multiple conversations.
          canUserCreateMoreConversations: false,
          canUserSeeConversationList: false,
          
          customColors: {
            brandColor: '65758e',
            conversationColor: '65758e',
            actionColor: '65758e',
          },
          menuItems: {
            imageUpload: true,
            fileUpload: true,
            shareLocation: true
          },
          fixedHeader: false,
          customText: {
            actionPaymentCompleted: 'Payment Completed',
            actionPaymentError: 'An error occurred while processing the card. <br> Please try again or use a different card.',
            actionPostbackError: 'An error occurred while processing your action. Please try again.',
            clickToRetry: 'Message not delivered. Click to retry.',
            clickToRetryForm: 'Form not submitted. Click anywhere on the form to retry.',
            connectNotificationText: 'Sync your conversation and continue messaging us through your favorite app.',
            connectNotificationSingleText: 'Be notified when you get a reply.',
            conversationListHeaderText: 'My conversations',
            conversationListPreviewAnonymousText: 'Someone',
            conversationListPreviewCarouselText: '{user} sent a message',
            conversationListPreviewFileText: '{user} sent a file',
            conversationListPreviewFormText: '{user} sent a form',
            conversationListPreviewFormResponseText: '{user} filled a form',
            conversationListPreviewImageText: '{user} sent an image',
            conversationListPreviewLocationRequestText: '{user} sent a location request',
            conversationListPreviewUserText: 'You',
            conversationListRelativeTimeJustNow: 'Just now',
            conversationListRelativeTimeMinute: '1 minute ago',
            conversationListRelativeTimeMinutes: '{value} minutes ago',
            conversationListRelativeTimeHour: '1 hour ago',
            conversationListRelativeTimeHours: '{value} hours ago',
            conversationListRelativeTimeYesterday: 'Yesterday',
            conversationListTimestampFormat: 'MM/DD/YY',
            conversationTimestampHeaderFormat: 'MMMM D YYYY, h:mm A',
            couldNotConnect: 'Offline. You will not receive messages.',
            couldNotConnectRetry: 'Reconnecting...',
            couldNotConnectRetrySuccess: "You're back online!",
            couldNotLoadConversations: 'Couldn’t load conversations.',
            emailChangeAddress: 'Change my email',
            emailDescription: 'To be notified by email when you get a reply, enter your email address.',
            emailFieldLabel: 'Email',
            emailFieldPlaceholder: 'Your email address',
            emailFormButton: 'Submit',
            emailLinkingErrorMessage: 'Please submit a valid email address.',
            fetchHistory: 'Load more',
            fetchingHistory: 'Retrieving history...',
            fileTooLargeError: 'Max file size limit exceeded ({size})',
            fileTypeError: 'Unsupported file type.',
            formErrorInvalidEmail: 'Email is invalid',
            formErrorNoLongerThan: 'Must contain no more than ({characters}) characters',
            formErrorNoShorterThan: 'Must contain at least ({characters}) characters',
            formErrorUnknown: 'This doesn\'t look quite right',
            formFieldSelectPlaceholderFallback: 'Choose one...',
            frontendEmailChannelDescription: 'To talk to us using email just send a message to our email address and we\'ll reply shortly:',
            headerText: 'How can we help?',
            imageClickToReload: 'Click to reload image.',
            imageClickToView: 'Click to view {size} image.',
            imagePreviewNotAvailable: 'Preview not available.',
            inputPlaceholder: 'Type a message...',
            inputPlaceholderBlocked: 'Complete the form above...',
            introAppText: 'Message us below or from your favorite app.',
            lineChannelDescription: 'To talk to us using LINE, scan this QR code using the LINE app and send us a message.',
            linkChannelPageHeader: 'Sync your conversation',
            linkError: 'An error occurred when attempting to generate a link for this channel. Please try again.',
            locationNotSupported: 'Your browser does not support location services or it’s been disabled. Please type your location instead.',
            locationSecurityRestriction: 'This website cannot access your location. Please type your location instead.',
            locationSendingFailed: 'Could not send location',
            locationServicesDenied: 'This website cannot access your location. Allow access in your settings or type your location instead.',
            messageIndicatorTitlePlural: '({count}) New messages',
            messageIndicatorTitleSingular: '({count}) New message',
            messageRelativeTimeDay: '{value}d ago',
            messageRelativeTimeHour: '{value}h ago',
            messageRelativeTimeJustNow: 'Just now',
            messageRelativeTimeMinute: '{value}m ago',
            messageTimestampFormat: 'h:mm A',
            messageDelivered: 'Delivered',
            messageSeen: 'Seen',
            messageSending: 'Sending...',
            messengerChannelDescription: 'Connect your Facebook Messenger account to be notified when you get a reply and continue the conversation on Facebook Messenger.',
            newConversationButtonText: 'New Conversation',
            notificationSettingsChannelsDescription: 'Sync this conversation by connecting to your favorite messaging app to continue the conversation your way.',
            notificationSettingsChannelsTitle: 'Other Channels',
            notificationSettingsConnected: 'Connected',
            notificationSettingsConnectedAs: 'Connected as {username}',
            prechatCaptureGreetingText: 'Hi there \nTo start off, we\'d like to know a little bit more about you:',
            prechatCaptureNameLabel: 'Your name',
            prechatCaptureNamePlaceholder: 'Type your name...',
            prechatCaptureEmailLabel: 'Email',
            prechatCaptureEmailPlaceholder: 'name@company.com',
            prechatCaptureConfirmationText: 'Thanks for that! What can we help you with?',
            prechatCaptureMailgunLinkingConfirmation: 'You\'ll be notified here and by email at {email} once we reply.',
            sendButtonText: 'Send',
            settingsHeaderText: 'Settings',
            shareLocation: 'Location',
            smsBadRequestError: 'We were unable to communicate with this number. Try again or use a different one.',
            smsCancel: 'Cancel',
            smsChangeNumber: 'Change my number',
            smsChannelDescription: 'Connect your SMS number to be notified when you get a reply and continue the conversation over SMS.',
            smsChannelPendingDescription: 'Check your messages at {number} to confirm your phone number.',
            smsContinue: 'Send',
            smsInvalidNumberError: 'Please submit a valid phone number.',
            smsLinkCancelled: 'Link to {appUserNumber} was cancelled.',
            smsLinkPending: 'Pending',
            smsPingChannelError: 'There was an error sending a message to your number.',
            smsSendText: 'Send me a text',
            smsStartTexting: 'Start Texting',
            smsTooManyRequestsError: 'A connection for that number was requested recently. Please try again in {minutes} minutes.',
            smsTooManyRequestsOneMinuteError: 'A connection for that number was requested recently. Please try again in 1 minute.',
            smsUnhandledError: 'Something went wrong. Please try again.',
            syncConversation: 'Sync conversation',
            tapToRetry: 'Message not delivered. Tap to retry.',
            tapToRetryForm: 'Form not submitted. Tap anywhere on the form to retry.',
            telegramChannelDescription: 'Connect your Telegram account to be notified when you get a reply and continue the conversation on Telegram',
            uploadDocument: 'File',
            uploadInvalidError: 'Invalid file',
            uploadPhoto: 'Image',
            uploadVirusError: 'A virus was detected in your file and it has been rejected',
            unsupportedMessageType: 'Unsupported message type.',
            unsupportedActionType: 'Unsupported action type.',
            viberChannelDescription: 'Connect your Viber account to be notified when you get a reply and continue the conversation on Viber. To get started, scan the QR code using the Viber app.',
            viberChannelDescriptionMobile: 'Connect your Viber account to be notified when you get a reply and continue the conversation on Viber. To get started, install the Viber app and tap Connect.',
            viberQRCodeError: 'An error occurred while fetching your Viber QR code. Please try again.',
            wechatChannelDescription: 'Connect your WeChat account to be notified when you get a reply and continue the conversation on WeChat. To get started, scan this QR code using the WeChat app.',
            wechatChannelDescriptionMobile: 'Connect your WeChat account to be notified when you get a reply and continue the conversation on WeChat. To get started, save this QR code image and upload it in the <a href=\'weixin://dl/scan\'>QR code scanner</a>.',
            wechatQRCodeError: 'An error occurred while fetching your WeChat QR code. Please try again.',
            whatsappChannelDescriptionDesktop: 'Sync your account to WhatsApp by scanning the QR code or clicking the link below.\nThen, send the pre-populated message to validate the sync request. (Your code: {{code}}).',
            whatsappChannelDescriptionMobile: 'Sync your account to WhatsApp by clicking the link below.\nThen, send the pre-populated message to validate the sync request. (Your code: {{code}}).',
            whatsappLinkingError: 'An error occurred while fetching your WhatsApp linking information. Please try again.'
          }
        }).then(function () {
          // Your code after init is complete
        });
      </script>
      ```

    </details>

    <details>
      <summary>Optional functions</summary>

      ```javascript
      // Opens the conversation widget (NOOP when embedded)
      WebMessenger.open();
      
      // Closes the conversation widget (NOOP when embedded)
      WebMessenger.close();
      
      // Tells if the widget is currently opened or closed.
      WebMessenger.isOpened();
      
      // Logs a user in the Web Messenger, retrieving the conversations the user already had on other browser sessions and/or devices. Note that you don't need to call this after `init` if you already passed the external id and jwt as arguments in the call to `init`, in which case it's done internally as part of the initialization sequence. This returns a `Promise` that resolves when the Web Messenger is ready again.
      WebMessenger.login('external-id', 'some-jwt');
      
      // Logs out the current user and reinitialize the widget with an anonymous user. This returns a promise that resolves when the Web Messenger is ready again.
      WebMessenger.logout();
      
      // Destroys the Web Messenger and makes it disappear. The Web Messenger has to be reinitialized with `init` to be working again because it also clears up the integration id from the Web Messenger. It will also unbind all listeners you might have with `WebMessenger.on`.
      WebMessenger.destroy();
      
      // Sends a message to the targeted conversation on the user's behalf.
      WebMessenger.sendMessage(
      {
        type: 'text',
        text: 'hello'
      },
      '<conversation-id>'
      );
      // OR
      WebMessenger.sendMessage('hello', '<conversation-id>');
      ```

    </details>

    ## Customize Web Messenger options

    Several options are available for customizing your Web Messenger. The following is an example of a fully customized Web Messenger. Every option used is documented following the code snippet.

    <details>
      <summary>Customization options</summary>

      ```javascript
      WebMessenger.init({
        integrationId: '<integration-id>',
          // For authenticated mode
        jwt: 'your_jwt',
        userId: 'user_id',
        locale: 'en-US',
        customColors: {
          brandColor: '65758e',
          conversationColor: '65758e',
          actionColor: '65758e',
        },

        menuItems: {
          imageUpload: true,
          fileUpload: true,
          shareLocation: true
        },

        fixedIntroPane: false,

        prechatCapture: {
          enabled: true,
          fields: [
            {
              type: 'email',
              name: 'email',
              label: 'Email',
              placeholder: 'your@email.com'
            },
            {
              type: 'text',
              name: 'company-website',
              label: 'Company website',
              placeholder: 'mycompany.com'
            },
            {
              type: 'select',
              name: 'company-size',
              label: 'Company size',
              placeholder: 'Choose a number...',
              options: [
                {
                  name: '1-10',
                  label: '1-10 employees'
                },
                {
                  name: '11-50',
                  label: '11-50 employees'
                },
                {
                  name: '51+',
                  label: '51+ employees'
                }
              ]
            }
          ]
        },
        customText: {
          actionPostbackError: 'An error occurred while processing your action. Please try again.',
          clickToRetry: 'Message not delivered. Click to retry.',
          connectNotificationText: 'Be notified inside your other apps when you get a reply.',
          connectNotificationSingleText: 'Be notified when you get a reply.',
          connectNotificationSingleButtonText: 'Turn on <name> notifications',
          connectNotificationOthersText: 'others',
          conversationTimestampHeaderFormat: 'MMMM D YYYY, h:mm A',
          fetchHistory: 'Load more',
          fetchingHistory: 'Retrieving history...',
          fileTooLargeError: 'Max file size limit exceeded ({size})',
          fileTypeError: 'Unsupported file type.',
          headerText: 'How can we help?',
          imageClickToReload: 'Click to reload image.',
          imageClickToView: 'Click to view {size} image.',
          imagePreviewNotAvailable: 'Preview not available.',
          inputPlaceholder: 'Type a message...',
          introductionText: 'We\'re here to talk, so ask us anything!',
          invalidFileError: 'Only images are supported. Choose a file with a supported extension (jpg, jpeg, png, gif, or bmp).',
          locationNotSupported: 'Your browser does not support location services or it’s been disabled. Please type your location instead.',
          locationSecurityRestriction: 'This website cannot access your location. Please type your location instead.',
          locationSendingFailed: 'Could not send location',
          locationServicesDenied: 'This website cannot access your location. Allow access in your settings or type your location instead.',
          messageError: 'An error occurred while sending your message. Please try again.',
          messageIndicatorTitlePlural: '({count}) New messages',
          messageIndicatorTitleSingular: '({count}) New message',
          messageRelativeTimeDay: '{value}d ago',
          messageRelativeTimeHour: '{value}h ago',
          messageRelativeTimeJustNow: 'Just now',
          messageRelativeTimeMinute: '{value}m ago',
          messageTimestampFormat: 'h:mm A',
          messageSending: 'Sending...',
          messageDelivered: 'Delivered',
          prechatCaptureGreetingText: 'Hi there \nTo start off, we\'d like to know a little bit more about you:',
          prechatCaptureConfirmationText: 'Thanks for that! What can we help you with?',
          sendButtonText: 'Send',
          settingsHeaderText: 'Settings',
          shareLocation: 'Share location',
          tapToRetry: 'Message not delivered. Tap to retry.',
          unsupportedMessageType: 'Unsupported message type.',
          unsupportedActionType: 'Unsupported action type.',
          uploadDocument: 'Upload document',
          uploadInvalidError: 'Invalid file',
          uploadPhoto: 'Upload photo',
        }
      }).then(function() {
        // Your code after init is complete
      });
      
      initPromise.then(function() {
        // do something
      });
      
      // pass it around...
      initPromise.then(function() {
        //do something else
      });
      ```

    </details>

    ### Options

    The following general settings can be changed.

    | Option                   | Optional? | Default value             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    |--------------------------|-----------|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    | integrationID            | No        | -                         | Your integration ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
    | region                   | Yes       | -                         | The target region in which the app is located.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
    | jwt                      | Yes       | -                         | The token to authenticate your communication with the server.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
    | userId                   | Yes       | -                         | The user's ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
    | authCode                 | Yes       | -                         | An auth code for linking to an existing conversation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
    | locale                   | Yes       | en-US                     | The locale used for date formatting using the `-` format. See [language codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and [country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). <br /><br /> Note: The country part is optional, and if a country is either not recognized or not supported, the app falls back to the generic language. If the language isn't supported, the app falls back to `en-US`. <br /><br /> Note: This is only used for date formatting and doesn't provide built-in translations for Web Messenger. |
    | soundNotificationEnabled | Yes       | TRUE                      | Enables the sound notification for new messages.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
    | imageUploadEnabled       | Yes       | TRUE                      | Enables the image upload feature.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
    | embedded                 | Yes       | FALSE                     | Tells the widget it is embedded (see following Embedded section).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
    | displayStyle             | Yes       | button                    | How the messenger appears on your website. Must be either button or tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
    | buttonIconUrl            | Yes       | -                         | When the displayStyle is "button", you can select your own button icon. The image must be at least 200 x 200 pixels in JPG, PNG, or GIF format.                                                                                                                                                                                                                                                                                                                                                                                                             |
    | buttonWidth              | Yes       | 58px                      | When the displayStyle is "button", you have the option of specifying the button width.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    | buttonHeight             | Yes       | 58px                      | When the displayStyle is "button", you have the option of specifying the button height.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    | businessName             | Yes       | -                         | A custom business name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    | businessIconUrl          | Yes       | -                         | A custom business icon URL. The image must be at least 200 x 200 pixels and must be in JPG, PNG, or GIF format.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
    | backgroundImageUrl       | Yes       | -                         | A background image URL for the conversation. The image is tiled to fit the window.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
    | customColors             | Yes       | See the following section     | Colors used in the Web Messenger UI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
    | customText               | Yes       | See the following example | Strings used in the Web Messenger UI. You can use these to either customize the text or translate it. <br /><br /> Note: Some strings include variables (surrounded by {}), which must remain in your customized text.                                                                                                                                                                                                                                                                                                                                      |
    | menuItems                | Yes       | See the following section |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
    | prechatCapture           | Yes       | See the following section |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

    ### Color options

    You can give your Web Messenger a custom look by editing the following settings.

    | Option            | Optional? | Default value | Description                                                                                                                        |
    |-------------------|-----------|---------------|------------------------------------------------------------------------------------------------------------------------------------|
    | brandColor        | Yes       | 65758e        | This color is used in the messenger header and the button or tab in idle state. Must be a 3- or 6-character hexadecimal color.     |
    | conversationColor | Yes       | 0099ff        | This color is used for customer messages, quick replies, and actions in the footer. Must be a 3- or 6-character hexadecimal color. |
    | actionColor       | Yes       | 0099ff        | This color is used for calls-to-action inside your messages. Must be a 3- or 6-character hexadecimal color.                        |

    ### Text options

    Web Messenger has many text options to choose from. Here are a few examples.

    | Option                              | Default value if not used                                                                                 |
    |-------------------------------------|-----------------------------------------------------------------------------------------------------------|
    | actionPostbackError                 | An error occurred while processing your action. Please try again.                                         |
    | clickToRetry                        | Message not delivered. Click to retry.                                                                    |
    | connectNotificationText             | Be notified inside your other apps when you get a reply.                                                  |
    | connectNotificationSingleText       | Be notified when you get a reply.                                                                         |
    | connectNotificationSingleButtonText | Turn on <name> notifications                                                                              |
    | connectNotificationOthersText       | others                                                                                                    |
    | conversationTimestampHeaderFormat   | MMMM D YYYY, h:mm A                                                                                       |
    | fetchHistory                        | Load more                                                                                                 |
    | fetchingHistory                     | Retrieving history...                                                                                     |
    | headerText                          | How can we help?                                                                                          |
    | inputPlaceholder                    | Type a message...                                                                                         |
    | introductionText                    | We're here to talk, so ask us anything!                                                                   |
    | invalidFileError                    | Only images are supported. Choose a file with a supported extension (jpg, jpeg, png, gif, or bmp).        |
    | locationNotSupported                | Your browser does not support location services or it's been disabled. Please type your location instead. |
    | locationSecurityRestriction         | This website cannot access your location. Please type your location instead.                              |
    | locationSendingFailed               | Could not send location                                                                                   |
    | locationServicesDenied              | This website cannot access your location. Allow access in your settings or type your location instead.    |
    | messageError                        | An error occurred while sending your message. Please try again.                                           |
    | messageIndicatorTitlePlural         | ({count}) New messages                                                                                    |
    | messageIndicatorTitleSingular       | ({count}) New message                                                                                     |
    | messageRelativeTimeDay              | {value}d ago                                                                                              |
    | messageRelativeTimeHour             | {value}h ago                                                                                              |
    | messageRelativeTimeJustNow          | Just now                                                                                                  |
    | messageRelativeTimeMinute           | {value}m ago                                                                                              |
    | messageTimestampFormat              | h:mm A                                                                                                    |
    | messageSending                      | Sending...                                                                                                |
    | messageDelivered                    | Delivered                                                                                                 |
    | sendButtonText                      | Send                                                                                                      |
    | settingsHeaderText                  | Settings                                                                                                  |
    | tapToRetry                          | Message not delivered. Tap to retry.                                                                      |
    | unsupportedMessageType              | Unsupported message type.                                                                                 |
    | unsupportedActionType               | Unsupported action type.                                                                                  |
    | uploadDocument                      | Upload document.                                                                                          |
    | uploadInvalidError                  | Invalid file.                                                                                             |
    | uploadPhoto                         | Upload photo.                                                                                             |

    ### Menu options

    Menu items can be enabled or disabled.

    | Option        | Optional? | Default value | Description                          |
    |---------------|-----------|---------------|--------------------------------------|
    | imageUpload   | Yes       | TRUE          | Enables the image upload menu item   |
    | fileUpload    | Yes       | TRUE          | Enables the file upload menu item    |
    | shareLocation | Yes       | TRUE          | Enables the share location menu item |

    ### Prechat capture option

    This option allows you to have the Web Messenger automatically post a message to the user. You can implement a variety of messages. The following code snippet is the same as the one used in the earlier example.

    ```javascript
    prechatCapture: {
      enabled: true,
      fields: [
        {
          type: 'email',
          name: 'email',
          label: 'Email',
          placeholder: 'your@email.com'
        },
        {
          type: 'text',
          name: 'company-website',
          label: 'Company website',
          placeholder: 'mycompany.com'
        },
        {
          type: 'select',
          name: 'company-size',
          label: 'Company size',
          placeholder: 'Choose a number...',
          options: [
            { name: '1-10', label: '1-10 employees' },
            { name: '11-50', label: '11-50 employees' },
            { name: '51+',label: '51+ employees' }
          ]
        }
      ]
    }
    ```

    ### Embedded mode option

    You have the option to set up the Web Messenger in an embedded mode. This lets you choose where you want the widget to be visible.
    The following example illustrates what you need to set it up.
    Note that for embedded mode to work, you must set the parameter of `embedded` to `true` and call the `WebMessenger.render()` function manually.

    ```javascript
    WebMessenger.init({
      integrationId: 'INTEGRATION_ID_HERE',
      embedded: true
      }).then(() => {
        // Your code after init is complete
      });

    WebMessenger.render(document.getElementById('chat-container'));
    ```

    This sample embeds the Inbox 2.0 messenger within a DOM element with the ID "chat-container". If you open the webpage, you will notice that it is no longer showing a button on the bottom right, but it is visible in the container element.

    ### Use contact attributes to save specific messenger data

    You can store information about the webpage and the user by using contact attributes. To enable this, do the following:

    1.  Go to `Admin settings`, expand `Agent workspace`, and then select `Contact attributes`.
    2.  Find one of the default contact attributes in the list and use the toggle to enable it.

    Now, when a client contacts you via the WebMessenger Messenger plugin, that specific data will be stored inside of a contact attribute.

    Available contact attributes for the Web Messenger plugin:

    -   Browser Language
    -   First Name
    -   Last Name
    -   Page Domain
    -   Page Title
    -   Page URL
    -   User Id

    ### Use shortcodes to create a rich messaging experience

    Shortcodes are a useful way to create a rich messaging interface.

    #### Available shortcodes

    | Element                 | Syntax          | Example                              |
    |-------------------------|-----------------|--------------------------------------|
    | Link button             | `%[]()`         | `%[Button label](http://anyurl.com)` |
    | Reply button            | `%[](reply:)`   | `%[Button label](reply:PAYLOAD)`     |
    | Location request button | `%[](location)` | `%[Button label](location)`          |
    | Image                   | `![]()`         | `![](http://url-of.the/image.jpg)`   |

    #### Link button

    By using multiple Link button shortcodes, you can send a contact multiple links in one message. An example:

    ```
    %[Link to Facebook](https://facebook.com)
    %[Link to Twitter](https://twitter.com)
    %[Link to LinkedIn](https://linkedin.com)
    ```

    ![A sample message with three link buttons](/images/sparkcentral/shortcode-multiple-links.png)

    #### Reply button

    By using multiple Reply button shortcodes under each other in one message, you can offer the contact a choice. For example:

    ```
    %[Sales](reply:Sales)
    %[Support](reply:Support)
    %[Engineering](reply:Engineering)
    ```

    ![A sample message with three reply buttons](/images/sparkcentral/shortcode-multiple-buttons.png)

    #### Location sharing button

    This code allows you to invite the contact to share their location with you.

    ```
    %[Share your location with us](location)
    ```

    ![A sample message with a request to share the location](/images/sparkcentral/shortcode-share-location.png)

    #### Images

    You can send images and gifs using this shortcode.

    ```
    ![A sample message with a GIF](http://url-of.the/image.gif)
    ```

    ![A sample message with a GIF](/images/sparkcentral/shortcode-image.png)
  version: v1
  contact:
    email: dev.support@hootsuite.com
  license:
    name: Hootsuite Developer Terms and API License Agreement
    url: https://hootsuite.com/legal/dev-api-terms
tags: []
paths: {}
webhooks: {}
