View Source ActiveCampaign.CustomObject.Record (active_campaign v0.2.4)

Documentation for ActiveCampaign.CustomObject.Record.

Link to this section Summary

Functions

Create or update record

Delete a record by id

Delete a record by external ID

Get a record by id

Get a record by external id

List records by schema

Link to this section Functions

Link to this function

create(schema_id, record)

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

Create or update record

ActiveCampaign.CustomObject.Record.create "76a5a396-2705-48b4-9f8b-e50c11d6919a", %{externalId: "nexus_id_1", fields: [%{id: "disorder", value: "fingernailitis"}, %{id: "relationship", value: "healthcare_provider"}], relationships: %{"primary-contact" => [91025]}}

Link to this function

delete(schema_id, record_id)

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

Delete a record by id

Link to this function

delete_by_external_id(schema_id, external_id)

View Source

Delete a record by external ID

Link to this function

get(schema_id, record_id)

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

Get a record by id

Link to this function

get_by_external_id(schema_id, external_id)

View Source

Get a record by external id

Link to this function

list(schema_id, query_params \\ %{})

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

List records by schema

iex(nex@2475ffae5951)27> ActiveCampaign.CustomObject.Record.list schema_id, %{"filters[relationships.primary-contact][eq]" => 91025} {:ok, %{ "meta" => %{"count" => 1, "limit" => 20, "offset" => 0, "total" => 1}, "records" => [

 %{
   "createdTimestamp" => "2022-12-05T21:38:15.471Z",
   "fields" => [
     %{"id" => "disorder", "value" => "orange kneecaps"},
     %{"id" => "relationship", "value" => "caretaker"}
   ],
   "id" => "4b59392a-1585-418b-8433-36b50c49ce91",
   "relationships" => %{"primary-contact" => ["91025"]},
   "schemaId" => "ea76ca04-78e2-45ae-9e13-abf208d17dbb",
   "updatedTimestamp" => "2022-12-05T21:38:15.471Z"
 }

] }}