Campaign Monitor Party

Lightweight wrapper for Campaign Monitor API over HTTP using HTTParty.

About

This is a very simple class that utilizes HTTParty -- a wonderful gem for consuming REST APIs. The code here is only about 20 lines or so; HTTParty does all the hard work.

Installation

sudo gem install campaign_monitor_party -s http://gemcutter.org

Usage

First, familiarize yourself with the API documentation here: http://www.campaignmonitor.com/api/

require 'rubygems'
require 'campaign_monitor_party'

API_KEY = '...'

cm = CampaignMonitorParty.new(API_KEY)

# The wrapper uses method_missing to accept any method supported by the HTTP API (now or in the future).
# For instance, the method "Subscriber.Add" is called with the code below.

cm.Subscriber.Add(
  'ListID' => '...',
  'Email'  => '[email protected]',
  'Name'   => 'Tim Morgan'
)

# 'ApiKey' is passed in automatically for each method call.
# Other arguments should be passed as a hash to the method.