Aurinko (Aurinko v0.2.1)

Copy Markdown View Source

Aurinko — Production-grade Elixir client for the Aurinko Unified Mailbox API.

Overview

Aurinko provides a unified API for Email, Calendar, Contacts, Tasks, Webhooks, and Booking across Google Workspace, Office 365, Outlook, MS Exchange, Zoho, and iCloud.

Features

Quick Start

config :aurinko,
  client_id: System.get_env("AURINKO_CLIENT_ID"),
  client_secret: System.get_env("AURINKO_CLIENT_SECRET")

# Auth
url = Aurinko.authorize_url(service_type: "Google", scopes: ["Mail.Read"],
                              return_url: "https://myapp.com/callback")
{:ok, %{token: token}} = Aurinko.Auth.exchange_code(code)

# Email
{:ok, page} = Aurinko.list_messages(token, q: "is:unread", limit: 25)

# Stream all pages lazily
Aurinko.Paginator.stream(token, &Aurinko.list_messages/2)
|> Stream.each(&process/1)
|> Stream.run()

# Calendar
{:ok, event} = Aurinko.create_event(token, "primary", %{
  subject: "Standup",
  start: %{date_time: ~U[2024-06-01 09:00:00Z], timezone: "UTC"},
  end:   %{date_time: ~U[2024-06-01 09:30:00Z], timezone: "UTC"}
})

Summary

Functions

Functions

authorize_url(opts \\ [])

See Aurinko.Auth.authorize_url/1.

create_contact(token, params)

See Aurinko.API.Contacts.create_contact/2.

create_draft(token, params)

See Aurinko.API.Email.create_draft/2.

create_event(token, calendar_id, params, opts \\ [])

See Aurinko.API.Calendar.create_event/4.

create_subscription(token, params)

See Aurinko.API.Webhooks.create_subscription/2.

create_task(token, task_list_id, params)

See Aurinko.API.Tasks.create_task/3.

delete_contact(token, id)

See Aurinko.API.Contacts.delete_contact/2.

delete_draft(token, id)

See Aurinko.API.Email.delete_draft/2.

delete_event(token, calendar_id, event_id, opts \\ [])

See Aurinko.API.Calendar.delete_event/4.

delete_subscription(token, id)

See Aurinko.API.Webhooks.delete_subscription/2.

delete_task(token, task_list_id, task_id)

See Aurinko.API.Tasks.delete_task/3.

exchange_code(code, opts \\ [])

See Aurinko.Auth.exchange_code/2.

free_busy(token, calendar_id, params)

See Aurinko.API.Calendar.free_busy/3.

get_attachment(token, message_id, attachment_id)

See Aurinko.API.Email.get_attachment/3.

get_booking_availability(token, profile_id, params)

See Aurinko.API.Booking.get_booking_availability/3.

get_calendar(token, calendar_id)

See Aurinko.API.Calendar.get_calendar/2.

get_contact(token, id)

See Aurinko.API.Contacts.get_contact/2.

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

See Aurinko.API.Email.sync_deleted/3.

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

See Aurinko.API.Email.sync_updated/3.

get_event(token, calendar_id, event_id)

See Aurinko.API.Calendar.get_event/3.

get_message(token, id, opts \\ [])

See Aurinko.API.Email.get_message/3.

list_attachments(token, message_id)

See Aurinko.API.Email.list_attachments/2.

list_booking_profiles(token, opts \\ [])

See Aurinko.API.Booking.list_booking_profiles/2.

list_calendars(token, opts \\ [])

See Aurinko.API.Calendar.list_calendars/2.

list_contacts(token, opts \\ [])

See Aurinko.API.Contacts.list_contacts/2.

list_events(token, calendar_id, opts \\ [])

See Aurinko.API.Calendar.list_events/3.

list_messages(token, opts \\ [])

See Aurinko.API.Email.list_messages/2.

list_subscriptions(token, opts \\ [])

See Aurinko.API.Webhooks.list_subscriptions/2.

list_task_lists(token, opts \\ [])

See Aurinko.API.Tasks.list_task_lists/2.

list_tasks(token, task_list_id, opts \\ [])

See Aurinko.API.Tasks.list_tasks/3.

refresh_token(refresh_token, opts \\ [])

See Aurinko.Auth.refresh_token/2.

send_message(token, params)

See Aurinko.API.Email.send_message/2.

start_calendar_sync(token, calendar_id, opts \\ [])

See Aurinko.API.Calendar.start_sync/3.

start_contacts_sync(token, opts \\ [])

See Aurinko.API.Contacts.start_sync/2.

start_email_sync(token, opts \\ [])

See Aurinko.API.Email.start_sync/2.

update_contact(token, id, params)

See Aurinko.API.Contacts.update_contact/3.

update_event(token, calendar_id, event_id, params, opts \\ [])

See Aurinko.API.Calendar.update_event/5.

update_message(token, id, params)

See Aurinko.API.Email.update_message/3.

update_task(token, task_list_id, task_id, params)

See Aurinko.API.Tasks.update_task/4.