A simple ruby wrapper for the ActiveCampaign API
MIT License
A simple wrapper for the ActiveCampaign API. Since their API seems to be basically just form posts to their server don't complain here about the way it works. The only thing we really changed was how results are wrapped and returned and you can read more about that here.
Add this line to your application's Gemfile:
gem 'active_campaign'
And then execute:
bundle
Or install it yourself as:
gem install active_campaign
# To setup the client
client = ::ActiveCampaign::Client.new(
api_url: 'YOUR-ENDPOINT', # e.g. 'https://youraccount.api-us1.com/api/3'
api_token: 'YOUR-API-KEY') # e.g. 'a4e60a1ba200595d5cc37ede5732545184165e'
# or configure globally for all clients
::ActiveCampaign.configure do |config|
config.api_url = 'YOUR-ENDPOINT' # e.g. 'https://youraccount.api-us1.com/api/3'
config.api_token = 'YOUR-API-KEY' # e.g. 'a4e60a1ba200595d5cc37ede5732545184165e'
end
# To create a contact
ActiveCampaign.create_contact(
email: "[email protected]",
first_name: "Mika",
last_name: "El",
phone: "bogusnumber",
)
# To sync a contact (create if doesn't exist or update if matching email)
ActiveCampaign.sync_contact(
email: "[email protected]",
first_name: "Mika",
last_name: "El",
phone: "bogusnumber",
)
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)