• Register
0 votes
62 views

Problem :

According to the following documents:

https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline.html

I have the oauth user token and the user token secret, plus I have my app credentials...

The docs state that the authentication is supported by Twitter, but how should I include it in the get requests for screen names those are not publicly accessible?

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

If I understand your question correctly, you need to be able to get the tweets from a third-party user who is with the OAuth token and having the secrets belonging to a user on your site. And the tweets from the third-party users are not obviously publicly accessible, but your user is having all the access rights to them. Am I correct?

So if you need to access private resources on behalf of your user, you must  sign the request with the OAuth token and with your application credentials. Then the Twitter can check, which user is signed in to your site and if the user have given your site the required access rights.

Then that signature is sent within the header of your GET request in a format as following:

e.g.

Authorization: 
OAuth oauth_consumer_key="xvz1evFS4wEEPTGEFPHBog", oauth_nonce="kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg", oauth_signature="tnnArxj06cWHq44gCs1OSKk%2FjLY%3D", 
oauth_signature_method="HMAC-SHA1", 
oauth_timestamp="1318622958", 
oauth_token="370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb", 
oauth_version="1.0"

Further Readings :

There is also documentation from Twitter on how to calculate the signature as follows:

https://developer.twitter.com/en/docs/basics/authentication/guides/creating-a-signature

9 7 4
38,600 points

Related questions

0 votes
1 answer 366 views
366 views
Problem : Currently I am trying to display a JSON content using a API key. But I am unable to get a authentication. I am facing below error in my JsonObject: “Org.json.JSONException: Value Authorization of type java.lang.String cannot be converted to JSONObject” In my ... to pass a API key and URL id to get my JSON response in a URL. I display a JSON content using a JSON array.
asked Feb 2, 2020 jwilliam 3.9k points
0 votes
1 answer 395 views
395 views
Problem : I am facing error “Expecting value: line 1 column 1 (char 0)” when trying to decode the JSON.The URL I use for a API call works fine in a browser, but gives above error when done through the curl request. The error happens at the return simplejson.loads(response_json)
asked Jan 20, 2020 jwilliam 3.9k points
0 votes
1 answer 9 views
9 views
Problem: OS: Windows 8 64bit with the latest update. Objective: Run Python.exe with Powershell as an administrator. I've changed the path to include the script but when I try to open Python I get an error code. I receive the same error during the installation.
asked Jan 8 Mashhoodch 5.6k points
0 votes
1 answer 91 views
91 views
Problem : I have updated my Android Studio to 3.0 but now facing the lot of issues.. So now stopped on the point with below issue: Could not resolve all files for configuration ':applib:_lintClassPath'. > Could not find com.android.tools.lint:lint-gradle:26.1.0-alpha01. ... project :applib I am currently using latest gradle version as: "gradle-4.2.1-all.zip". Does anyone know what my issue can be?
asked Dec 17, 2019 alecxe 7.5k points
0 votes
1 answer 7 views
7 views
I was working on that but I got into some problems.
asked Nov 30, 2020 TeamScript 9.3k points
0 votes
1 answer 11 views
11 views
I was working on that. I just want to know how to do that?
asked Nov 30, 2020 TeamScript 9.3k points
0 votes
1 answer 31 views
31 views
I was working on that. I just want to know how to do that?
asked Nov 30, 2020 TeamScript 9.3k points
0 votes
1 answer 11 views
11 views
Hello all! I’m newbie programmer. Currently I’m working with jSON to fetch some data for my new project.But I’ve stucked with some problems. I’m trying using getJSON method to get value of it. Need help. Any help will be appreciated. What I want to get is jobDescription’s value. {"JobData":{"JobDescription":"Cashier Wanted","JobSearch":"Search"}}
asked Oct 27, 2020 mrain 120 points
0 votes
1 answer 391 views
391 views
Problem : I have spent over the 10 hours in finding the exception or the special character to find in the code but I am unable to find it. I have already checked every similar messages in here. I am facing below error: Syntaxerror: json.parse: unexpected character at line 1 ... my form after that I am sending all the inputs to the main.js to validate it. So, I am just looking for the third-eye.
asked Dec 23, 2019 alecxe 7.5k points
0 votes
1 answer 7 views
7 views
Some Web API interview questions
asked Dec 3, 2020 Lucky Guy 930 points