How do I add twitter Oauth Signature to url - twitter

Essentially what I'm looking for is how to get the results like in this API request but by using just a url to make my results appear on a webpage. I think I need to add all of the data in the "request" Tab to the url written at the top of the picture and I'm not really sure how add it correctly:

You can't.
Twitter's API requires an "Authorization" header in the request. You can't do it through a URL alone. See Authorizing Requests.

Related

Extract Twitter using RapidMiner - Going beyond the limited "Search Twitter" Operator

I already have an account in Twitter Dev, which allowed me to get a Consumer Key and secret, which I used to generate my token. Now I am trying to send token in request for Twitter API by using the operators "Get Page", "Jason to XML" and "Write Document". However, I do not know which URL to write in the "Get Page" operator. Is it Request token URL Authorize URL or Access token URL ?
In general the request URL contains the REST API call, while you are providing your authorization credentials e.g. via request properties in the HTTP header, OAuth mechanisms and the like. An REST API call is build up on a base URL awaiting a call, in case of twitter https://api.twitter.com/1.1/search/tweets.json, combined with a state and HTTP options forming your request. If your searching for tweets from a given user account (like #twitterapi) your request URL part would look like q=%40twitterapi. Here a key q is given with the value %40twitterapi, where %40 is a representation of the '#' symbol.
Providing key-value-pairs via GET using the HTTP protocol is initialized with a leading '?'. Hence your REST request would look like this:
https://api.twitter.com/1.1/search/tweets.json?q=%40twitterapi. This example is taken from the Twitter documentation.
That's about the URL.
For the RapidMiner site, I'd try to use the Enrich Data by Webservice operator. You can fill in the url parameter with your request URL and set the HTTP header for using an authentication token using the request properties parameter. As a property use Authorization and for the value you use a string starting with Bearer followed by your token. So a potential value could be Bearer 943582034-IH3k6hlskfdj32l4hks.
You can choose betweent different query types (e.g., String Matching, Regular Expression and others) to define the handling of the received payload given as an response to your request.
Before playing around with the operator, you can try using a tool like Postman (Chrome Plugin) or HTTPrequester (Firefox Add-on) to work directly with the HTTP GET request and its response.
Sorry for not including more references, but Stackoverflow doesn't allow for more than two if your reputation is below 10...
I concur with the above - use the Enrich Data via Webservice operator. You'll need to download the Web Mining extension in order to see it. If you re-post on the RapidMiner user community forum, you may get more RapidMiner-specific help as well.

Simple example of Twitter api request

Could someone just show an example of simple twitter api request?
Apparently, i'm setting wrong headers, but i don't get what exactly is wrong.
URL:
'https://api.twitter.com/1.1/followers/ids.json?username=J7mbo'
Request headers:
{
'oauth_access_token': '...'
'oauth_access_token_secret': '...'
'consumer_key': '...'
'consumer_secret': '...'
}
Please, don't overcomplicate this with language-specific snippets or additional libraries. All i need is working REST api request.
If it's important, i'm using superagent, which means JavaScript.
If you are logged in and have a Application already registered then the form at the bottom of the page will show you an example.
https://dev.twitter.com/rest/reference/get/followers/ids
Any concrete example with specific headers would leak access to a twitter account and be invalid soon due to time stamps in the signing process.

Using Twitter api url to tweet

LinkedIn api provides access token to use it in url to post a message which uses oauth2 in Rest client. So by using the url in my application, i can post the message.
Twitter api uses oauth1 to tweet by accepting parameter.But the problem is timestamp,nounce,oauth_signature parameters gets auto generated and keep on changing for every request in Rest client.Here url is not sufficient to tweet, it need parameters but 3 parameters keep on changing on Rest client.
I tried to pass every parameter in url, it throws
error: code 32, could not authenticate you
i am dependent only on url to send a tweet.My application supports parameters too but three parameters are auto generating.I cant auto generate bcz i am hardcoding it in my application.
Is there any solution to tweet by using url?
Is there any way to make those 3 parameters fixed?
It's hard to tell what's going on here. Perhaps you could post more of the code and what you expected to happen?
By definition the nonce is a number only used once, and shouldn't be hardcoded. The timestamp also should reflect the current time on each request.
https://en.wikipedia.org/wiki/Cryptographic_nonce

swagger UI passing headers to API try out calls programmatically

All our services require an authentication token to be passed in a header. I know the correct way to go about that would be to use oauth but its not yet supported for our use case.
What I want to do is to get the token once by making a call to authentication service and then set it for all try out requests from swagger UI index page. There is enough documentation on how to pass a custom header to swagger API calls (the calls to get API info) but I couldn't find anything which would set a custom header for all the "try out" calls.
I will appreciate any advise.
Thanks,
Jas

How to pass facebook access token via AFNetworking

I am trying to make a GET request with AFNetworking to facebook's graph api. For various reasons, I'd rather not use the facebook SDK's native objects and would prefer to make those requests via AFNetworking. However, I'm a bit new to the networking side of things and I am unsure how to include the access token along with my GET request. Can anyone point me in the right direction?
I've tried setting the http header field to include this:
Authentication : {my access token}
but that doesn't seem to be working.
You need to add access_token as a URL query parameter for GET requests. See the docs here.

Resources