Infusionsoft (Infusionsoft v0.7.0) View Source

Main module for interacting with Infusionsoft, start here!

If you want to access the XML-RPC API or the REST API without the caching and conveniences, you can use the other modules like Infusionsoft.Endpoints.XML and Infusionsoft.Endpoints.REST outlined in the documentation.

One important thing to note is that if you have multiple custom fields with the same name, even if the capitalization is different, things may not work the way you expect.

The same is true for tags. If you need to support tags with the same name in different categories, you can provide the category name as an option in all tag calls. However, if you have multiple tags in the same category with the same name, things may not work the way you expect.

Link to this section Summary

Functions

Achieves a goal for a contact, with a specific integration name and call name.

Creates a contact record in Infusionsoft without doing a dupe check.

Fetches all contact records, returning all fields and custom fields (very expensive).

Gets all of the records from a table in Infusionsoft.

Retrieves a contact record from Infusionsoft.

Updates a contact record from Infusionsoft.

Link to this section Functions

Link to this function

achieve_goal(contact_id, integration_name, call_name, token, app \\ nil)

View Source

Specs

achieve_goal(integer(), String.t(), String.t(), String.t(), nil | String.t()) ::
  {:ok, list()} | {:error, String.t()}

Achieves a goal for a contact, with a specific integration name and call name.

Examples

iex> Infusionsoft.achieve_goal(12345, "test_token")
{:ok, [...]}
Link to this function

create_contact(data, token, app \\ nil)

View Source

Specs

create_contact(map(), String.t(), nil | String.t()) ::
  {:ok, integer()} | {:error, binary()}

Creates a contact record in Infusionsoft without doing a dupe check.

Examples

iex> Infusionsoft.create_contact(%{"First Name" => "Damon"}, "test_token")
{:ok, 12345}
Link to this function

list_contacts(token, parameters \\ nil)

View Source

Specs

list_contacts(String.t(), map() | nil) :: {:ok, integer()} | {:error, binary()}

Fetches all contact records, returning all fields and custom fields (very expensive).

Currently this function does not support more than 1000 contacts, so if your app has more please use query_table/6 which can return an unlimited number.

Use query_table/6 for more granular control over which fields are returned.

Examples

iex> Infusionsoft.list_contacts("test_token")
{:ok, [%{"Id" => 12345}, %{"Id" => 67890}]}
Link to this function

query_table(data, table, fields, token, app, opts \\ [])

View Source

Specs

query_table(
  map(),
  String.t(),
  [String.t()],
  String.t(),
  nil | String.t(),
  keyword()
) :: {:ok, list()} | {:error, binary()}

Gets all of the records from a table in Infusionsoft.

See the available tables here: https://developer.infusionsoft.com/docs/table-schema/

Available options for opts param: order_by - defualts to Id ascending - defaults to false

Examples

iex> Infusionsoft.query_table(%{"First Name" => "Damon"}, "Contact", ["Id"], "test_token", nil)
{:ok, [%{"Id" => 12345}, %{"Id" => 67890}]}
Link to this function

retrieve_contact(id, fields, token, app \\ nil)

View Source

Specs

retrieve_contact(integer(), [String.t()], String.t(), nil | String.t()) ::
  {:ok, map()} | {:error, String.t()}

Retrieves a contact record from Infusionsoft.

Examples

iex> Infusionsoft.retrieve_contact(12345, ["First Name", "Last Name"], "test_token")
{:ok, %{"First Name" => "Damon", "Last Name" => "Janis"}}
Link to this function

update_contact(id, data, token, app \\ nil)

View Source

Specs

update_contact(integer(), map(), String.t(), nil | String.t()) ::
  {:ok, integer()} | {:error, String.t()}

Updates a contact record from Infusionsoft.

Examples

iex> Infusionsoft.update_contact(12345, %{"Nickname" => "Dame"}, "test_token")
{:ok, 12345}