View Source ActiveCampaign.Contact (active_campaign v0.2.3)

Documentation for ActiveCampaign.Contact.

Link to this section Summary

Functions

Bulk import status info

Bulk import status list

Create a contact

Delete a contact

Retrieve a contact

Retrieve a contacts account contacts

Retrieve a contacts automation entry counts

Retrieve a contact's bounce logs

Retrieve a list of contact's deals

Retrieve a contact's data

Retrieve a contact's deals

Retrieve a contact's field values

Retrieve a contacts geo ips

Retrieve a contact's goals

Retrieve a contact's list memberships

Retrieve a contact's logs

Retrieve a contacts notes

Retrieve a contacts organization

Retrieve a contacts plus append

Retrieve a contact's score value

Retrieve a contacts tracking logs

List all contact activities

List all automations the contact is in

List, search, and filter contacts

Sync a contact's data

Update a contact

Update list status for a contact

Link to this section Functions

Link to this function

bulk_import(contacts, callback \\ %{})

View Source
@spec bulk_import([map()], map()) :: {:ok, map()} | {:error, any()}

Bulk import contacts

examples

Examples

iex> contacts = [
    %{
      email: "oscar.b@example.com",
      subscribe: [
        %{listid: 26}
      ]
    }
  ]
iex> callback = %{
    url: "https://example.com/webhooks/active-campaign/bulk-import",
    requestType: "POST",
    detailed_results: "false",
    params: [
      %{key: "param-key", value: "param-value"}
    ],
    headers: [
      %{key: "header-key", value: "header-value"}
    ]
  }
iex> ActiveCampaign.Contact.bulk_import(contacts, callback)
{:ok,
 %{
   "batchId" => "e496235c-e7c4-4c8c-80ee-61975e9dc7f8",
   "message" => "Contact import queued",
   "queued_contacts" => 250,
   "success" => 1
 }}
Link to this function

bulk_import_status_info(batch_id)

View Source
@spec bulk_import_status_info(integer()) :: {:ok, map()} | {:error, any()}

Bulk import status info

Link to this function

bulk_import_status_list()

View Source
@spec bulk_import_status_list() :: {:ok, map()} | {:error, any()}

Bulk import status list

examples

Examples

iex> ActiveCampaign.Contact.bulk_import_status_list()
{:ok, %{"outstanding" => [], "recentlyCompleted" => []}}
@spec create(map()) :: {:ok, map()} | {:error, any()}

Create a contact

examples

Examples

iex> ActiveCampaign.Contact.create(%{
  email: "johndoe@example.com",
  firstName: "John",
  lastName: "Doe",
  phone: "7223224241"
})
{:ok, %{"contact" => %{...}}}
@spec delete(integer()) :: {:ok, map()} | {:error, any()}

Delete a contact

@spec get(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact

examples

Examples

iex> ActiveCampaign.Contact.get(123)
{:ok, %{"contactAutomations" => [...], "contactLists" => [...], ...}}
Link to this function

get_account_contacts(id)

View Source
@spec get_account_contacts(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contacts account contacts

examples

Examples

iex> ActiveCampaign.Contact.get_account_contacts(123)
{:ok, %{"accountContacts" => []}}
Link to this function

get_automation_entry_counts(id)

View Source
@spec get_automation_entry_counts(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contacts automation entry counts

examples

Examples

iex> ActiveCampaign.Contact.get_automation_entry_counts(123)
{:ok, %{"automationEntryCounts" => []}}
@spec get_bounce_logs(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact's bounce logs

examples

Examples

iex> ActiveCampaign.Contact.get_bounce_logs(123)
{:ok, %{"bounceLogs" => []}}
@spec get_contact_deals(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a list of contact's deals

examples

Examples

iex> ActiveCampaign.Contact.get_contact_deals(123)
{:ok, %{"contactDeals" => []}}
@spec get_data(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact's data

examples

Examples

iex> ActiveCampaign.Contact.get_data(123)
{:ok, %{"contactDatum" => %{...}}}
@spec get_deals(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact's deals

examples

Examples

iex> ActiveCampaign.Contact.get_deals(123)
{:ok, %{"deals" => []}}
@spec get_field_values(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact's field values

examples

Examples

iex> ActiveCampaign.Contact.get_deals(123)
{:ok, %{"fieldValues" => []}}
@spec get_geo_ips(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contacts geo ips

examples

Examples

iex> ActiveCampaign.Contact.get_geo_ips(123)
{:ok, %{"geoIps" => []}}
@spec get_goals(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact's goals

examples

Examples

iex> ActiveCampaign.Contact.get_goals(123)
{:ok, %{"contactGoals" => []}}
Link to this function

get_list_memberships(id)

View Source
@spec get_list_memberships(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact's list memberships

examples

Examples

iex> ActiveCampaign.Contact.get_list_memberships(123)
{:ok, %{"contactLists" => []}}
@spec get_logs(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact's logs

examples

Examples

iex> ActiveCampaign.Contact.get_logs(123)
{:ok, %{"contactLogs" => []}}
@spec get_notes(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contacts notes

examples

Examples

iex> ActiveCampaign.Contact.get_notes(123)
{:ok, %{"notes" => []}}
@spec get_organization(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contacts organization

@spec get_plus_append(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contacts plus append

examples

Examples

iex> ActiveCampaign.Contact.get_plus_append(123)
{:ok, %{}}
@spec get_score(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contact's score value

@spec get_tracking_logs(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a contacts tracking logs

examples

Examples

iex> ActiveCampaign.Contact.get_tracking_logs(123)
{:ok, %{"trackingLogs" => []}}
Link to this function

list_activity(query_params \\ %{})

View Source
@spec list_activity(map()) :: {:ok, map()} | {:error, any()}

List all contact activities

@spec list_automations(integer()) :: {:ok, map()} | {:error, any()}

List all automations the contact is in

@spec search(map()) :: {:ok, map()} | {:error, any()}

List, search, and filter contacts

@spec sync(map()) :: {:ok, map()} | {:error, any()}

Sync a contact's data

@spec update(integer(), map()) :: {:ok, map()} | {:error, any()}

Update a contact

iex> ActiveCampaign.Contact.update(123, %{email: "john@example.com"}) {:ok, %{"contact" => %{...}}

Link to this function

update_list_status(data)

View Source
@spec update_list_status(map()) :: {:ok, map()} | {:error, any()}

Update list status for a contact

examples

Examples

iex> AC.Contact.update_list_status(%{list: 1, contact: 22, status: ActiveCampaign.Contact.Status.active()})
{:ok, %{"contactList" => %{...}, "contacts" => [...]}}