• Register
0 votes
49 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

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 222 views
222 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 jwilliam 3.9k points
0 votes
1 answer 294 views
294 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 jwilliam 3.9k points
0 votes
1 answer 272 views
272 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 81 views
81 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 24 views
24 views
Problem: I am new to Geocoding. I want to program the geocoding. I have already created the API key but if I add it into my current website code then surprisingly I do not get anything and if I do not use the API then somehow everything starts working again. Whenever ... Google Maps Geocoding API is turned on. Kindly tell me if the API key has to be activated also somewhere else to make it work?
asked Jun 17 Raphael Pacheco 4.9k points