The most popular PHP library for use with the Twitter OAuth REST API.
Change the third argument of callers from a boolean to an array
+ $connection->post("tweets", ["text" => $text], ['jsonPayload' => true]);
- $connection->post("tweets", ["text" => $text], true);
$connection->upload(
'media/upload',
['media' => $file_path, 'media_type' => 'video/mp4'],
+ ['chunkedUpload' => true],
- true
);
Default v2 to JSON payload
Default to Twitter API v2.
For v1 APIs you can switch back using:
$connection->setApiVersion('1.1');
Require PHP 8
random_int
apiUrl
to protected. Overriding apiUrl
is not officially supported.