Introduction to Twitter's API
Sending a Tweet

Twitter applications have different access levels. Until now, the examples have only needed the default "read only" permission. However, to write a Tweet, an application needs "read and write" permission.

Update your app to this permission and use your new access level to send a Tweet! (Note that this will send the Tweet from the account which owns the app.)

Go to https://dev.twitter.com/apps and select the app you created in exercise 1. Click the 'settings' tab and change your application type to "read and write".

Click back to the 'details' tab and then regenerate your access token and secret.


Copy all four values (consumer key, consumer secret, access token, access secret) into the sample code.

Change the status parameter of the request to the text you wish to Tweet.

Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Twitter prevents users from sending the same content multiple times in a row. If you run the example with the same text twice, the second request will be rejected. Try updating the status parameter of the request.