I’m using Abraham\TwitterOAuth which is found here: https://twitteroauth.com/
I authenticate a user like this:
$twitteroauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $token, $secret);
$twitteroauth->setTimeouts(15, 55);
$user = $twitteroauth->get("account/verify_credentials");
Then from there I check to make sure it’s not a negative response (ie: Invalid or expired token)
Once it’s all set, I then go head basically two two primary functions from the library.
First is:
$t = $twitteroauth->post(“statuses/retweet”, [“id” => trim($retweet_id)]);
as well as:
$l = $twitteroauth->post(‘favorites/create’, [“id” => trim($retweet_id)]);
It’s my belief that it does in fact actually set the data id correctly and allows the retweet to happen. Because in fact it does happen - otherwise how would I get the id back from the json response? Impossible - unless I’m wrong.
And when we move on to the [retweet_status], isn’t that the wrong response area to be checking? Instead it should be checking [retweeted] inside the response of:
$t = $twitteroauth->post(“statuses/retweet”, [“id” => trim($retweet_id)]);
And in fact I am using the correct call to check the status of [retweeted] because when I pass an id to the call which looks like this:
$twitteroauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $token, $secret);
$user = $twitteroauth->get("account/verify_credentials");
if($user->id != ''){
$t = $twitteroauth->get("statuses/show", ["id" => trim('809833520092692480')]);
echo "<pre>";
print_r($t);
echo "</pre>";
exit;
}
I get the same json data returned.