Like most social media platforms, Twitter gives you an option to send private messages to users. Twitter Direct Messages enable businesses to take an interaction with a user from the public timeline to a private conversation.
Our Twitter DM integration allows you to send & receive direct messages on Twitter using your own account. You will receive these messages in a business system or with webhooks.
Twitter supports a wide variety of capabilities as seen in the channel capabilities grid. Below is a detailed view of each capabilities.
Delivery events allow you to track deliveries of Sunshine Conversations messages to Twitter DM by subscribing to the conversation:message:delivery:channel
webhook. Failures to deliver a message to Twitter DM can be detected by subscribing to the conversation:message:delivery:failure
webhook.
There are two ways to set up a Twitter integration: using the dashboard, or using the integration API.
If you are a licensed Zendesk customer, use the embedded sign-up flow in the Admin Center. For detailed instructions, see Adding Twitter DM channels to the Zendesk Agent Workspace.
If however you have your own Twitter Account Activity API subscription or you’re willing to set one up, you can set up a Twitter integration using the integration API. The section below guides you through this process. ISVs must have their own Enterprise license to use the Twitter integration.
In this option you’ll be using your own Twitter app to act on behalf of a business Twitter account. If you’re building your own user experience for businesses to integrate their Twitter accounts with your software, this option is for you.
The steps below describe how to set up a Twitter app that can be used to create Twitter integrations.
First, you’ll need to set up an Enterprise Account with Twitter. Twitter’s Account Activity API can only be used by Enterprise customers.
Create a Twitter app if you don’t already have one. Twitter apps can be managed via the Twitter app dashboard. Take note of your Twitter app consumer key and secret.
You now have a Twitter app that’s ready to power new Twitter integrations!
We’re now going to use the Twitter app we configured in the steps above to connect with a specific Twitter account representing your business.
First, acquire an Access Token Key and Secret on behalf of the business’ Twitter account. These can be obtained via the Twitter OAuth Flow. Note that if you’re just testing things out, you can integrate with your Twitter app’s owner account by using the access token and secret found under your app’s Keys and tokens tab.
Call the Create Integration endpoint. You’ll need to include:
tier
: Your Twitter subscription tier (enterprise
).consumerKey
and consumerSecret
of your Twitter appaccessTokenKey
and accessTokenSecret
that were issued on behalf of the Twitter account you’re integrating with, obtained in the previous stepPlease see the API docs for more details on how to call this API.
In order for a business to receive direct messages from anyone (including accounts it does not follow), the option must be enabled in Twitter’s settings. Go to Twitter’s Direct Messages settings and check “Allow message requests from everyone”. Be sure to save your changes!
You can easily send links to your users to direct them to a private conversation from a public Tweet.
Sending https://twitter.com/messages/compose?recipient_id={your account’s numeric user ID}
will render in twitter a “Send a private message” button like this:
You can find your User ID here:
These links also works anywhere on the web. Read more details about the “Send a private message” link here.