
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
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
Read their API documentationfor how to use this gem.
# To setup the client
client = ::ActiveCampaign::Client.new(
api_endpoint: 'YOUR-ENDPOINT', # e.g. 'https://yourendpoint.api-us1.com/admin/api.php'
api_key: 'YOUR-API-KEY') # e.g. 'a4e60a1ba200595d5cc37ede5732545184165e'
# or configure globally for all clients
::ActiveCampaign.configure do |config|
config.api_endpoint = 'YOUR-ENDPOINT', # e.g. 'https://yourendpoint.api-us1.com/admin/api.php'
config.api_key = 'YOUR-API-KEY' # e.g. 'a4e60a1ba200595d5cc37ede5732545184165e'
end
# To fetch all lists
ActiveCampaign.list_list ids: 'all'
# To sync a contact (create if doesn't exist or update if matching email)
# you have to resort to some really ugly hacks. Due to the form serialization
# type of API (read not a object oriented REST API) you need to translate
# something pretty into something horrific when it comes to the parameters.
ActiveCampaign.contact_sync({
"id" => user.active_campaign_contact_id,
"email" => user.email,
"first_name" => user.first,
"last_name" => user.last,
"p[#{user.active_campaign_list_id}]" => user.active_campaign_list_id,
"status[#{user.active_campaign_list_id}]" => user.receive_emails ? 1 : 2
})
# Another example of syncing a contact:
list_params = {
"#{user.active_campaign_list_id}" => user.active_campaign_list_id,
"#{user.other_list_id}" => user.other_list_id,
}
status_params = {
"#{user.active_campaign_list_id}" => user.receive_emails ? 1 : 2,
"#{user.other_list_id}" => true ? 1 : 2,
}
ActiveCampaign.contact_sync({
"id" => user.active_campaign_contact_id,
"email" => user.email,
"first_name" => user.first,
"last_name" => user.last,
"p" => list_params
"status" => status_params
})
All responses are wrapped under results
so
ActiveCampaign.list_list ids: 'all'
returns
{
"result_code" => 1,
"result_message" => "Success: Something is returned",
"result_output" => "json",
"results" => [
{
"id" => "1",
"name" => "One list",
"cdate" => "2013-05-22 10:07:36",
"private" => "0",
"userid" => "1",
"subscriber_count" => 2
},
{
"id" => "2",
"name" => "Another List",
"cdate" => "2013-05-22 10:09:15",
"private" => "0",
"userid" => "1",
"subscriber_count" => 0
}
]
}
For using tags_list action do the following
ActiveCampaign.get('tags_list')
The response of method is an array of tags
[{"id":1,"name":"test_tag","count":1}]
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that active_campaign demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.