Spaces
spaces()
Method: Spaces allow expression and interaction via live audio conversation.
$twitter = new BirdElephant($credentials);
$spaces = $twitter->spaces()->lookup();
Get a Space
getSpace()
Method: Lookup a space by id
$spaces->getspace($space_id, $params);
Argument | Type | Description | |
---|---|---|---|
$space_id | String | The Space Id | required |
$params | Array | see Twitter docs for avilable query parameters | optional |
Get Multiple Spaces
getSpaces()
Method: Look up multiple spaces by id
$spaces->getspaces($space_ids, $params);
Argument | Type | Description | |
---|---|---|---|
$space_ids | Array | The Space Ids | required |
$params | Array | see Twitter docs for avilable query parameters | optional |
Discover Spaces
discover()
Method: lookup live or scheduled Spaces created by the specified user IDs
$spaces->discover($creator_ids, $params);
Argument | Type | Description | |
---|---|---|---|
$creator_ids | Array | Creator user Ids | required |
$params | Array | See Twitter docs for avilable query parameters | optional |
View Buyers
buyers()
Method: 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);
Argument | Type | Description | |
---|---|---|---|
$space_id | String | The Space Id | required |
$params | Array | see Twitter docs for avilable query parameters | optional |
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);