Smooch Web messenger has been allowing customers to link their Messenger account themselves for almost a year now. We saw a lot of users opt-in to link their account so that they can get a better experience inside an app they are familiar with and also receive notifications when they get a reply.

Today we are adding Facebook Messenger linking via our API so that a business can invite a customer to join them on Messenger.

How does it work?

Smooch Channel Linking API is now leveraging Facebook’s customer matching to allow you to initiate a conversation on Messenger given a phone number. Facebook will attempt to match the phone number to the right user on Messenger. Upon a successful match, the user will receive a message request in Messenger and will be able to opt-in to start the conversation with you. Once they accept, their Messenger account is linked to their Smooch user, and you can reach them on that channel.

Message request flow

Why should I use it?

Unlike most conversations happening on Facebook Messenger where it’s the end-user who must reach out first, using programmatic channel linking allows businesses to initiate the conversation themselves. This type of interaction is a powerful new way to transition your users from one channel to another. For instance, you can move users from SMS to Facebook Messenger and reduce your fees associated with long-running SMS conversations. If your backend has the customer phone number, you can also use the Smooch API to move to Messenger and enable service notifications instantly.

Getting started

Customer matching requires a special permission on your Facebook page, is subject to a $99 USD one-time fee and is currently only available for customers who brings their own Facebook app via the Smooch Integration API. Once the permission is granted from Facebook, you can use the Channel Linking API to add Messenger clients to your users.

To get started, create a user by calling the User API

curl https://api.smooch.io/v1/appusers \  
     -X POST \
     -d '{"givenName": "Rick", "surname": "Sanchez"}' \
     -H 'content-type: application/json' \
     -H 'authorization: Bearer your-jwt'

The response will include an appUserId which you can then use to call the Linking API and provide the user’s phone number.

curl https://api.smooch.io/v1/appusers/{{userID-for-created-user}}/channels \  
     -X POST \
     -d '{"type": "messenger", "phoneNumber": "+15145555555"}, "confirmation": {"type": "immediate", "message": {"role": "appMaker", "text": "Let’s connect on Messenger"}}' \
     -H 'content-type: application/json' \
     -H 'authorization: Bearer your-jwt'

The Channel Linking API will return right away. To determine if the match was successful and further know when the user has accepted your request, you'll need to listen to link:matched, link:failure and link:success webhook events. Check out the full Linking API documentation for more details.

What’s next

Channel linking is a powerful way to leverage the advantages of each channel and help users move seamlessly from one to the other. It is just one of the way Smooch helps software makers create multi-channel customer experiences with one reliable platform and API. Stay tuned, as we’ll be expanding the Channel Linking API to support even more channels in the future.