Twitter is also popular for its App integration abilities through API. This post will show how to create and set up a Twitter App to be able to use Twitter's API.
Table of contents
The API (application programming interface) is the interface between a programmed request and Twitter. Twitter processes these requests through its Apps infrastructure.
This post showed the Twitter App settings to access the API. Using the API key, API secret, Access token and Access token secret, requests can be sent to Twitter, through for example Python, to send posts and/or get data back. This request will be sent to an App and the App will process the request.
This means that by using the correct information (obtained from the process), requests can be sent to Twitter through, for example, a programming language (e.g. Python) to post data (Tweet) and/or to receive data back. This request will be sent to an App and the App will process the request.
Various programming languages can be used for the programming side of the Twitter API. This post will show how to create and set up a Twitter App and how to obtain the correct information to be able to send requests.
A Twitter App is not actually an App per se, but basically, a bunch of settings to obtain the required information to use Twitter’s API.
In order to create a Twitter App, a mobile phone needs to be added to the Twitter profile.
Multiple Apps can be created per Twitter account.
Creating an App on Twitter
Start off by logging into the Twitter account the App is to be created for.
Next, open the Twitter Application Manager. Click on the Create New App button and complete the required fields (i.e. leave the Callback URL empty) and click on the Create your Twitter Application button.
As is the case with some other social media App Managers, the Name of the App does not show up anywhere on the Tweet.
Twitter App configuration
After seeing “Your application has been created. Please take a moment to review and adjust your application’s settings” do the following:
By default, all App’s access levels are read-only. To post to Twitter, write permissions will be required. Go to the Permissions tab and choose Read and Write access before clicking on the Update Settings button. The permission settings may take a moment to reflect.
Access tokens and keys are needed to access a Twitter account without having to supply usernames and passwords. Go to the Keys and Access Tokens tab. At the bottom, under Your Access Token there will be no authorised applications for the account, yet.
By clicking Create my access token, an access token will be generated. It will be assigned to the application’s current permission level and should be updated each time the permission has been changed.
After the access token has been created, all the following strings will be available:
- Consumer Key (API Key)
- Consumer Secret (API Secret)
- Access Token
- Access Token Secret
Using the keys and access tokens
The API key, API secret, Access token and Access token secret can now be used to access the Twitter API. Programming libraries, such as Tweepy and Twython (both Python-based), can now use this information to construct Tweets and post them.
This post showed the Twitter App settings to access the API. Using the API key, API secret, Access token, and Access token secret, requests can be sent to Twitter, through for example Python, to send posts and/or get data back. This request will be sent to an App and the App will process the request.