MailChimp

The MailChimp connector lets you perform insert, delete, update, and read operations on MailChimp dataset.

Before you begin

Before using the MailChimp connector, do the following tasks:

  • In your Google Cloud project:
    • Ensure that network connectivity is set up. For information about network patterns, see Network connectivity.
    • Grant the roles/connectors.admin IAM role to the user configuring the connector.
    • Grant the following IAM roles to the service account that you want to use for the connector:
      • roles/secretmanager.viewer
      • roles/secretmanager.secretAccessor

      A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs. If you don't have a service account, you must create a service account. For more information, see Creating a service account.

    • Enable the following services:
      • secretmanager.googleapis.com (Secret Manager API)
      • connectors.googleapis.com (Connectors API)

      To understand how to enable services, see Enabling services.

    If these services or permissions have not been enabled for your project previously, you are prompted to enable them when configuring the connector.

MailChimp configuration

Set up a MailChimp account

For more information about setting up the MailChimp account, see Account Login.

Set up authentication

API Keys - authentication type

For more information about generating a MailChimp API Key, see Generate API Key.

  1. Navigate to the API Keys section of your MailChimp account.
  2. Click Create New Key and enter a descriptive name.
  3. Copy the generated key and store it in a secure location.You cannot view or copy the key later.

OAuth 2.0 - authentication type

For more information about generating OAuth Credentials for MailChimp account, see GenerateOAuth Credentials.

  1. Navigate to the Registered Apps page in your MailChimp account.
  2. Click Register An App.
  3. Complete the Register an App form.
  4. Click Create.
  5. Copy the client ID and client secret that appears.

Configure the connector

Configuring the connector requires you to create a connection to your data source (backend system). A connection is specific to a data source. It means that if you have many data sources, you must create a separate connection for each data source. To create a connection, do the following steps:

  1. In the Cloud console, go to the Integration Connectors > Connections page and then select or create a Google Cloud project.

    Go to the Connections page

  2. Click + CREATE NEW to open the Create Connection page.
  3. In the Location section, choose the location for the connection.
    1. Region: Select a location from the drop-down list.

      For the list of all the supported regions, see Locations.

    2. Click NEXT.
  4. In the Connection Details section, complete the following:
    1. Connector: Select MailChimp from the drop down list of available Connectors.
    2. Connector version: Select the Connector version from the drop down list of available versions.
    3. In the Connection Name field, enter a name for the Connection instance.

      Connection names must meet the following criteria:

      • Connection names can use letters, numbers, or hyphens.
      • Letters must be lower-case.
      • Connection names must begin with a letter and end with a letter or number.
      • Connection names cannot exceed 49 characters.
    4. Optionally, enter a Description for the connection instance.
    5. Optionally, enable Cloud logging, and then select a log level. By default, the log level is set to Error.
    6. Service Account: Select a service account that has the required roles.
    7. Optionally, configure the Connection node settings:

      • Minimum number of nodes: Enter the minimum number of connection nodes.
      • Maximum number of nodes: Enter the maximum number of connection nodes.

      A node is a unit (or replica) of a connection that processes transactions. More nodes are required to process more transactions for a connection and conversely, fewer nodes are required to process fewer transactions. To understand how the nodes affect your connector pricing, see Pricing for connection nodes. If you don't enter any values, by default the minimum nodes are set to 2 (for better availability) and the maximum nodes are set to 50.

    8. Datacenter: The datacenter used for your MailChimp account.
    9. Use proxy: Select this checkbox to configure a proxy server for the connection and configure the following values:
      • Proxy Auth Scheme: Select the authentication type to authenticate with the proxy server. The following authentication types are supported:
        • Basic: Basic HTTP authentication.
        • Digest: Digest HTTP authentication.
      • Proxy User: A user name to be used to authenticate with the proxy server.
      • Proxy Password: The Secret manager secret of the user's password.
      • Proxy SSL Type: The SSL type to use when connecting to the proxy server. The following authentication types are supported:
        • Auto: Default setting. If the URL is an HTTPS URL, then the Tunnel option is used. If the URL is an HTTP URL, then the NEVER option is used.
        • Always: The connection is always SSL enabled.
        • Never: The connection is not SSL enabled.
        • Tunnel: The connection is through a tunneling proxy. The proxy server opens a connection to the remote host and traffic flows back and forth through the proxy.
      • In the Proxy Server section, enter details of the proxy server.
        1. Click + Add destination.
        2. Select a Destination Type.
          • Host address: Specify the hostname or IP address of the destination.

            If you want to establish a private connection to your backend system, do the following:

    10. Optionally, click + ADD LABEL to add a label to the Connection in the form of a key/value pair.
    11. Click NEXT.
  5. In the Authentication section, enter the authentication details.
    1. The MailChimp connection doesn't require any authentication.
    2. Click NEXT.
  6. Review: Review your connection and authentication details.
  7. Click Create.

