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 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 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 the 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, or see the Node.js Quickstart for how to configure these webhooks.

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 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?

Ready to try out the Frontline mobile app? Follow the Frontline Serverless Quickstart to get the app running on your mobile phone with no code. If you are ready to build your own server side application, use the Frontline Node.js Quickstart to start developing with Frontline.

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!