JIJoe
JIJoe

Reputation: 31

New to OAuth and using the Twitter API

So I wanted to play around with the Twitter API but I'm not sure how to get started. As I have understood, I need to send a POST to get a new Key which I then can use with GET requests:

  1. An application encodes its consumer key and secret into a specially encoded set of credentials.
  2. An application makes a request to the POST oauth2 / token endpoint to exchange these credentials for a bearer token.
  3. When accessing the REST API, the application uses the bearer token to authenticate.

The problem is that I don't know what they mean with encode. More specific how do I do this? I also tried creating a POST with the Postman application like this: Postman

Obviously these aren't my real keys, but you get my idea, the result is the same. The Authroization header looks like this:

OAuth oauth_consumer_key="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",oauth_token="ccccccccccccccccccccccccccccccccccccccc",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1475662697",oauth_nonce="uApwp7",oauth_signature="OxgxMdPtUIYuKvVKYZbIooW7cMw%3D"

Upvotes: 1

Views: 187

Answers (1)

Abhishek Ramachandran
Abhishek Ramachandran

Reputation: 1170

Try out this:-

Give values to Consumer Key (your app key), Consumer Secret (your app secret), Signature Method (HMAC-SHA1), Version (1.0). Timestamp and nonce are autogenerated values. Mark Add params to header. It will automatically generate authorization header when you click send.

Postman Sample

Upvotes: 3

Related Questions