This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Introduction to Twitter's API Forum

View Course » View Exercise

1661 points
552747c39113cb5a1b00022c_650666179
Submitted by
Son Phan
over 2 years ago

Twitter API Intro 1/5 401 Error

When I tried to run Twitter, it then showed this error: Oops, try again. The response code should be '200' but you received '401'. Double check the credentials you passed to the OAuth library.


1 vote

permalink

me too, anyone?

179 points
939a77445519c4c1f735f2e407935d88?s=140&d=retro
Submitted by
Marcpowo
over 2 years ago

1 Comment

D2ab9ab2ab880e0ce230394f9bc88cbc?s=140&d=retro Martin over 2 years ago

Did you follow the steps here: "Visit https://dev.twitter.com/apps and register a new application.

On the application settings page, click "Create my access token" to generate an access token and secret.

Copy the values for consumer key, consumer secret, access token, and access secret into the example."

Make sure you create your app on the Twitter api page and generate the key pairs. Hope this is of help as I got the same error with the default code shown on the page.


0 votes

permalink

Make sure the following code is on your page require "json". I encountered this issue even after confirming my consumer token and secret & access token and secret were correct, and notice that the require json line was not there even after resetting the code. strange.

1509 points
4455bd3850c0bde913d7035515c04e26?s=140&d=retro
Submitted by
Anpena
about 2 years ago


0 votes

permalink

Another possibility is that you forgot to put " ",or instead you used ' ' .
this works: "axyuiyuixyue486",
this don't: 'axyuiyuixyue486'

Good Luck

50 points
F175191f901aea257f9e6ac7dcbc21bc?s=140&d=retro
Submitted by
Victor Augusto Souza de Oliveira
about 2 years ago