Which api url? Using Abraham's twitteroauth


#1

Hi, I’m currently using Abraham’s twitteroauth library. I really like it, but I’m confused about how the api v1 retirement affects it.

Out of the box, twitteroauth’s api url is set to: https://api.twitter.com/1/. But isn’t that v1, and isn’t it retired as of 3/05/2013?

But GET requests still work fine with it. However I have tried unsuccessfully to make a POST request: friendship/create which request gives me a 401 - “Could not authenticate you.”

If I change the api url to https://api.twitter.com/1.1/, regardless of whether my request is GET or POST I get a 400 - Bad authentication data.

Totally lost on this- very much appreciate any help. Thanks.


#2

The date for v1 retirement has not yet been announced. https://dev.twitter.com/blog/api-v1-retirement-update

To update to v1.1 you can simple change the url to https://api.twitter.com/1.1/ unti I get a new version of TwitterOAuth released.

Most methods will continue to work as expected. There are some methods that have different paths or required parameters so you should check what methods you are using and make sure you are conforming to v1.1.

It is hard to say why your requests are failing without seeing the code you are using. You might not have valid authentication information though.


#3

Hi Abraham, i’m using your app and i’m getting this “{“errors”:[{“message”:“Sorry, that page does not exist”,“code”:34}]}” When i’m trying to add some tweet to my favorites also when trying to retweet stuff.
This are the callings:

Favorite:
$content2 = $connection->post(‘favorites/create’, array(‘id’ => $tweet_id) );
Retweet:
$retweet = “statuses/retweet/”.$tweet_id;
$content2 = $connection->post($retweet);

Already switched the string from /1/ to /1.1/

I’d google this but i think i have the correct sintax already, but still can’t get it to work.


#4

@abraham i manage to pull all thing to work except one thing - update status. I mean, i can update status normaly but i want to have form on my site where user type status and when press Send button to update status. This work 101%: “<?php
$connection->post(‘statuses/update’, array(‘status’ => ‘grg’));
?>” but it post status automaticly when user accept app. I want form to get user to populate textarea and then send status…
If you or anybody can help me i will be happy…
Thank’s