Outlook
The Carbon Connect enabledIntegrations
value for Outlook is OUTLOOK
.
Authorization Type
Carbon uses OAuth 2.0 to connect to Outlook.
Authorization Flow
Log into your Microsoft account.
After your account is authenticated, you will be directed to the following screen. Now your emails can be synced.
Custom OAuth Credentials
Setting up the OAuth App
-
Create or log into your Microsoft Azure Account.
-
Under
Azure Services
, selectApp Registration
->New registration
.
- Select
Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)
as theSupported account types
.
- Add https://api.carbon.ai/integrations/outlook as the
Redirect URI
and selectWeb
under theSelect a platform
dropdown. You can also opt to use a custom CNAME record pointing to https://api.carbon.ai. The domain path must still be/integrations/outlook
.
- Under
Manage
->API permissions
add the permissionsMail.Read
,offline_access
,openid
, andUser.Read
.
- Under
Client credentials
, clickAdd a certificate or secret
->New Client Secret
. Then copy the client secret’sValue
and share it with us via Slack.
- Navigate to the
Overview
tab then copy theApplication (client) ID
and share it with us via Slack.
- Customize your app branding under
Manage
->Branding & properties
.
Synchronization
After successfully connecting your Outlook account, you have the flexibility to choose which emails to sync using the filters and folder parameters via the integrations/outlook/sync
endpoint.
Filters Parameter
The filters parameter is a JSON object with key-value pairs, supporting AND and OR operations.
Below are the supported filter keys:
category
Custom categories created in Outlook.
after
Accepts a date in the format YYYY/mm/dd (e.g., 2023/12/31), enabling the retrieval of emails after a specified date.
before
Accepts a date in the format YYYY/mm/dd (e.g., 2023/12/31), enabling the retrieval of emails before a specified date.
from
Supports an email (email@address.com
) as a string from which the email was sent.
has
Supports the value attachment
as a string to filter for all emails sent from an account.
Here are some examples:
{
"filters": {
"key": "category",
"value": "Test"
}
}
{
"filters": {
"key": "after",
"value": "2024/01/07"
}
}
Folder Parameter
The folder parameter allows you to specify the folder from which to sync emails. By default, emails are retrieved from the inbox folder. To specify a custom folder, include it in the query:
{
"folder": "Folder Name",
"filters": {
"key": "category",
"value": "Test"
}
}
Combining Filters and Operations
You can use AND and OR operations for more complex queries. Here’s an example:
{
"filters": {
"AND": [
{
"key": "after",
"value": "2024/01/07"
},
{
"OR": [
{
"key": "category",
"value": "Personal"
},
{
"key": "category",
"value": "Test"
}
]
}
]
}
}
You can use the resync_file
API endpoint to programmatically resync specific Outlook emails. To delete specific emails from Carbon, you can use the delete_files
endpoint directly.
To sync Outlook emails on a 24-hour schedule (more frequent schedules available upon request), you can use the /update_users
endpoint. This endpoint allows organizations to customize syncing settings according to their requirements, with the option to enable syncing for all data sources using the string ‘ALL’. It’s important to note that each request supports up to 100 customer IDs.
Here’s an example illustrating how to automatically enable syncing for updated Outlook content for specified users:
{
"customer_ids": ["team@carbon.ai", "sam@openai.com"],
"auto_sync_enabled_sources": ["OUTLOOK"]
}