Aurinko
Aurinko websiteAurinko blogAPI ReferenceContact Support
Aurinko API
Aurinko API
  • Getting started
    • What is Unified Mailbox API?
    • Getting started with Aurinko
    • Get your developer API keys
    • Adding Aurinko to Google Workspace allowlist
    • Bubble.io plugin
    • Team members and roles in applications
  • Unified APIs
    • Email API
    • Calendar API
    • Contacts API
    • Tasks API
    • Webhooks API
      • Configuring Pub/Sub for Gmail API Webhooks
    • Direct API
  • Authentication
    • OAuth Flow
      • Account OAuth Flow
      • User ОАuth Flow
      • Service Account OAuth Flow
    • Authentication scopes
    • Authorized return URLs
    • Google OAuth setup
    • Office 365 OAuth setup
    • ZOHO OAuth setup
    • Service accounts
      • Setting up G Suite service account
      • Setting up Office 365 daemon app registration
  • Scheduling
    • Create your first appointment booking page
    • Calendar Booking Page
    • Booking API
    • Group Booking API
  • Workspace Addons
    • Outlook addins
      • Create your first Outlook addin
      • Office 365: Installing Outlook addin
    • Microsoft Teams apps
      • Microsoft Teams bot setup
      • Create your first MS Teams app
      • Installing MS Teams app
    • Chrome Extensions with Google authentication
    • Google Workspace Add-Ons
  • Dynamic API
    • What is Dynamic (Virtual) API?
    • Getting Started with Dynamic API
Powered by GitBook
On this page
  • Aurinko Email API
  • Functionality
  • Aurinko account setup
  • Email API Endpoints
  • Email sync quickstart
  • Other examples
  1. Unified APIs

Email API

Aurinko's Email API provides a RESTful interface for accessing and syncing email messages across popular providers like Gmail, Office 365, iCloud, etc.

Aurinko Email API


The Aurinko Email API abstracts away differences between popular email APIs (Gmail, Office 365, Outlook.com, MS Exchange, Zoho Mail, iCloud, IMAP) to make it easy to develop email integrations.

Functionality


The Aurinko Email API provides a REST interface that focuses on accessing and syncing email messages in a uniform manner.

  • Access data for email messages, such as email content, sender and recipient information, subject lines, dates, and more.

  • Search email inboxes for specific content.

  • Update the unread and flagged status of email messages.

  • Manage and download file attachments.

  • Create drafts and send emails.

  • Incremental synchronization.

Aurinko account setup


Email API Endpoints


Email messages

Synchronization

Draft messages

Email tracking

Email sync quickstart


Start a new sync

A new sync needs to be provisioned by calling the "sync start" method /messages/sync. The sync covers all email folders (i.e. Inbox, Sent Mail, and sub folders). daysWithin limits the initial scan to emails received in the past daysWithin days.

curl -X POST -H 'Authorization: Bearer <account\_access\_token>' \
    -G https:/api.aurinko.io/v1/email/sync[?awaitReady=false] \
    -d daysWithin=10"

The Aurinko platform will initialize all necessary internal resources and let you know when it's ready to serve data. The response should look like this:

{
    "syncUpdatedToken": "asdfghjklpoiuytrew",
    "syncDeletedToken": "zxcvbnmlkjhgfdsaq",
    "ready": true
}

If the response shows ready: false call the "sync start" method again. Once the sync is ready you will get delta tokens syncUpdatedToken, syncDeletedToken and can start loading updated and deleted email messages.

Initial full sync

Initial requests /messages/sync/updated and /messages/sync/deleted are equivalent to a full sync in the specified timeMin,NOW range, plus loading all updated messages (deleted messages) since the sync start.

curl -X GET -H 'Authorization: Bearer <access token>' \
    -G https:/api.aurinko.io/v1/email/sync/updated \
    -d deltaToken='{syncUpdatedToken}'

Response:

{   
    "nextPageToken": "string",
    "nextDeltaToken": "string",
    "records": [{...}]
}

Continue loading pages using provided 'nextPageToken' until you find another 'nextDeltaToken'.

curl -X GET -H 'Authorization: Bearer <access token>' \
    -G https:/api.aurinko.io/v1/email/sync/updated \
    -d pageToken='{nextPageToken}'

Incremental sync

A new deltaToken (nextDeltaToken in a response) is provided for loading email messages that have been modified/deleted since the last sync-updated/sync-deleted request. In cases where a large number of messages have changed since the last incremental sync request, you may find a nextPageToken instead of the nextDeltaToken in the response. Continue loading pages using the provided nextPageToken until you find another nextDeltaToken.

Other examples


Email messages

To get a list of messages from, to, or cc'ing an email address, make a request to the /email/messages endpoint.

curl -X GET -H 'Authorization: Bearer <access token>' \
    -G https:/api.aurinko.io/v1/email/messages \
    -d q="text from:alexey"

To get an email message by id make a request to the /email/messages/{id} endpoint.

curl -X GET -H 'Authorization: Bearer <access token>' \
    https:/api.aurinko.io/v1/email/messages/{id}  

To send a new email with tracking make a request to the /email/messages endpoint.

curl -H 'Authorization: Bearer <access token>' \
    -X POST https:/api.aurinko.io/v1/email/messages \
    -d '{
    "subject": "re: product proposal",
    "tracking": {
        "opens": true,
        "threadReplies": true,
        "context": "Something I want to associate with this email"
    },
    "body": "Hello there!",
    "to": [
         {
             "address": "demo@aurinko.io"
         }
    ]
}'
PreviousTeam members and roles in applicationsNextCalendar API

Last updated 3 months ago

First, create your account in the , then follow the guide to . To test with Google Workspace accounts review this article: .

are the core building block for most email applications. They contain several pieces of information, such as when a message was sent, the sender's address, to whom it was sent, and the message body. They can also contain file attachments, calendar event invitations, and more.

methods allow developers to implement incremental synchronization of email messages in a uniform manner across different email providers. Aurinko supports requesting updated as well as deleted messages.

methods allow developers to create new drafts, read existing drafts, and send drafts.

methods allow developers to access and manage open and reply/bounce tracking data.

Aurinko portal
get your developer API keys
Adding Aurinko to Google Workspace allowlist
Email messages
Email sync
Draft messages
Email tracking