MeetupPS icon indicating copy to clipboard operation
MeetupPS copied to clipboard

PowerShell module to interact with Meetup.com API

MeetupPS

Build Status

PowerShell module to interact with the Meetup.com API

image-center

Contribute

Contributions are welcome by using pull request and issues.

Table of Contents

  • Install the module
  • Configure connection
  • Authentication
  • Get Meetup Group Information
  • Get Meetup Group's events Information
    • Get upcoming events
    • Get past events
  • Create Meetup Event
  • API Permission scopes
  • Resources

Install

Install the module from the PowerShell Gallery.

Install-Module -Name MeetupPS

Configure connection

Follow the following steps to request a Oauth Key/Secret. Fortunately you only need to do this once.

Register a new Oauth Consumer on the Meetup API Oauth Consumer portal

  • Consumer Name Provide a name for your Oauth Consumer
  • Application Website Here I used https://github.com/lazywinadmin/MeetupPS
  • Redirect URI Here I used https://github.com/lazywinadmin/MeetupPS
  • Agree with terms

image-center

Once the Oauth Consumer is created, copy the Key and the Secret. This will be used to authenticate against the API

image-center

Connecting to the Meetup.com API

# Connect against Meetup.com API
$Key = '<Your Oauth Consumer Key>'
$Secret = '<Your Oauth Consumer Secret>'
Set-MeetupConfiguration -ClientID $Key -Secret $Secret

image-center

Note: This will leverage two private functions of the module:

  • Get-OauthCode
  • Get-OauthAccessToken

This will then prompt you to connect to Meetup.

image-center

Get Group information

Retrieve a Meetup group information

Get-MeetupGroup -Groupname FrenchPSUG

image-center

Get Events information

Upcoming events

Retrieve upcoming event(s) for a Meetup group

Get-MeetupEvent -Groupname FrenchPSUG -status upcoming

Past events

Retrieve past event(s) for a Meetup group

Get-MeetupEvent -GroupName FrenchPSUG -status past -page 2

image-center

Get-MeetupEvent -GroupName FrenchPSUG -status past |
Format-List -property Name,local_date,link, yes_rsvp_count

image-center

Create Event

New-MeetupEvent `
    -GroupName FrenchPSUG `
    -Title 'New Event from MeetupPS' `
    -Time '2018/06/01 3:00pm' `
    -Description "PowerShell WorkShop<br><br>In this session we'll talk about ..." `
    -PublishStatus draft

image-center

Here is the event created in Meetup

image-center

API permission scopes

The API permission scopes are set when the authentication occur in Get-OAuthAccessToken.

Currently it is requesting the following permission scopes: basic,reporting, event_management

More permission scopes are available here: https://www.meetup.com/meetup_api/auth/#oauth2-scopes

scope permission
ageless Replaces the one hour expiry time from oauth2 tokens with a limit of up to two weeks
basic Access to basic Meetup group info and creating and editing Events and RSVP's, posting photos in version 2 API's and below
event_management Allows the authorized application to create and make modifications to events in your Meetup groups on your behalf
group_edit Allows the authorized application to edit the settings of groups you organize on your behalf
group_content_edit Allows the authorized application to create, modify and delete group content on your behalf
group_join Allows the authorized application to join new Meetup groups on your behalf
messaging Enables Member to Member messaging (this is now deprecated)
profile_edit Allows the authorized application to edit your profile information on your behalf
reporting Allows the authorized application to block and unblock other members and submit abuse reports on your behalf
rsvp Allows the authorized application to RSVP you to events on your behalf

You can take a look a the header passed to the API here:

$Headers = @{
    'X-OAuth-Scopes'          = "basic", "reporting", "event_management"
    'X-Accepted-OAuth-Scopes' = "basic", "reporting", "event_management"
}

See this line: Header of Get-OauthAccessToken

Resources