twitteroauth icon indicating copy to clipboard operation
twitteroauth copied to clipboard

Support additional API hosts

Open abraham opened this issue 7 years ago • 3 comments

Twitter has since added a number of additional hosts that are used and they need to be supported.

A potential design could look something like this:

$twitteroauth->subdomain('version').method('path', params);

$t->api->get(...); // https://api.twitter.com/1.1
$t->api('1.1')->get(...); // https://api.twitter.com/1.1
$t->api('labs/1')->get(...); // https://api.twitter.com/labs/1
$t->dataApi->post(...); // https://data-api.twitter.com
$t->upload->post(...); // https://upload.twitter.com
$t->adsApi->post(...); // https://ads-api.twitter.com/7
$t->gnipApi->post(...); // https://ads-api.twitter.com
$t->oauth->get(...); // https://oauth.twitter.com
$t->ton->get(...); // https://oauth.twitter.com
$t->stream->get(...); // https://stream.twitter.com
$t->gnipStream->get(...); // https://gnip-stream.twitter.com

Methods to support

  • GET
  • POST
  • DELETE
  • PUT

Authentication to support

  • oauth 1
  • oauth 2
  • basic auth

Payload types to support

  • json
  • html form
  • media

TODO:

  • [ ] Audit Twitter docs for all the hosts that need to be tested.

abraham avatar Jul 03 '18 18:07 abraham

Hello Abraham,

Thanks a lot for your effort for adding additional hosts. I want data-api.twitter.com for impression count, so may I know when we got the updated package.

Thanks

hiranipradeep avatar Jul 04 '18 06:07 hiranipradeep

This will be great! When we can have this?

dpereiraegoi avatar May 18 '20 15:05 dpereiraegoi

It's not officially supported but you can override apiUrl in 3.1.0 and later which will allow custom API hosts.

abraham avatar Jul 19 '21 00:07 abraham

TwitterOAuth is in maintenance mode and major improvements are no longer planned. https://github.com/abraham/twitteroauth/issues/1188

abraham avatar Jul 24 '23 03:07 abraham