4

I am trying to make a POST request to this endpoint: https://api.twitter.com/oauth/request_token (as a first step of implementing Twitter sign in)

As it says in the docs: https://dev.twitter.com/oauth/reference/post/oauth/request_token that does not require authentication. However, when I try it, I get the following response:

{
    "errors": [
        {
            "code": 215,
            "message": "Bad Authentication data."
        }
    ]
}

Obviously I'm doing something wrong. I have a registered app and the consumer key/secret that goes with it and I'm not sure whether I need to use those somehow (in which case it's odd that it says in the docs that this endpoint does not require authentication).

Anyone has experience with this?

EDIT: Request example

curl -X POST -d "{'oauth_callback':'http://www.callback-url.com/'}" --header "Content-Type:application/json" https://api.twitter.com/oauth/request_token

Also tried without setting the Content-Type header.

1
  • We won't be able to help if we can't see the request that you're sending.
    – DWRoelands
    Dec 12, 2016 at 20:33

1 Answer 1

5

You need to construct a full OAuth authentication string and put it in the header of the request. See POST oauth/request_token for an example.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.