A Ruby wrapper for the Aweber REST API.
Add this line to your application's Gemfile:
gem 'aweber'
And then execute:
$ bundle
Or install it yourself as:
$ gem install aweber
NOTE: This gem will not perform a three legged OAuth request for you.
Aweber.configure do |config|
config.consumer_key = "consumer_key"
config.consumer_secret = "consumer_secret"
config.oauth_token = "access_token"
config.oauth_token_secret = "access_token_secret"
end
For the purposes of this README, we'll assume the client has been initialized as client
.
client = Aweber::Client.new
Get a collection of customer accounts associated with the provided OAuth access token and secret that have authorized your AWeber app. An id
for an account in this response is required for all other endpoints.
client.accounts
Get a collection of all subscriber lists associated with the provided account_id
.
client.lists(account_id)
Find a list based on the list name or the unique list id of the list. Refer to the Aweber documentation for more information.
client.find_list(account_id, options = {})
Get a collection of all subscribers associated with the provided list_id
.
client.subscribers(account_id, list_id)
Find subscribers based on provided search parameters. Refer to the Aweber documentation for more information.
NOTE: Passing a list_id
in the options
parameter will limit the search the provided list.
client.find_subscribers(account_id, options = {})
Add a subscriber to a provided list. Refer to the Aweber documentation for more information.
client.create_subscriber(account_id, list_id, options = {})
Move a subscriber from one list to another. Refer to the Aweber documentation for more information.
NOTE: Passing a list_id
in the options
parameter will act as a shortcut to automatically inject the required list_link
parameter.
client.move_subscriber(account_id, list_id, subscriber_id, options = {})
Archive a subscriber from a provided list. Refer to the Aweber documentation for more information.
client.archive_subscriber(account_id, list_id, subscriber_id)
- Fork it ( https://github.com/[my-github-username]/aweber/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request