PHP code example of dms / meetup-api-client
1. Go to this page and download the library: Download dms/meetup-api-client library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dms / meetup-api-client example snippets
// Key Authentication
$client = MeetupKeyAuthClient::factory(array('key' => 'my-meetup-key'));
// OAuth Authentication
$config = array(
'consumer_key' => 'consumer-key',
'consumer_secret' => '*****',
'token' => '*****',
'token_secret' => '*****',
);
$client = MeetupOAuthClient::factory($config);
// OAuth2 Authentication
$config = array(
'access_token' => 'access_token',
);
$client = MeetupOAuth2Client::factory($config);
$client = MeetupKeyAuthClient::factory(array('key' => 'my-meetup-key'));
// Use our __call method (auto-complete provided)
$response = $client->getRsvps(array('event_id' => 'the-event-id'));
foreach ($response as $responseItem) {
echo $responseItem['member']['name'] . PHP_EOL;
}
$client = MeetupKeyAuthClient::factory(array('key' => 'my-meetup-key'));
//Retrieve the Command from Guzzle
$command = $client->getCommand('GetRsvps', array('event_id' => 'the-event-id'));
$command->prepare();
$response = $command->execute();
foreach ($response as $responseItem) {
echo $responseItem['member']['name'] . PHP_EOL;
}
$rsvps = $client->getRsvps(array('event_id' => 'the-event-id'));
foreach ($rsvps as $rsvp) {
echo $rsvp['member']['name'] . PHP_EOL;
}
$metadata = $response->getMetaData();
echo "Debug Url:" . $metadata['url'];
$rsvp = $client->getRsvp(array('id' => 'rsvp-id'));
echo "RSVP? " . $rsvp['response'];
echo "StatusCode: " . $rsvp->getStatusCode();
$client = MeetupKeyAuthClient::factory(array(
'key' => 'my-meetup-key',
'rate_limit_factor' => 0.75
));
$client = MeetupKeyAuthClient::factory(array(
'key' => 'my-meetup-key',
'disable_rate_limiting' => true
));