Aurinko.API.Contacts (Aurinko v0.2.1)

Copy Markdown View Source

Aurinko Contacts API — read and manage address book contacts.

Supports Google, Office 365, Outlook, and Exchange.

Summary

Functions

Create a new contact.

Delete a contact by ID.

Get a contact by ID.

Start incremental sync for contacts.

Fetch updated contacts since last sync.

Update an existing contact.

Functions

create_contact(token, params)

@spec create_contact(String.t(), map()) ::
  {:ok, Aurinko.Types.Contact.t()} | {:error, Aurinko.Error.t()}

Create a new contact.

Parameters

  • :given_name, :surname, :display_name
  • :email_addresses — list of %{address: "...", name: "..."}
  • :phone_numbers — list of %{number: "...", type: "..."}
  • :company, :job_title

delete_contact(token, id)

@spec delete_contact(String.t(), String.t()) :: :ok | {:error, Aurinko.Error.t()}

Delete a contact by ID.

get_contact(token, id)

@spec get_contact(String.t(), String.t()) ::
  {:ok, Aurinko.Types.Contact.t()} | {:error, Aurinko.Error.t()}

Get a contact by ID.

list_contacts(token, opts \\ [])

@spec list_contacts(
  String.t(),
  keyword()
) :: {:ok, Aurinko.Types.Pagination.t()} | {:error, Aurinko.Error.t()}

List contacts.

Options

  • :limit — Number of results (default: 20)
  • :page_token — Pagination token
  • :q — Search query

start_sync(token, opts \\ [])

@spec start_sync(
  String.t(),
  keyword()
) :: {:ok, Aurinko.Types.SyncResult.t()} | {:error, Aurinko.Error.t()}

Start incremental sync for contacts.

sync_updated(token, delta_token, opts \\ [])

@spec sync_updated(String.t(), String.t(), keyword()) ::
  {:ok, Aurinko.Types.Pagination.t()} | {:error, Aurinko.Error.t()}

Fetch updated contacts since last sync.

update_contact(token, id, params)

@spec update_contact(String.t(), String.t(), map()) ::
  {:ok, Aurinko.Types.Contact.t()} | {:error, Aurinko.Error.t()}

Update an existing contact.