Hi all,
I am simply trying to upload and attach an image to a tweet using update with media and keep running in to the same error
‘{“errors”:[{“message”:“Sorry, that page does not exist”,“code”:34}]}’ (length=68)
I have tried several solutions online but can’t seem to crack it as I thought the process was quite simple. Sorry If I’m missing something obvious but any light you could shed on this would be awesome.
Code:
require(“twitteroauth/twitteroauth.php”);
session_start();
$twitteroauth = new TwitterOAuth(‘XXXXXXXXXXXXXXXX’, ‘XXXXXXXXXXXXXXX’, $_SESSION[‘oauth_token’], $_SESSION[‘oauth_token_secret’]);
$image = ‘image.jpeg’;
echo ‘Test’;
$code = $twitteroauth->oAuthRequest(
‘POST’,
‘https://upload.twitter.com/1/statuses/update_with_media.json’,
array(
‘media[]’ => “@{$image};type=image/jpeg;filename={$image}”,
‘status’ => ‘Standard Tweet’,
),
true, // use auth
true // multipart
);
echo ‘Test’;
var_dump($code);
if ($code == 200) {
json_decode($twitteroauth->response[‘response’]);
} else {
($twitteroauth->response[‘response’]);
echo “try again”;
}