We recently launched Manage Tweets with a feature to Tweet directly to Super Follows. This tutorial will walk you through how to get started using the Twitter API to Tweet to your subscribers using OAuth 2.0 and Postman.
What is Super Follows?
Super Follows is an opportunity to earn monthly revenue by sharing subscriber-only content with your most engaged followers on Twitter. Through Super Follows, creators like you can create a monthly subscription of $2.99, $4.99, or $9.99 a month, where you could give access to exclusive content or insights into your creative process for creating your bot. In addition, super Followers enjoy extra special access to unfiltered thoughts, early previews, and subscriber-only conversations from their favorite accounts.
How to Apply to Super Follows
You will need to have Super Follows enabled on your account to follow this tutorial. To apply to set up a Super Follows subscription, you will need to follow these steps:
- Swipe open the sidebar on your home timeline
- Tap on “Monetization
- ”Select “Super Follows”
After you apply, our team will review your application shortly. You will also need to sign up for a developer account if you don’t already have one.
Setting up Postman
You will first want to download Postman if you have not already done so. After you have Postman enabled, you will want to download the Twitter API v2 collection. To learn more about getting started with the Postman and the Twitter API, check out our documentation on the subject.
Generating an OAuth 2.0 Token
For this tutorial, you will use OAuth 2.0 with PKCE to make requests on behalf of the Super Followers enabled account. To authenticate using OAuth 2.0, you must create an OAuth 2.0 token using the following step. First, In the “Manage Tweets” folder of the Twitter API v2 collection, go to the tab entitled “Authorization” and select “OAuth 2.0”.
In this tab, be sure to follow these steps:
- Name your token
- Select the Grant Type as Authorization Code (with PKCE)
- Update the parameters:
- Auth URL - https://twitter.com/i/oauth2/authorize
- Access Token URL - https://api.twitter.com/2/oauth2/token
- Callback URL - https://www.example.com (matching the callback URL I set in my auth settings page in the Developer Portal)
- Client ID - Cut and paste OAuth 2.0 client ID from the Developer Portal
- Review the proper scopes for Manage Tweets on this page.
- Update the scopes with the following values: tweet.read users.read tweet.write
- Populate the field state with “State”
- Click where it says “Generate Token”
- Press the save icon to save the folder changes.
You may get a message that you are not logged into Twitter. If you get this error, you will need to log in to the Twitter account inside of Postman you are trying to post on behalf of.
Tweet to your Super Followers
In the Postman Collection, you should find a sample request for “Manage Tweets.” Select the POST request called “Create a Tweet.”
You will want to go into that request and change the “Authorization” tab of the request and select “Inherit auth from parent” to ensure you are using the token you created in the last step.
Next, update the “Body” tab of the request to the following:
{
"text": "Hello, Super Followers!",
"for_super_followers_only": true
}
You can now press the blue button that says “Send” and see a response that looks like this one.
{
"data": {
"id": "1491508991335272449",
"text": "Hello, Super Followers!"
}
}
Next steps
Hopefully, this can be a starting point for you to get started with Tweeting programmatically to Super Followers using Postman and OAuth 2.0. To generate a code sample in the language of your choosing, click on the button in Postman that says “Code." Additionally, you may want to write some language to schedule specific Tweets on a schedule to your subscribers and run your code on a server.
Be sure to let us know on the forums if you run into any troubles along the way, or Tweet us at @TwitterDev if this tutorial inspires you to create anything.