How to use IBM App Connect with Gmail

Gmail is Google's free web-based email service that provides storage for emails, chat, and archiving.

Use IBM® App Connect to connect Gmail to other applications like Slack. For example, when emails are received in Gmail, you are notified immediately in Slack.

Availability:
  • A connector in IBM App Connect Enterprise as a ServiceApp Connect Enterprise as a Service connector
  • A local connector in a Designer instance of IBM App Connect in containers (Continuous Delivery release)Local connector in containers (Continuous Delivery release)
  • A local connector in a Designer instance of IBM App Connect in containers (Extended Update Support)Local connector in containers (Extended Update Support release)
  • A local connector in a Designer instance of IBM App Connect in containers (Long Term Support)Local connector in containers (Long Term Support release)

Supported product and API versions

To find out which product and API versions this connector supports, see Detailed System Requirements on the IBM Support page.

Connecting to Gmail

Complete the connection fields that you see in the App Connect Designer Catalog page or flow editor. If necessary, work with your Gmail administrator to obtain these values.

Google Analytics authorization types and connection fields:

Authorization type Connection fields Applicability
Use the application's website to sign in (OAUTH 2.0 AUTH CODE) Application client ID App Connect Enterprise as a Service
Application client secret
Provide credentials for App Connect to use (BASIC OAUTH) Application client ID App Connect Enterprise as a Service and App Connect in containers
Application client secret
OAuth Access token
OAuth Refresh token
The following table contains descriptions of the connection fields.
Tip:

To connect using the website OAuth 2.0 authorization method, see Connecting to a Google application using the website OAuth 2.0 authorization method

To generate the values for Application client ID, Application client secret, Access token, and Refresh token see Getting OAuth client ID, client secret, access token, and refresh token for Google applications.
Connection field Description
Application client ID The unique identifier that is generated from the Google API Console that maps to specific project requests.
Application client secret The application client secret for the unique application client ID created for a specific project.
OAuth Access token The access token that is generated from the application client ID and client secret.
OAuth Refresh token The refresh token that is generated from the application client ID and client secret.

To connect to a Gmail endpoint from the App Connect Designer Catalog page for the first time, expand Gmail, then click Connect.

Tip:

Before you use the account that is created in App Connect in a flow, rename the account to something meaningful that helps you to identify it. To rename the account on the Catalog page, select the account, open its options menu (⋮), then click Rename Account.

What to consider first

Before you use App Connect Designer with Gmail, take note of the following considerations:
  • (General consideration) You can see lists of the trigger events and actions that are available on the Catalog page of the App Connect Designer.

    For some applications, the events and actions in the catalog depend on the environment and whether the connector supports configurable events and dynamic discovery of actions. If the application supports configurable events, you see a Show more configurable events link under the events list. If the application supports dynamic discovery of actions, you see a Show more link under the actions list.

  • (General consideration) If you are using multiple accounts for an application, the set of fields that is displayed when you select an action for that application can vary for different accounts. In the flow editor, some applications always provide a curated set of static fields for an action. Other applications use dynamic discovery to retrieve the set of fields that are configured on the instance that you are connected to. For example, if you have two accounts for two instances of an application, the first account might use settings that are ready for immediate use. However, the second account might be configured with extra custom fields.
  • The New email event can process emails up to 10MB.

Adding attachments to Gmail

Note: When you insert a Send email action in a flow, you can add one or more attachments by using the Attachments array field. The total size of the attachments cannot exceed 25 MB.
  • The ability to add attachments is available only in an instance of App Connect Designer 12.0.5.0-r3 or later for App connect in containers.
  • If you are using App Connect Designer in containers and your workflow expects frequent large payloads, the default value of the memory upper limit for running the designerflows container might be too low. You can increase this value by updating the spec.integrationServer.containers.designerflows.resources.limits.memory setting in the Designer custom resource. For more information on the default values for this parameter, see Custom resource values.

When you insert a Send email action in a flow, you can add one or more attachments by using the Attachments array field. The total size of the attachments cannot exceed 25 MB.

To add an attachment in Gmail, complete the following steps:
  1. Switch to Advanced mode to view the Attachments field.
    Advanced mode view for Gmail connector showing the attachments field
  2. In Advanced mode, update the Attachments, File name, and Content fields.
    • Attachments: One or more files to attach to the email.
    • File name: The file name, including the extension, of the attachment; for example, test.pdf, test.docx, or test.txt.
    • Content: The content of the file attachment. If the content type is binary, specify the content in Base64-encoded format.
    You can choose to fill these fields by using different methods.
    • You can use JSONata functions to fill the fields. For example:
      Example of attachment fields filled using JSONata functions
    • You can map values corresponding to the fields from the previous node. For example:
      Example of attachment fields filled using mapped values from the previous node
    • You can map values corresponding to the fields from the request body parameters, where attachments are an array of objects. For example:
      Example of attachment fields filled using mapped values from the request body parameters

Events and actions

Gmail events

These events are for changes in this application that trigger a flow to start completing the actions in the flow.

Note: In containers, only local accounts can be used for these events.
Emails
New email

Gmail actions

Your flow completes these actions on this application.

Emails
Send email
Delete email
Retrieve emails
Update email labels

Examples

For examples of using Gmail in flows, see the following resources:
Dashboard tile for a template that uses Gmail
Dashboard tile for a template that uses Gmail
Dashboard tile for a template that uses Gmail

Use templates to quickly create flows for Gmail.

Learn how to use App Connect templates to create flows that connect Gmail to other applications. For example, open the Templates gallery, and then search for Gmail.