OAuth Authentication with Twitter API via R failed!


I used R’s packages ‘twitteR’ and ‘ROAuth’ to access Twitter API. I tried this R code to register my R session:


I used http instead of https because the latter gave me an error of SSL certification fail. Then, I enter a PIN code obtained from a given URL and registered with Twitter:

The result of the above command was:

[1] TRUE
I think that I successfully registered using OAuth. However, when I tried to access protected users’ profiles, for example,


I got this:

[1] “{“error”:“Not authorized”,“request”:”\/1\/followers\/ids.json?cursor=-1&user_id=XXXXXXXX"}"

I also checked my verification by using:


And this was the result:

[1] “{“error”:“Could not authenticate you.”,“request”:”\/1\/account\/verify_credentials.json"}"

Would you mind helping me please? Thank you very much.


Well I certainly have no prior experience with R, so let me know if I’m completely off base, but from looking at the library documentation I found here: http://cran.r-project.org/web/packages/twitteR/twitteR.pdf

It appears that getURL isn’t a method in the library - are you sure that calling it is performing all of the appropriate OAuth signing?

Do the library methods work for you? For example, “getFollowerIDs”?


Hi sorry bother i think someone keeps unfollowing who i follow and following. Olease could u veryify my account.i had problems for months and i think i know who. Please add a blue check to my profile thanks really appriciate it. Now i see when i reset who three are. Thanks for ur help.