Unbounce API client wrapper. For exploring and testing the Unbounce API.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
.rvmrc
Gemfile
LICENSE.txt
README.md
Rakefile
unbounce_client.gemspec

README.md

UnbounceClient

This is a completely unofficial, partially supported Ruby wrapper around the Unbounce API.
I'm monitoring for pull requests, but this is entirely outside the blessing of Unbounce proper.
That said, I hope this makes your life easier. Enjoy!

Installation

Add this line to your project's Gemfile:

gem 'unbounce_client'

Then execute:

bundle install

Or, install it yourself with:

$ gem install unbounce_client

Usage

First, make sure you have an Unbounce API Key. See the Unbounce API Reference Documentation for information on how.

Create a new instance:

ub = UnbounceClient.new(api_key: MY_API_KEY)

# or

ub = UnbounceClient.new(oauth_token: MY_OAUTH_TOKEN)

Get your Accounts list:

accounts = ub.accounts

Get your Sub Accounts:

# Get a list of Sub Accounts:
sub_accounts = ub.sub_accounts(accounts.first.id)

# Get a specific Sub Account:
sub_account = ub.sub_account(sub_accounts.first.id)

Get your Page Groups:

page_groups = ub.page_groups(sub_account.id)

Get your Domains:

domains = ub.domains(sub_account.id)

Get your Pages:

# Get a list of Pages:
pages = ub.pages(sub_account_id: sub_account.id)

# Get a specific Page:
page = ub.page(pages.first.id)

Get your Leads:

# Get a list of Leads:
leads = ub.leads(page_id: page.id, limit: 50, offset: 10, sort_order: "desc")

# Get a specific Lead:
lead = ub.lead(leads.first.id)

# Create Lead:
lead = ub.create_lead(page_id: page.id, form_submission: { form_data: { first_name: "Test", email: "test@email.com" }, variant_id: "a" })

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request