Abhishek Prakash

Creating a Tweet using Twitter API v2 in Postman

31 August 20221 min read232 words

This blog is intended for anyone who wants to learn about how to get started with Twitter API v2.

Table of Contents

  1. Signup for Developer Account and generate credentials
  2. Creating a tweet using Postman

Signup for developer account and generate credentials

  1. Sign in to your twiiter account.
  2. Go to developer.twitter.com and sign up for a developer account.
  3. After signup, create an app to get API Key, API Secret, Access Token and Access Token Secret.
  4. Before creating API Key and API Secret, apply for elevated access (otherwise we can only do limited things with the API, posting tweets is allowed only with elevated access. You can easily get elevated access if you don't plan to develop for any government organization.)
  5. Setup User Authentication Settings.

    • Use Read and write and Direct message for App Permissions.
    • Use Web App, Automated App or Bot for Type of App.
    • Use https://localhost for Callback URI / Redirect URL.
    • Put any website for Website URL.
  6. Use Twitter API v2 colletion on on Postman.

Creating a tweet using Postman

  1. In Twitter API v2, Under Manage Tweets, select Create a Tweet.
  2. Populate Consumer Key (API Key), Consumer Secret (API Secret), Access Token and Access Secret (which we created earlier)

    Populate Keys image

  3. Go to Body and change text to whatever you require in tweet.

    {
       "text": "Hello World!"
    }
  4. Click on Send button and tweet will be created.
Tagged with api, postman, twitter

avatarAbhishek Prakash is a Salesforce Developer since 2017, living in Bengaluru, India. Know more about him here.