Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help for /1.1/users/lookup request #40

Open
msohaibali opened this issue Jul 21, 2020 · 0 comments
Open

Need help for /1.1/users/lookup request #40

msohaibali opened this issue Jul 21, 2020 · 0 comments

Comments

@msohaibali
Copy link

I am trying to do request on users/lookup route of Twitter API using params of Email/Phone. In the result I am getting error
Could not authenticate you. in response

While using the same credentials when i do request for screen_name, user_id lookup I am getting perfect Response. Not only that all other api requests like home_timeline, followers_ids, friends_ids, etc are working fine with same credentials but on that specific request, I am getting this error. My Request is:

import requests

url = "https://api.twitter.com/1.1/users/lookup.json?map=true&phone=1234567890"

payload = {}

headers = {
    'Authorization': 'OAuth realm="http%3A%2F%2Fapi.twitter.com",oauth_consumer_key="<consumer_key>",oauth_token="<outh_token>",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1595318479",oauth_nonce="<nonce>",oauth_version="1.0",oauth_signature="<sig>"'
}

response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))

In Response I am getting this Error:

{
    "errors": [
        {
            "code": 32,
            "message": "Could not authenticate you."
        }
    ]
}

What are the reasons and suggestions on this ?
Will appreciate the positive feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant