the creative internet technology co.

How to Generate the API Key, API Secret, Access Token and Access Token Secret for Twitter OAuth

Thursday, 19 June 2014

If you want to create a customised Twitter feed for your website, rather than using the copy-and-paste code from the Twitter Widgets pages - you need to get the required authorisation codes from Twitter.

We need four things:
  1. ·         API key
  2. ·         API secret
  3. ·         Access token
  4. ·         Access token secret
Each is a long string of numbers and letters something like this: lhAZTN7pg0AyElFtyVT1vONgI9rdEoAliEOv09KPbs1Sv

Here's how you get them:
  1. Go to https://dev.twitter.com/apps/new
  2. Give your new "Application" a name and description (anything you like - it's not important, but it might be something like "My feed for Wordpress widget") and enter your website address. You can leave the callback URL empty.
  3. Accept the terms and click the "Create" button.
  4. Click on the "API keys" tab
  5. Here you will find the API key and the API secret. Carefully copy (Ctrl+C) and paste (Ctrl+V) them into a safe place so you can send them in an email to your website developer.
  6.  Scroll down and click the "Create my access token" button
  7. You'll see a message telling you may need to refresh the page, so go ahead and do so
  8. When you scroll down to the bottom of the page again, you'll find your Access token and Access token secret.
  9. Again, copy and paste them into a safe place
  10. Send them to your website developer to work some magic