Connection configuration samples

This section lists the sample values for the various fields that you configure when creating the MailChimp connection.

API Keys - connection type

Field name Details
Location us-central1
Connector MailChimp
Connector version 1
Connection Name google-cloud-mailchimp-api-conn
Service Account SERVICE_ACCOUNT_NAME@serviceaccount
Minimum number of nodes 2
Maximum number of nodes 50
Authentication:Not Available True
API Key API_KEY
Secret version 1

OAuth 2 - connection type

Field name Details
Location us-central1
Connector MailChimp
Connector version 1
Connection Name google-cloud-mailchimp-oauth-conn
Service Account SERVICE_ACCOUNT_NAME@serviceaccount
Minimum number of nodes 2
Maximum number of nodes 50
Authentication:OAuth 2.0 - Authorization code True
Client ID CLIENT_ID
Client Secret CLIENT_SECRET
Secret version 1

Entities, operations, and actions

All the Integration Connectors provide a layer of abstraction for the objects of the connected application. You can access an application's objects only through this abstraction. The abstraction is exposed to you as entities, operations, and actions.

  • Entity: An entity can be thought of as an object, or a collection of properties, in the connected application or service. The definition of an entity differs from a connector to a connector. For example, in a database connector, tables are the entities, in a file server connector, folders are the entities, and in a messaging system connector, queues are the entities.

    However, it is possible that a connector doesn't support or have any entities, in which case the Entities list will be empty.

  • Operation: An operation is the activity that you can perform on an entity. You can perform any of the following operations on an entity:

    Selecting an entity from the available list, generates a list of operations available for the entity. For a detailed description of the operations, see the Connectors task's entity operations. However, if a connector doesn't support any of the entity operations, such unsupported operations aren't listed in the Operations list.

  • Action: An action is a first class function that is made available to the integration through the connector interface. An action lets you make changes to an entity or entities, and vary from connector to connector. Normally, an action will have some input parameters, and an output parameter. However, it is possible that a connector doesn't support any action, in which case the Actions list will be empty.

System limitations

The MailChimp connector can process 6 transactions per second, per node, and throttles any transactions beyond this limit. By default, Integration Connectors allocates 2 nodes (for better availability) for a connection.

For information on the limits applicable to Integration Connectors, see Limits.

Actions

This section lists the actions supported by the connector. To understand how to configure the actions, see Action examples.

CampaignTest action

Send a test email for a MailChimp campaign.

Input parameters of the CampaignTest action

Parameter Name Data Type Required Description
CampaignID string True The ID of the campaign to test.
TestEmails string True A comma-separated list of emails to send.
SendType string True The type of test email to send. Either html or plaintext The allowed values are html, plaintext. The default value is html.

For example on how to configure the CampaignTest action, see Action examples.

CampaignSend action

Send a MailChimp campaign.

Input parameters of the CampaignSend action

Parameter Name Data Type Required Description
CampaignID string True The ID of the campaign to send.

For example on how to configure the CampaignSend action, see Action examples.

CampaignPause action

Pauses a MailChimp RSS campaign.

Input parameters of the CampaignPause action

Parameter Name Data Type Required Description
CampaignID string True The ID of the campaign to pause.

For example on how to configure the CampaignPause action, see Action examples.

CampaignResume action

Resumes a MailChimp RSS campaign.

Input parameters of the CampaignResume action

Parameter Name Data Type Required Description
CampaignID string True The ID of the campaign to resume.

For example on how to configure the CampaignResume action, see Action examples.

Action examples

Example - CampaignTest

  1. In the Configure connector task dialog, click Actions.
  2. Select the CampaignTest action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "CampaignID": "4bd7a9abac",
    "TestEmails": "sample@gmail.com",
    "SendType": "plaintext"
    }
  4. If the action is successful, the CampaignTest task's connectorOutputPayload response parameter will have a value similar to the following:

    {
    "Success": "true"
    }

