0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Consume Mailchimp's API using ActiveResource
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0.1
~> 4.11.0
~> 2.15.0
~> 0.5.1
~> 5.11.0
~> 3.6.0
~> 12.3.2
~> 3.5.1

Runtime

 Project Readme

MailchimpAPI

Build Status

The best way to consume Mailchimp's v3 APIs!

Installation

Add this line to your application's Gemfile
  gem 'mailchimp_api'

Usage

Basic Account object
# frozen_string_literal: true

require 'mailchimp_api'

class Account
  attr_accessor :access_token

  def initialize(access_token)
    @access_token = access_token
  end

  def with_mailchimp_session(&block)
    MailchimpAPI::Session.temp access_token, &block
  end
end

account = Account.new 'xxxyyyzzz-us7'
GET /
account.with_mailchimp_session { MailchimpAPI::AccountInformation.find '' }
GET /lists
account.with_mailchimp_session { MailchimpAPI::List.all }

Development

After checking out the repository, run bin/setup to install dependencies. Then, run rake test to run the tests.

You can also run bin/console for an interactive prompt that will allow you to experiment. You can create a file in the root of the project called dev-config.yml and add your API key to it:

api_key: <your-api-key>

This will tell the console to pre-authenticate the Mailchimp session, making it easier to test.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rewindio/mailchimp_api.