The WhatConverts Ruby Gem

A Ruby interface for the WhatConverts API.

Installation

Add this line to your application's Gemfile:

gem 'whatconverts'

And then execute:

$ bundle

Or install it yourself as:

$ gem install whatconverts

Usage

client = Whatconverts::Client.new do |config|
  config.api_token = 'YOUR_API_TOKEN'
  config.api_secret = 'YOUR_API_SECRET'
end

# retrieve all
client.leads
client.accounts
client.profiles()

# retrieving with param filtering
client.leads(lead_type: 'phone_call', lead_status: 'unique')
client.accounts(accounts_per_page: 100)
client.profiles(, profiles_per_page: 100)

# fetching by ID
client.lead(lead_id)
client.()
client.profile(, profile_id)

# creation
client.create_lead(
  lead_type: 'Web Form',
  form_name: 'My Form'
)
client.(account_name: 'Test Account')
client.create_profile(, profile_name: 'Test Profile')

# editing
client.edit_lead(lead_id, lead_source: 'google')
client.(, account_name: 'Test Account 2')
client.edit_profile(, profile_id, profile_name: 'Test Profile 2')

# deletion
client.()
client.delete_profile(, profile_id)

Contributing

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

License

The gem is available as open source under the terms of the MIT License.