Title: | Loading Data from 'ActiveCampaign API v3' |
---|---|
Description: | Interface for loading data from 'ActiveCampaign API v3' <https://developers.activecampaign.com/reference>. Provide functions for getting data by deals, contacts, accounts, campaigns and messages. |
Authors: | Alexey Seleznev [aut, cre] , Netpeak [cph] |
Maintainer: | Alexey Seleznev <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.6.0 |
Built: | 2024-11-13 05:44:26 UTC |
Source: | https://github.com/selesnow/ractivecampaign |
Your API key can be found in your account on the Settings page under the "Developer" tab. Each user in your ActiveCampaign account has their own unique API key.
ac_auth(url, key, verbose = TRUE)
ac_auth(url, key, verbose = TRUE)
url |
API URL |
key |
API Key |
verbose |
Manage output console message |
No return value, called for side effects
Retrieve all existing account
ac_get_accounts(search = NULL, count_deals = FALSE)
ac_get_accounts(search = NULL, count_deals = FALSE)
search |
Search by name |
count_deals |
Whether to compute the contactCount and dealCount counts for the number of contacts/deals associated with each account. Set it to true to include the right counts. If set to false or omitted from the call, then contactCount and dealCount will not be counted and be simply displayed as 0. |
tibble with account list
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") my_accounts <- ac_get_accounts(search = 'name') ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") my_accounts <- ac_get_accounts(search = 'name') ## End(Not run)
Campaigns are broadcast emails sent out to a list of contacts.
ac_get_campaigns()
ac_get_campaigns()
tibble with campaings metadata
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") camps <- ac_get_campaigns() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") camps <- ac_get_campaigns() ## End(Not run)
Retrieve Campaign Aggregate Revenues
ac_get_campaigns_aggregate_revenues(campaign_ids)
ac_get_campaigns_aggregate_revenues(campaign_ids)
campaign_ids |
IDs of campaign |
tibble with campaings revenue data
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") c_agr_rev <- ac_get_campaigns_aggregate_revenues(c(11, 54, 67)) ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") c_agr_rev <- ac_get_campaigns_aggregate_revenues(c(11, 54, 67)) ## End(Not run)
Retrieve Campaigns Message
ac_get_campaigns_messages(campaign_ids)
ac_get_campaigns_messages(campaign_ids)
campaign_ids |
IDs of campaign |
tibble with campaings message list
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") c_messeges <- ac_get_campaigns_messages(c(11, 54, 67)) ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") c_messeges <- ac_get_campaigns_messages(c(11, 54, 67)) ## End(Not run)
Get contacts tags
ac_get_contact_tags(contact_id)
ac_get_contact_tags(contact_id)
contact_id |
contact id |
tibble with contacts tags
Contacts are the center of activity in 'ActiveCampaign' and represent the people that the owner of an 'ActiveCampaign' account is marketing to or selling to.
ac_get_contacts( ids = NULL, email = NULL, email_like = NULL, exclude = NULL, formid = NULL, id_greater = NULL, id_less = NULL, listid = NULL, search = NULL, segmentid = NULL, seriesid = NULL, status = NULL, tagid = NULL, created_before = NULL, created_after = NULL, updated_before = NULL, updated_after = NULL, waitid = NULL, in_group_lists = NULL )
ac_get_contacts( ids = NULL, email = NULL, email_like = NULL, exclude = NULL, formid = NULL, id_greater = NULL, id_less = NULL, listid = NULL, search = NULL, segmentid = NULL, seriesid = NULL, status = NULL, tagid = NULL, created_before = NULL, created_after = NULL, updated_before = NULL, updated_after = NULL, waitid = NULL, in_group_lists = NULL )
ids |
Filter contacts by ID. Can be repeated for multiple IDs. |
email |
Email address of the contact you want to get |
email_like |
Filter contacts that contain the given value in the email address |
exclude |
Exclude from the response the contact with the given ID |
formid |
Filter contacts associated with the given form |
id_greater |
Only include contacts with an ID greater than the given ID |
id_less |
Only include contacts with an ID less than the given ID |
listid |
Filter contacts associated with the given list |
search |
Filter contacts that match the given value in the contact names, organization, phone or email |
segmentid |
Return only contacts that match a list segment (this param initially returns segment information, when it is run a second time it will return contacts that match the segment) |
seriesid |
Filter contacts associated with the given automation |
status |
Filter contact by status: -1 - Any, 0 - Unconfirmed, 1 - Active, 2 - Unsubscribed, 3 - Bounced |
tagid |
Filter contacts associated with the given tag |
created_before |
Filter contacts that were created prior to this date |
created_after |
Filter contacts that were created after this date |
updated_before |
Filter contacts that were updated before this date |
updated_after |
Filter contacts that were updated after this date |
waitid |
Filter by contacts in the wait queue of an automation block |
in_group_lists |
Set this to TRUE in order to return only contacts that the current user has permissions to see. |
tibble with contacts metadata
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_contacts() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_contacts() ## End(Not run)
Retrieve Dictionary of Account Custom Field
ac_get_custom_account_fields()
ac_get_custom_account_fields()
tibble with account custom field dictionary
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_custom_account_fields() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_custom_account_fields() ## End(Not run)
Retrieve List of Account Custom Field Values
ac_get_custom_account_fields_values(customer_account_id = NULL)
ac_get_custom_account_fields_values(customer_account_id = NULL)
customer_account_id |
Filter results by a specific account, see |
tibble with account custom fields values
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_custom_account_fields_values() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_custom_account_fields_values() ## End(Not run)
Retrieve Dictionary of Contacts Custom Fields
ac_get_custom_contact_fields()
ac_get_custom_contact_fields()
tibble with dictionary of contacts field metadata
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_custom_contact_fields() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_custom_contact_fields() ## End(Not run)
Retrieve List of Contacts Custom Field Values
ac_get_custom_contact_fields_values(field_id = NULL, val = NULL)
ac_get_custom_contact_fields_values(field_id = NULL, val = NULL)
field_id |
ID of the field the value belongs to. |
val |
Value of the custom field for a specific contact |
tibble with contacts field values
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_custom_contact_fields_values() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") contacts <- ac_get_custom_contact_fields_values() ## End(Not run)
Retrieve Dictionary of Deal Custom Field
ac_get_custom_deal_fields()
ac_get_custom_deal_fields()
tibble with deal custom fields metadata
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deal_fields <- ac_get_custom_deal_fields() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deal_fields <- ac_get_custom_deal_fields() ## End(Not run)
Retrieve List of Deal Custom Field Values
ac_get_custom_deal_fields_values(deal_id = NULL)
ac_get_custom_deal_fields_values(deal_id = NULL)
deal_id |
Filter results by a specific deal |
tibble with deal custom fields values
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deal_field_values <- ac_get_custom_deal_fields_values() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deal_field_values <- ac_get_custom_deal_fields_values() ## End(Not run)
Retrieve all activies if deals
ac_get_deal_activities(deal_id)
ac_get_deal_activities(deal_id)
deal_id |
IDs of deal |
tibble with deal activies
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") c_deal_activies<- ac_get_deal_activities(c(11, 54, 67)) ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") c_deal_activies<- ac_get_deal_activities(c(11, 54, 67)) ## End(Not run)
Get deal notes
ac_get_deal_notes(deal_id)
ac_get_deal_notes(deal_id)
deal_id |
integer, deal id |
tibble with deal notes data
Retrieve all existing pipelines
ac_get_deal_piplines(title = NULL, have_stages = NULL)
ac_get_deal_piplines(title = NULL, have_stages = NULL)
title |
Filter by pipeline's title. The filter matches any pipeline titles that contain the provided title (i.e. "Contact" matches all of "In Contact", "To Contact", and "Contact Pipeline"). |
have_stages |
Filter by whether pipelines have deal stages. Can be either 1 or 0. If 1, only pipelines with at least one stage will be returned. |
tibble with pipline dictionary
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deal_piplines <- ac_get_deal_piplines() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deal_piplines <- ac_get_deal_piplines() ## End(Not run)
Stages are a way to group deals within a pipeline. A pipeline can have any number of stages within it and each stage can have any number of deals within it.
ac_get_deal_stages(title = NULL, d_groupid = NULL)
ac_get_deal_stages(title = NULL, d_groupid = NULL)
title |
Filter by deal stages' titles. Any stages whose titles partial-match the filter value are returned |
d_groupid |
Filter by pipeline's id |
tibble with dictionary of deal stages
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deal_stages <- ac_get_deal_stages() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deal_stages <- ac_get_deal_stages() ## End(Not run)
Retrieve all existing deals
ac_get_deals( search = NULL, search_field = NULL, title = NULL, stage = NULL, group = NULL, status = NULL, owner = NULL, nextdate_range = NULL, tag = NULL, tasktype = NULL, created_before = NULL, created_after = NULL, updated_before = NULL, updated_after = NULL, organization = NULL, minimum_value = NULL, maximum_value = NULL, score_greater_than = NULL, score_less_than = NULL, score = NULL )
ac_get_deals( search = NULL, search_field = NULL, title = NULL, stage = NULL, group = NULL, status = NULL, owner = NULL, nextdate_range = NULL, tag = NULL, tasktype = NULL, created_before = NULL, created_after = NULL, updated_before = NULL, updated_after = NULL, organization = NULL, minimum_value = NULL, maximum_value = NULL, score_greater_than = NULL, score_less_than = NULL, score = NULL )
search |
Search text to use with search_field parameter. |
search_field |
Field to search for. Available values: all (All three fields: title, contact, and org), title (Deal's title), contact (Deal's primary contact's first name and last name. If search parameter has more than one word, first word is used for matching first name of contacts and rest of the words are used for matching last name of contacts.), org (Deal's primary contact's organization name). |
title |
Filter by deal's title |
stage |
Filter by deal's stage |
group |
Filter by deal's pipeline |
status |
Filter by deal's status. 0 - Open, 1 - Won, 2 - Lose. |
owner |
Filter by deal's owner |
nextdate_range |
Filter by deal's tasks due dates. Available values: upcoming (Deals with tasks that are due within 24 hours.), scheduled (Deals with tasks that are due in more than 24 hours), overdue (Deals with tasks that are past due dates.), no-task (Deals without any task.). |
tag |
Filter by tag names associated with deal's primary contact. Available values: greater than 0 (Deals with primary contacts that have the tag with given id), -1 (Deals with primary contacts that have any tag), -2 (Deals with primary contacts that have no tag) |
tasktype |
Filter by deals that have tasks with given type |
created_before |
Returns deals that are created less than given date |
created_after |
Returns deals that are created greater than or equal to given date |
updated_before |
Returns deals that are updated less than given date |
updated_after |
Returns deals that are updated greater than or equal to given date |
organization |
Filter by deal's primary contact's organization's id |
minimum_value |
In USD with dollar portion. Returns deals whose values are greater than or equal to given |
maximum_value |
In USD with dollar portion. Returns deals whose values are less than or equal to given |
score_greater_than |
In a format of <score_id>:<score_value>. Returns deals whose score value is greater than given value |
score_less_than |
In a format of <score_id>:<score_value>. Returns deals whose score value is less than given value |
score |
In a format of <score_id>:<score_value>. Returns deals whose score value is equal to given value |
tibble with deals data
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deals <- ac_get_deals() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") deals <- ac_get_deals() ## End(Not run)
Retrieve all sended messages
ac_get_messages()
ac_get_messages()
tibble with messages info
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") msgs <- ac_get_messages() ## End(Not run)
## Not run: Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "YOUR_TOKEN") Sys.setenv('ACTIVECAMPAGN_API_URL' = "https://<your-account>.api-us1.com") msgs <- ac_get_messages() ## End(Not run)
Get list of all tags
ac_get_tags(search = NULL)
ac_get_tags(search = NULL)
search |
Filter by name of tag(s) |
tibble with tags metadata
## Not run: tags <- ac_get_tags() ## End(Not run)
## Not run: tags <- ac_get_tags() ## End(Not run)
Retrieve a list of existing tasks
ac_get_tasks( title = NULL, reltype = NULL, relid = NULL, status = NULL, note = NULL, duedate = NULL, d_tasktypeid = NULL, userid = NULL, due_after = NULL, due_before = NULL, duedate_range = NULL, assignee_userid = NULL, outcome_id = NULL )
ac_get_tasks( title = NULL, reltype = NULL, relid = NULL, status = NULL, note = NULL, duedate = NULL, d_tasktypeid = NULL, userid = NULL, due_after = NULL, due_before = NULL, duedate_range = NULL, assignee_userid = NULL, outcome_id = NULL )
title |
character, The title to be assigned to the task. |
reltype |
character, The name of the relating object (see relationships table). |
relid |
integer, The id of the relational object for this task. |
status |
integer, Task status means complete or incomplete. 1 is complete and 0 is incomplete. |
note |
character, The content describing the task. |
duedate |
date, Due date of the task. |
d_tasktypeid |
integer, The type of the task based on the available Task Types in the account. |
userid |
integer, User ID this task belongs to. |
due_after |
character, Filter deal tasks that are due after a specific date. |
due_before |
character, Filter deal tasks that are due before a specific date. |
duedate_range |
character, Filter deal tasks that are due between specific date range. |
assignee_userid |
integer, The id of the user a task is assigned to. |
outcome_id |
integer The id of a task outcome that the task belongs to. |
tibble with tasks data
Return list of all existing user groups
ac_get_user_groups()
ac_get_user_groups()
tibble with users group metadata
See ActiveCampaign API documentation
## Not run: users <- ac_get_users() ## End(Not run)
## Not run: users <- ac_get_users() ## End(Not run)
Return list of all existing users
ac_get_users()
ac_get_users()
tibble with users metadata
See ActiveCampaign API documentation
## Not run: users <- ac_get_users() ## End(Not run)
## Not run: users <- ac_get_users() ## End(Not run)