Retrieve a bearer token for Twitter API authentication - Discovering Hot Topics using Machine Learning

Retrieve a bearer token for Twitter API authentication

Use the following procedure to create a bearer token for Twitter API access.

  1. Create an account on Twitter’s Developer Portal, then create a new Application under Project & App.

  2. After the app is approved by Twitter, you can find the bearer token under the Keys and tokens tab on the Application’s dashboard page. If you don’t see the bearer token on that page, select Generate or Regenerate to generate the bearer token.

  3. Copy the token string and store it in the Systems Manager Parameter Store under the key path as configured during CloudFormation deployment.

Use the following procedure to rotate the bearer token.

  1. Navigate to the Keys and tokens tab under the Application’s dashboard page.

  2. Choose Regenerate for the bearer token.

  3. Copy the token string and update the Value for the existing Systems Manager Parameter Store key path configured during deployment.

    Note

    The Value, should be stored as SecureString Type.

For more information about bearer tokens, refer to the Twitter developer guide.