0

I have previously used the OAuth1 class from the requests_oauthlib module to authorize my request to Twitter by passing my consumer key and consumer secret key as parameters to OAuth1 and creating an object.

However, I was wondering how I could do the same thing and add my keys to my endpoint without the use of the requests_oauthlib module or some other third party module. This is what I tried doing to build my endpoint:

url = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=" + handle + "&count=" + str(count) + '&consumerkey=' + consumer_key + '&consumersecret=' + consumer_secret

However, it seems that consumerkey and consumersecret are not valid parameters. How can I add my keys as parameters to my endpoint directly without using an authorization client in Python?

Manas Chaturvedi
  • 5,210
  • 18
  • 52
  • 104
  • What's the motivation for not using a library to handle the Oauth? It's required in order to access the twitter api for most of the interesting endpoints – Ereli Jul 15 '17 at 22:14
  • the [docs](https://dev.twitter.com/oauth/application-only) explain that bearer tokens are cannot be used for `/statuses` as they are to be used by apps that have not concept of “current user.” – Ereli Jul 15 '17 at 22:17
  • r@Ereli Just plain curiosity of how things would work without using an external OAuth client. – Manas Chaturvedi Jul 15 '17 at 22:21
  • If you'd like see how oauth is done, have a look at this question https://stackoverflow.com/a/24121216/1265980 – Ereli Jul 15 '17 at 22:27

0 Answers0