Menu

Expand
Rate this page:

Frontline Integration Service

Note: SSO Configuration is a prerequisite for users to be able to log in to the Frontline App and use the integration service. Please visit this section to review the steps for integrating your SSO provider with Frontline.

To use Twilio Frontline, you will need to enable a server-side web application, which is responsible for handling your customer data in Frontline. This backend-service, the Frontline Integration service, handles responses to Frontline’s callbacks and Conversations API’s webhooks.

Frontline Integration Service.png

As you will see in the next section (Node.js Quickstart), we use our own backend service in Node.js called the "Frontline Integration Service" which connects to the Twilio Frontline interface and implements core features of routing and connecting customer data.

Note: You can find our integration service example in this repository in GitHub. This is meant to serve as a model, and you can clone this to use directly, or write your own integration service in your preferred programming language.

Main features

Return your Customer/CRM Information to the Frontline App

You can access lists of customers and customer details in the Frontline app. To populate this data, the Frontline application makes an API call to a configured CRM Callback URL to fetch customer data for each screen. This configurable CRM Callback URL will point to your integration service’s CRM callback handler and based on the Location parameter, your integration service will retrieve the corresponding customer information or list of customers. You can find more information in the Customers information & CRM section.

Configure Conversations API Webhooks

Since the Frontline App is built on the top of the Conversations API, to prepare incoming conversations for Frontline by connecting the CRM information to the conversation, we need to call and configure onConversationAdd and onParticipantAdded webhooks. The onConversationAdd webhook will be called before creating a conversation, and it can be used for setting a friendly_name and avatar of the conversation. The onParticipantAdded webhook will be called when a participant has been added to the conversation, and it can be used for setting the customer_id, avatar and display_name for customers in a conversation. You can find more information in the Conversations Webhooks section.

Handle Custom Routing Logic (optional)

You can define your own custom routing logic in your integration service. With custom routing, you can decide how incoming conversations will be assigned to workers. To handle custom routing, you have to configure the Custom Routing Callback URL in the Frontline console. This callback will be called when an inbound conversation is created. You can find more information in the Custom Routing section.

Handle Message Templates (optional)

You can configure message templates with Frontline. Message templates are especially useful if you use WhatsApp as a channel. Please be aware that WhatsApp has a limitation in which you can only send approved templates until a user responds back to a message. When the application requests templates through the Templates Callback URL, it passes CustomerId, Worker and ConversationSid identifiers. Templates can be rendered based on those attributes, and the Frontline Integration Service should respond with processed templates as plain text, populated with any placeholders. You can find more information in the Templated Messages section.

Handle Outgoing Conversations

When a Frontline user starts a new conversation from the Customer Details screen, the Frontline application makes an API request to the configured Outgoing Conversations Callback URL. This callback will tell the Frontline application which Twilio number to use for outgoing messages and calls.
In order to create a new outgoing conversation from the Frontline App, you will need to configure the Outgoing Conversations Callback URL in the Frontline console. You can find additional information about Outgoing Conversations in this section.

What’s Next?

Head over to the Frontline Node.js Quickstart to get started!

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more