Skip to content

Establishing a Connection to the Meetup API

cjlarose edited this page Jul 16, 2012 · 5 revisions

The Meetup API supports several methods for authorization. The Meetup API Client for PHP supports API key authentication and OAuth.

Key-based authentication is the easiest way to get started with the client. You can get your api key at http://www.meetup.com/meetup_api/key/.

<?php
require_once('Meetup-API-client-for-PHP/Meetup.php');
$api_key = '12345';
$connection = new MeetupKeyAuthConnection($api_key);
$m = new MeetupEvents($connection);
$events = $m->getEvents( array( 'group_urlname' => '<GROUP URL NAME>' ) );

OAuth is a bit trickier, but the basic setup is the same once your get an access token:

<?php
require_once('Meetup-API-client-for-PHP/Meetup.php');
$access_token = $_SESSION['meetup_access_token'];
$connection = new MeetupOAuth2Connection($access_token);
$m = new MeetupEvents($connection);
$events = $m->getEvents( array( 'group_urlname' => '<GROUP URL NAME>' ) );

OAuth integration can be tricky, but we've created a handy page to help you set it up correctly.

Clone this wiki locally