Package 'ractivecampaign'

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

Help Index


Authorization. Set API URL and Key

Description

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.

Usage

ac_auth(url, key, verbose = TRUE)

Arguments

url

API URL

key

API Key

verbose

Manage output console message

Value

No return value, called for side effects

See Also

Authentication


Retrieve all existing account

Description

Retrieve all existing account

Usage

ac_get_accounts(search = NULL, count_deals = FALSE)

Arguments

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.

Value

tibble with account list

See Also

Accounts

Examples

## 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)

Retrieve all campaings

Description

Campaigns are broadcast emails sent out to a list of contacts.

Usage

ac_get_campaigns()

Value

tibble with campaings metadata

See Also

Campaigns

Examples

## 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

Description

Retrieve Campaign Aggregate Revenues

Usage

ac_get_campaigns_aggregate_revenues(campaign_ids)

Arguments

campaign_ids

IDs of campaign

Value

tibble with campaings revenue data

Examples

## 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

Description

Retrieve Campaigns Message

Usage

ac_get_campaigns_messages(campaign_ids)

Arguments

campaign_ids

IDs of campaign

Value

tibble with campaings message list

Examples

## 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

Description

Get contacts tags

Usage

ac_get_contact_tags(contact_id)

Arguments

contact_id

contact id

Value

tibble with contacts tags


Retrieve Contacts

Description

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.

Usage

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
)

Arguments

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.

Value

tibble with contacts metadata

See Also

Contacts

Examples

## 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

Description

Retrieve Dictionary of Account Custom Field

Usage

ac_get_custom_account_fields()

Value

tibble with account custom field dictionary

Examples

## 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

Description

Retrieve List of Account Custom Field Values

Usage

ac_get_custom_account_fields_values(customer_account_id = NULL)

Arguments

customer_account_id

Filter results by a specific account, see ac_get_accounts

Value

tibble with account custom fields values

Examples

## 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

Description

Retrieve Dictionary of Contacts Custom Fields

Usage

ac_get_custom_contact_fields()

Value

tibble with dictionary of contacts field metadata

Examples

## 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

Description

Retrieve List of Contacts Custom Field Values

Usage

ac_get_custom_contact_fields_values(field_id = NULL, val = NULL)

Arguments

field_id

ID of the field the value belongs to.

val

Value of the custom field for a specific contact

Value

tibble with contacts field values

Examples

## 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

Description

Retrieve Dictionary of Deal Custom Field

Usage

ac_get_custom_deal_fields()

Value

tibble with deal custom fields metadata

Examples

## 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

Description

Retrieve List of Deal Custom Field Values

Usage

ac_get_custom_deal_fields_values(deal_id = NULL)

Arguments

deal_id

Filter results by a specific deal

Value

tibble with deal custom fields values

Examples

## 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

Description

Retrieve all activies if deals

Usage

ac_get_deal_activities(deal_id)

Arguments

deal_id

IDs of deal

Value

tibble with deal activies

Examples

## 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

Description

Get deal notes

Usage

ac_get_deal_notes(deal_id)

Arguments

deal_id

integer, deal id

Value

tibble with deal notes data


Retrieve all existing pipelines

Description

Retrieve all existing pipelines

Usage

ac_get_deal_piplines(title = NULL, have_stages = NULL)

Arguments

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.

Value

tibble with pipline dictionary

Examples

## 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)

Get Stage of Deals

Description

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.

Usage

ac_get_deal_stages(title = NULL, d_groupid = NULL)

Arguments

title

Filter by deal stages' titles. Any stages whose titles partial-match the filter value are returned

d_groupid

Filter by pipeline's id

Value

tibble with dictionary of deal stages

Examples

## 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

Description

Retrieve all existing deals

Usage

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
)

Arguments

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

Value

tibble with deals data

See Also

Deals

Examples

## 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

Description

Retrieve all sended messages

Usage

ac_get_messages()

Value

tibble with messages info

See Also

Messages

Examples

## 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

Description

Get list of all tags

Usage

ac_get_tags(search = NULL)

Arguments

search

Filter by name of tag(s)

Value

tibble with tags metadata

Examples

## Not run: 
tags <- ac_get_tags()

## End(Not run)

Retrieve a list of existing tasks

Description

Retrieve a list of existing tasks

Usage

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
)

Arguments

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.

Value

tibble with tasks data


Return list of all existing user groups

Description

Return list of all existing user groups

Usage

ac_get_user_groups()

Value

tibble with users group metadata

See Also

See ActiveCampaign API documentation

Examples

## Not run: 
users <- ac_get_users()

## End(Not run)

Return list of all existing users

Description

Return list of all existing users

Usage

ac_get_users()

Value

tibble with users metadata

See Also

See ActiveCampaign API documentation

Examples

## Not run: 
users <- ac_get_users()

## End(Not run)