View Source Infusionsoft.Endpoints.XML.Data (Infusionsoft v0.8.1)

Provides the raw endpoints to Infusionsoft's XML API for Data actions.

Summary

Functions

This function is not mapped to any Infusionsoft API endpoint. Instead, it is a helper to recurse on query_a_data_table/6 and get the full number of records instead of one page.

Functions

count_records(table, query_data, token, app \\ nil)

@spec count_records(String.t(), map(), String.t(), nil | String.t()) ::
  {:ok, integer()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-count-a-data-table-s-records

create_a_record(table, values, token, app \\ nil)

@spec create_a_record(String.t(), map(), String.t(), nil | String.t()) ::
  {:ok, integer()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-create-a-record

create_custom_field(custom_field_type, display_name, data_type, header_id, token, app \\ nil)

@spec create_custom_field(
  String.t(),
  String.t(),
  String.t(),
  integer(),
  String.t(),
  nil | String.t()
) :: {:ok, integer()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-create-a-custom-field

delete_a_record(table, id, token, app \\ nil)

@spec delete_a_record(String.t(), integer(), String.t(), nil | String.t()) ::
  {:ok, boolean()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-delete-a-record

find_by_field(table, field_name, field_value, return_fields, token, app, opts \\ [])

@spec find_by_field(
  String.t(),
  String.t(),
  String.t(),
  [String.t()],
  String.t(),
  nil | String.t(),
  keyword()
) :: {:ok, list()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-find-a-record-by-matching-a-specific-field

Available options: page - defaults to 0 limit - defaults to 1000

query_a_data_table(table, query_data, selected_fields, token, app, opts \\ [])

@spec query_a_data_table(
  String.t(),
  map(),
  [String.t()],
  String.t(),
  nil | String.t(),
  keyword()
) :: {:ok, [map()]} | {:error, any()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-query-a-data-table

Available options: page - defaults to 0 limit - defaults to 1000 order_by - defualts to Id ascending - defaults to false

query_all_from_table(table, query_data, fields, token, app, opts \\ [])

@spec query_all_from_table(
  String.t(),
  map(),
  [String.t()],
  String.t(),
  nil | String.t(),
  keyword()
) :: {:ok, list()} | {:error, String.t()}

This function is not mapped to any Infusionsoft API endpoint. Instead, it is a helper to recurse on query_a_data_table/6 and get the full number of records instead of one page.

https://developer.infusionsoft.com/docs/xml-rpc/#data-query-a-data-table

Available options: order_by - defualts to Id ascending - defaults to false

retrieve_a_record(table, id, fields, token, app \\ nil)

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

https://developer.infusionsoft.com/docs/xml-rpc/#data-retrieve-a-record

retrieve_application_setting(module, setting, token, app \\ nil)

@spec retrieve_application_setting(
  String.t(),
  String.t(),
  String.t(),
  nil | String.t()
) ::
  {:ok, String.t()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-retrieve-application-setting

retrieve_appointments_ical(appointment_id, token, app \\ nil)

@spec retrieve_appointments_ical(integer(), String.t(), nil | String.t()) ::
  {:ok, String.t()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-retrieve-an-appointment-s-icalendar-file

update_a_custom_field(custom_field_id, values, token, app \\ nil)

@spec update_a_custom_field(integer(), map(), String.t(), nil | String.t()) ::
  {:ok, boolean()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-update-a-custom-field

update_a_record(table, record_id, values, token, app \\ nil)

@spec update_a_record(String.t(), integer(), map(), String.t(), nil | String.t()) ::
  {:ok, integer()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-update-a-record

validate_a_users_credentials(username, password_hash, token, app \\ nil)

@spec validate_a_users_credentials(
  String.t(),
  String.t(),
  String.t(),
  nil | String.t()
) ::
  {:ok, integer() | String.t()} | {:error, String.t()}

https://developer.infusionsoft.com/docs/xml-rpc/#data-validate-a-user-s-credentials