Rest API for dummies

oauth
login

#1

Hello everyone,
I have to make a mobile application that would allow users to post a new status/tweet.
I thought it would be a good idea to use REST APIs for this. So I’ve been roaming on the dev website for hours, but now I’m more confused than ever.

What I got so far is that I have to make a request to https://api.twitter.com/1.1/statuses/update.json with additional POST data. In the header of my request I must add Authorization: $oauth where value would contain the user’s creditentials/token, and status=$message in the POST data.
Am I right?

The major issue I have with this is that I have no idea how to get ‘$oauth’, When I’m going on the dev website, I’m told to use a PIN login token, but I have no idea how to generate one for even myself, as the landing page tells me I’ve done something wrong.
How can I get necessary login info of the the user, in order to post a status?
The button ‘Login with twitter’ as mentionned in the doc only opens a web browser window, which is obviously not what I want.
Thanks in advance :grinning:


#2

The best advice I can provide here is to use an API library that automates the OAuth piece for you. Many of them provide code samples and tutorials that explain how to achieve this after plugging in your application token etc. I’m guessing that you want to use PHP for this since you refer to $variable in your post here.

We also have a gallery of sample applications which might provide ideas for you.