Example - CampaignSend

  1. In the Configure connector task dialog, click Actions.
  2. Select the CampaignSend action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "CampaignID": "1699382f6d"
    } 
  4. If the action is successful, the CampaignSend task's connectorOutputPayload response parameter will have a value similar to the following:

    {
    "Success": "true"
    }

Example - CampaignPause

  1. In the Configure connector task dialog, click Actions.
  2. Select the CampaignPause action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "CampaignID": "4bd7a9abac"
    }
  4. If the action is successful, the CampaignPause task's connectorOutputPayload response parameter will have a value similar to the following:

     {
    "Success": "true"
    }

Example - CampaignResume

  1. In the Configure connector task dialog, click Actions.
  2. Select the CampaignResume action, and then click Done.
  3. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "CampaignID": "4bd7a9abac"
    }
  4. This example will show the specific Object records. If the action is successful, the CampaignResume task's connectorOutputPayload response parameter will have a value similar to the following:

    {
    "Success": "true"
    }

Entity operation examples

This section shows how to perform some of the entity operations in this connector.

Example - List all campaigns

  1. In the Configure connector task dialog, click Entities.
  2. Select Campaigns from the Entity list.
  3. Select the List operation, and then click Done.
  4. Optionally, in Task Input section of the Connectors task, you can filter your result set by specifying a filter clause. Specify the filter clause value always within the single quotes (').

Example - Get a single automation

  1. In the Configure connector task dialog, click Entities.
  2. Select Automations from the Entity list.
  3. Select the Get operation, and then click Done.
  4. In the Task Input section of the Connectors task, click EntityId and then enter 1ac204985e in the Default Value field.

    Here, 1ac204985e is a unique record ID in the Automations entity.

Example - Delete a campaign

  1. In the Configure connector task dialog, click Entities.
  2. Select Campaigns from the Entity list.
  3. Select the Delete operation, and then click Done.
  4. In the Task Input section of the Connectors task, click entityId and then enter 06f20ace93 in the Default Value field.

Example - Create a campaign folder

  1. In the Configure connector task dialog, click Entities.
  2. Select CampaignFolders from the Entity list.
  3. Select the Create operation, and then click Done.
  4. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {
    "Name": "CampaignFolderCreated1707812599459"
    }
    

    Running this example, returns a response similar to the following in the connector task's connectorOutputPayload output variable:

    {
    "Id": "650469bb07"
    }
    

Example - Update a file manager folder

  1. In the Configure connector task dialog, click Entities.
  2. Select FileManagerFolders from the Entity list.
  3. Select the Update operation, and then click Done.
  4. In the Task Input section of the Connectors task, click connectorInputPayload and then enter a value similar to the following in the Default Value field:
    {   
    "Name": "MyNewFolder9"
    }
  5. Click entityId, and then enter 18159 in the Default Value field.

    Running this example, returns a response similar to the following in the connector task's connectorOutputPayload output variable:

    {   
    "Id": "18159"
    }

Use terraform to create connections

You can use the Terraform resource to create a new connection.

To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.

To view a sample terraform template for connection creation, see sample template.

When creating this connection by using Terraform, you must set the following variables in your Terraform configuration file:

Parameter name Data type Required Description
datacenter ENUM False The datacenter used for your MailChimp account. Supported values are: None, US1, US2, US3, US4, US5, US6, US7, US8, US9, US10, US11, US12, US13
proxy_enabled BOOLEAN False Select this checkbox to configure a proxy server for the connection.
proxy_auth_scheme ENUM False The authentication type to use to authenticate to the ProxyServer proxy. Supported values are: BASIC, DIGEST, NONE
proxy_user STRING False A user name to be used to authenticate to the ProxyServer proxy.
proxy_password SECRET False A password to be used to authenticate to the ProxyServer proxy.
proxy_ssltype ENUM False The SSL type to use when connecting to the ProxyServer proxy. Supported values are: AUTO, ALWAYS, NEVER, TUNNEL

Use the MailChimp connection in an integration

After you create the connection, it becomes available in both Apigee Integration and Application Integration. You can use the connection in an integration through the Connectors task.

  • To understand how to create and use the Connectors task in Apigee Integration, see Connectors task.
  • To understand how to create and use the Connectors task in Application Integration, see Connectors task.

Get help from the Google Cloud community

You can post your questions and discuss this connector in the Google Cloud community at Cloud Forums.

What's next