Integrate your Bubble apps with users' Gmail, Office 365, Outlook.com, hosted MS Exchange, Zoho Mail, and IMAP accounts through Aurinko's Unified Mailbox API.
The Aurinko plugin allows your app to access users' email and calendars. Future versions can add access to contacts, tasks, and a number of CRM APIs.
1. Signup for an Aurinko account, to get your APP_CLIENT_ID and APP_CLIENT_SECRET
2. Add the Aurinko API plugin to your Bubble application. Enter your APP_CLIENT_ID and APP_CLIENT_SECRET keys. For APP_API_DOMAIN specify 'api.aurinko.io'. (Ask us about configuring a custom domain alias.)
3. You need to have OAuth clientId and clientSecret from Google, Microsoft, Zoho to be able to use Aurinko's OAuth Flow in production. See how to register your apps: Google OAuth setup, Office 365 OAuth setup.
But for testing during your trial you can use Aurinko's OAuth clientId and clientSecret. For Gmail you'll have to allow-list Aurinko: Adding Aurinko to Google Workspace allowlist
Redirect URI: Redirect page vs. Custom domain alias
Google app registrations allow only authorized redirect URIs under a domain you own so the default Aurinko's Redirect URI https://api.aurinko.io/v1/auth/callback won't work for you in production.
You have two options:
- Contact us about provisioning a domain alias for your Aurinko app so your could use a url like https://aurinko.mydomain/v1/auth/callback
- Provision an aurinko_redirect page in Bubble and use it for redirecting all calls to Aurinko's https://api.aurinko.io/v1/auth/callback with the url parameters state, code, and scope.In your Aurinko app settings insert the url of your aurinko_redirect page, and specify the url as an Authorized redirect URI in your Google app registration.
4. To start accessing email or calendar data you need to get a user authorization to access a remote account. Use the plugin's 'Get OAuth Url (Mailbox)' action to generate a required OAuth request url and the 'Open External Website' action with it.
Callback page (return_url)
Provision a callback page that will receive an Aurinko account token. All API calls require Bearer Auth with the account token.
- For 'response_type=code' - Use the plugin's 'Get Token for Code' action to exchange the auth code for an account token. If you Save the token in your database.
5. Once your app has obtained account tokens it can start calling the API actions, or attaching the API as a data source, just insert the token (prefixed with 'Bearer ') into the 'Authorization:' header.
6. The following API methods have been defined in the plugin. Also see the full API reference.