Error 404 on GET (statuses/show)


#1

Hi I am not sure of whether anyone has had this problem, but iI’m using updated php libraries for the new API and can’t fetch data on GET (everything seems to be fine with POST).

Here’s some code:

require ‘tokens.php’;
require ‘oauth.php’;

$connection = new oauth(array(
‘consumer_key’ => $consumer_key,
‘consumer_secret’ => $consumer_secret,
‘user_token’ => $user_token,
‘user_secret’ => $user_secret
));

// Get the tweet from id (found in the API Guide)
$connection->request(‘GET’, $connection->url(‘1.1/statuses/show/’), array(
‘id’ => “” //id number here. I cut and pasted from a friends’s post so I am sure it exists
));
etc etc.
the response is always
"Error: 404 Array ( [errors] => Array ( [0] => Array ( [message] => Sorry, that page does not exist [code] => 34 ) ) )"

Any suggestion to resolve this would be very helpful. Thank you!


#2

resolved. Looked like a temporary issue


#3

This is happening for me. I am trying to call

https://api.twitter.com/1.1/statuses/show.json?id=
https://api.twitter.com/1.1/statuses/show/.json

Both fails with 404.


#4

Can you give an example of the exact URL you’re trying to execute, including the status id?


#5

by the way, the 404 error in the case of the code I posted is given by the array. You want to call this url
$connection->request(‘GET’, $connection->url(‘1.1/statuses/show/idnumber here’));
Hope it resolves your problem (it’s the same for statuses/show)


#6

This is the URL https://api.twitter.com/1.1/statuses/show.json?id=303421437610430460

By the way I am using X-Auth and working on migrating our App to API v1.1

This API is still working fine with 1.0 however giving 404 for 1.1.

All of the other APIs are working fine.


#7

I tried both way

https://api.twitter.com/1.1/statuses/show.json?id=303421437610430460
and
https://api.twitter.com/1.1/statuses/show/303421437610430460.json

Same result… 404


#8

There’s no tweet in existence with that ID: 303421437610430460 – which is why you’re getting a 404 when running that method.

Make sure that you’re using IDs properly – you might be accidentally munging them by consuming the integer instead of the string in “id_str” – some languages can’t consume our ID integers.


#9

try with a status from yours friends first. The number is in URL address of the tweet. https://twitter.com/ajithgeorge/status/81975408010084352
this is a random status from your contacts.

try:
https://api.twitter.com/1.1/statuses/show.json?id=81975408010084352


#10

Thanks @episod
That was the issue. I was always using id and never came across this problem. When I printed the API response I found that id and id_str are slightly different. See below.

“in_reply_to_status_id”: 303421437610430460,
“in_reply_to_status_id_str”: “303421437610430464”,


#11

I am afraid that that only happens to you. Here’s my call on th elast status by Sarasvati10:
Tweet: ‘Reinterpreting gesture as language book - http://t.co/RibAaWhe - #gesture #communication #linguistics’ id string= ‘303766879489650688’ id normal = ‘303766879489650688’