Skip to content
This repository

Pure PHP client for the Meetup API

branch: master

Merge pull request #10 from desmondmorris/master

Include the vendor directory
latest commit 760113eb65
Ben Lobaugh authored
Octocat-spinner-32 vendor Add vendor directory
Octocat-spinner-32 .gitignore Remove vendor directory from ignore file. This will make it easier fo…
Octocat-spinner-32 BrainDump Adding the initial files for the Meetup API client for PHP
Octocat-spinner-32 Meetup.php Composer Support
Octocat-spinner-32 MeetupApiRequest.class.php MeetupConnection is now an abstract class with two implementing class…
Octocat-spinner-32 MeetupApiResponse.class.php Fixed a json_decode issue when operating on large objects
Octocat-spinner-32 MeetupCheckins.class.php Adding the initial files for the Meetup API client for PHP
Octocat-spinner-32 MeetupConnection.class.php Remove debugging "echo" calls
Octocat-spinner-32 MeetupEvents.class.php Adding the initial files for the Meetup API client for PHP
Octocat-spinner-32 MeetupExceptions.class.php Adding the initial files for the Meetup API client for PHP
Octocat-spinner-32 MeetupFeeds.class.php Remove debugging "echo" calls
Octocat-spinner-32 MeetupGroups.class.php Remove debugging "echo" calls
Octocat-spinner-32 MeetupMembers.class.php Remove debugging "echo" calls
Octocat-spinner-32 MeetupOAuth2Helper.class.php Added support for refreshing access tokens in MeetupOAuth2Helper
Octocat-spinner-32 MeetupPhotos.class.php Remove debugging "echo" calls
Octocat-spinner-32 MeetupRsvps.class.php Remove debugging "echo" calls
Octocat-spinner-32 MeetupTopics.class.php Remove debugging "echo" calls
Octocat-spinner-32 MeetupVenues.class.php Remove debugging "echo" calls
Octocat-spinner-32 README.md Updated README.md to reflect connection changes
Octocat-spinner-32 composer.json Composer Support
Octocat-spinner-32 composer.lock Composer Support
README.md

Meetup API client for PHP

Meetup (http://meetup.com) is a social networking site based around community groups. Meetup provides an API to access their platform services from remote applications to manage authentication, events, rsvps and more.

Until now a good PHP client for the Meetup API has not existed. This project aims to bridge that gap by providing a high quality stand alone Meetup API PHP client. This client is simple to use through provided classes and also allows powerful advanced usage through direct queries to the API

NOTE: This project currently only supports GET requests to the Meetup API

Supported endpoints

/2/checkins /2/events /2/event /2/open_events /2/event_comments /2/event_ratings /activity /2/groups /comments /2/members /2/member /2/profiles /2/photo_comments /2/photo_albums /2/photos /2/rsvps /topics /2/open_venues /2/venues

Documentation

Full documentation can be found on the Github project wiki at https://github.com/blobaugh/Meetup-API-client-for-PHP/wiki

How to setup the library

  • Download the files from Github and place them in the PHP application directory
  • * I.E. /var/www/myapp/Meetup-API-client-for-PHP
  • Include the Meetup.php file in your application
  • * I.E. In /var/www/myapp/index.php
  • * Use require_once('Meetup-API-client-for-PHP/Meetup.php');
  • Establish a connection to the API with your Meetup API key, available at http://www.meetup.com/meetup_api/key/
  • * $meetup_api_key = '';
  • * $connection = new MeetupKeyAuthConnection($meetup_api_key);
  • Begin using the new Meetup functionality in your application!

Using the pre-built endpoint classes

The Meetup API client for PHP allows developers to make direct calls to the Meetup API, however for convenience several helper classes have been created. Each class corresponds directly to a grouping of endpoints from the Meetup API documentation. These classes take an associative array of parameters that correspond to the parameters in the Meetup API documentation.

Example: Accessing all Meetup events for user Ben Lobaugh with ID 14508967. See http://www.meetup.com/meetup_api/docs/2/events/ for additional parameters and response format

$m = new MeetupEvents($connection); $events = $m->getEvents( array( 'member_id' => '14508967' ) );

$events will be in the form of an associative array

Consult the Meetup API documentation for parameters used by each endpoint http://www.meetup.com/meetup_api/docs

Direct queries to the Meetup API

The Meetup API client for PHP supports direct API queries if a helper class is not available. Queries are sent to the MeetupApiRequest class and data recieved from the Meetup API will be returned in the MeetupApiResponse class. The MeetupApiResponse object will contain the HTTP code and API response. To use the MeetupApiReponse class a developer simply calls the query method with an endpoint and parameters.

Example: Accessing all Meetup events for user Ben Lobaugh with ID 14508967. See http://www.meetup.com/meetup_api/docs/2/events/ for additional parameters and response format

$m = new MeetupApiRequest($connection); $events = $m->query( MEETUP_ENDPOINT_EVENTS, array( 'member_id' => '14508967' ) );

$events will be a MeetupApiResponse object that can be access like an array (E.G. $events['results']) or used in a loop to view each event entry (E.G. foreach( $events AS $event ) ) The HTTP response code can be checked with $events->getHttpCode()

Exceptions

Exceptions will usually occur when an invalid API request is recieved. The following is a list of all the Meetup API client for PHP specific exceptions

  • MeetupInvalidParametersException - Invalid or missing parameters passed to the API endpoint
  • MeetupBadRequestException - Problem with the request
  • MeetupUnauthorizedRequestException - Invalid API key
  • MeetupInternalServerErrorException - Problem exists with the Meetup API server

Development Roadmap

  • oAuth integration - High priority
  • POST support
  • everywhere endpoints implementation

If you would like to see specific new developments please feel free to contribute through code of financial incentives.

Something went wrong with that request. Please try again.