Skip to content

Latest commit

 

History

History
62 lines (34 loc) · 2.7 KB

twitter-bot-account-creation.md

File metadata and controls

62 lines (34 loc) · 2.7 KB

Configure Botkit and Twitter

Twitter is a constantly evolving platform, nominally you can find everything you need to create a bot on their platform page, but that information is subject to change.

Once installed, you will need to do steps 2-7 if you have not already. It helps to have your development environment and the Twitter for Developers page open at the same time.

2. Apply for a Developer Account

Visit Twitter Developer Access Page and apply for a developer account to access the Twitter APIs.

Screenshot of apply for a developer account in Twitter developer portal

3. Create a Twitter App

Visit Twitter Developer Portal and create a new app.

Screenshot of create app button in Twitter developer portal

  • fill out form and specify url where your webhook endpoint will be available

Screenshot of create app dialog

Screenshot of create app dialog

4. Allow Access to the Direct Messages

Navigate to your app and then Permission and edit the permission to allow read, write and Direct Message.

Screenshot of permission in Twitter portal

5. Get Access Tokens for your App

Navigate to your app and then Keys and Tokens to generate comsumer api keys as well as an access token and secret.

Screenshot of access tokens in Twitter portal

Copy this all keys and tokens, you'll need it when running your bot.

6. Set up a dev Environment

Navigate to the dev environments page of your Twitter developer account to set up an account activity dev environment.

Screenshot of dev environments in Twitter portal

Copy the label of the environment, you'll need it when running your bot.

7. Run your Application

Run your application with your environment variables set:

  • TWITTER_CONSUMER_KEY - Your Consumer Key (required)
  • TWITTER_CONSUMER_SECRET - Your Consumer Secret (required)
  • TWITTER_TOKEN - Your Access Token (required)
  • TWITTER_TOKEN_SECRET - Your Access Token Secret (required)
  • TWITTER_WEBHOOK_ENV - Your Development Environment Label (required)

If your application has been configured correctly, you will be able to subscribe to the account activity of your bot account and send tweets and messages in his name. Congratulations!

Additional resources