Aerodynamika
Aerodynamika

Reputation: 8423

How to query Twitter API right?

In my current app I'm querying Twitter API using those parameters (twit Node.Js module):

var T = new Twit({
    consumer_key:         'xxx'
    , consumer_secret:      'xxx'
    , access_token:         'xxxx'
    , access_token_secret:  'xxx'
});

This allows me to get the data only for the user whose settings are above, however, how do I authorize another user in Twitter and use their access token and secret?

Thank you!

Upvotes: 0

Views: 101

Answers (1)

Romain Huet
Romain Huet

Reputation: 1193

For a Twitter user to become a user of your application, you must ask them for permission.

The consumer key and consumer secret in the parameters you mentioned identify your application. These credentials are necessary for any requests you are performing on the Twitter API, so they will remain the same.

The access token and access token secret identify a Twitter user. This couple will be different for every user of your application. You will want users to sign in using their own Twitter account and obtain an access token for them. This way, your application will be able to interact with their account.

Read more about Implementing Sign in with Twitter and Troubleshooting OAuth 1.0A.

Upvotes: 1

Related Questions