Statuses/show/:id returns "Sorry, that page does not exist, code: 34"


#1

I’m using statuses/show/:id to fetch a Tweet object via its ID. However, I keep getting the following error.

“Sorry, that page does not exist’, code: 34”

I’ve been looking for solutions, but they all usually lead back to the GET method being written incorrectly. I’ve double checked, though, and am pretty sure I’m writing it correctly.

T.get(‘statuses/show/:id’, { id: ‘759043035355312128’ }, function(err, data, response) {
console.log(err);
console.log(data);
});

I’ve also tried inputting the ID as an int, to no avail. Any ideas?


#2

it is common issue , i also faced this issue need seniors guidance


#3

It seems that hardcoding the ID into the statuses/show/:id line works as a temporary solution. Regardless, I’d still like to know where I was going wrong before if anybody has any insight.

T.get(‘statuses/show/’ + ‘759043035355312128’ , function(err, data, response) {
console.log(err);
console.log(data);
});


#4
T.get(‘statuses/show/:id’, { id: ‘759043035355312128’ }, ...);

The above function will, I believe, will resolve to the following API call:

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

It is telling Twitter to show the status with ID :id and ID 759043035355312128. Obviously :id is not a valid ID but it is in the URL path so it’s taking precedence.

You’ll want to do one of the following:

    T.get(‘statuses/show’, { id: ‘759043035355312128’ }, ...);

    T.get(‘statuses/show/’ + ‘759043035355312128’, ...);

#5

Perfect, that makes sense! Thanks, abraham.


#6