Spaces

Method: spaces()

Spaces allow expression and interaction via live audio conversation.

$twitter = new BirdElephant($credentials);

$spaces = $twitter->spaces()->lookup();

Get a Space

Method: getSpace()

Lookup a space by id

$spaces->getspace($space_id, $params);
ArgumentTypeDescription
$space_idStringThe Space Idrequired
$paramsArraysee Twitter docs for avilable query parametersoptional

Get Multiple Spaces

Method: getSpaces()

Look up multiple spaces by id

$spaces->getspaces($space_ids, $params);
ArgumentTypeDescription
$space_idsArrayThe Space Idsrequired
$paramsArraysee Twitter docs for avilable query parametersoptional

Discover Spaces

Method: discover()

lookup live or scheduled Spaces created by the specified user IDs

$spaces->discover($creator_ids, $params);
ArgumentTypeDescription
$creator_idsArrayCreator user Idsrequired
$paramsArraySee Twitter docs for avilable query parametersoptional

View Buyers

Method: buyers()

Returns a list of user who purchased a ticket to the requested Space. You must authenticate the request using the Access Token of the creator of the requested Space.

$spaces->buyers($space_id, $params);
ArgumentTypeDescription
$space_idStringThe Space Idrequired
$paramsArraysee Twitter docs for avilable query parametersoptional

Examples

use Coderjerk\BirdElephant\BirdElephant;

$twitter = new BirdElephant($credentials);

//lookup a space by space id

$params = [
    'space.fields' => 'creator_id, id,  invited_user_ids, participant_count, speaker_ids',
    'user.fields' => 'description, entities, id, location, name, pinned_tweet_id, profile_image_url'
]

$space = $twitter->spaces()->lookup()->getspace($space_id, $params);

// lookup multiple spaces by id
$space_ids = [
    $space_id_1,
    $space_id_2
];

$spaces = $twitter->spaces()->lookup()->getspaces($space_ids, $params);

// lookup live or scheduled Spaces created by the specified user IDs
$creator_ids = [
    $creator_id_1,
    $creator_id_1
];

$spaces = $twitter->spaces()->lookup()->discover($creator_ids, $params);

Reference

Edit this page on GitHub Updated at Sat, Jun 18, 2022