Hey developers of the bird app,

After fighting with this example for a while, I couldn’t manage to set it up properly…

I’m trying to implement this on an express backend, check the following code out:

const res = await fetch('https://api.twitter.com/oauth/request_token', {
  method: 'POST',
  headers: {
    Authorization:
      "OAuth oauth_nonce='K7ny27JTpKVsTgdyLdDfmQQWVLERj2zAK5BslRsqyw', oauth_callback='http%3A%2F%2Fmyapp.com%3A3005%2Ftwitter%2Fprocess_callback', oauth_signature_method='HMAC-SHA1', oauth_timestamp='1300228849', oauth_consumer_key='consumer_key', oauth_signature='consumer_secret', oauth_version='1.0'",
  },
});

Curious is there a problem with the code above? I’ve been fighting for 3 hours…

Thanks!

The callback url has to be the callback url you define in your app settings, and also - i would not write out the authorization headers etc manually like that - i would instead use a twitter API library or OAuth library. OAuth headers can get very error prone to implement yourself. The example in the docs is more “illustrative”

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.