Contact Us 1-800-596-4880

Marketo Connector - Mule 3

Marketo Connector v2.0.n

Anypoint Connector for Adobe Marketo (Marketo Connector) is a closed-source connector that provides a connection between Mule and Marketo REST APIs, implementing all the supported v1.0 Marketo API endpoints, including powerful DataSense functionality. Marketo Connector is a wrapper connector developed with MuleSoft’s Anypoint Connector DevKit version 3.8.2.

Before You Begin

This document assumes that you are familiar with the Marketo API.

To use this connector you need a:

  • Marketo instance with REST support.

  • Set of valid credentials, including the required Marketo endpoints, pointing to your instance. For more information, see Marketo Developer Documentation.

  • MuleSoft Enterprise License.

Install the Connector

  1. In Anypoint Studio, click the Exchange icon in the Studio taskbar.

  2. Sign in to Exchange with your Anypoint Platform credentials.

  3. From Anypoint Exchange, click Provided by MuleSoft.

  4. Search for the Mule 3 connector and click Install.

Configure the Marketo Connector Global Element

To set up the Global Configuration:

  1. Go to the Global Element tab and click Create.

  2. Inside the filter text box, enter Marketo and select Marketo: Configuration from the Connector Configuration directory.

  3. Enter these Global Element properties:

    1. Client ID: Your LaunchPoint ID.

    2. Client Secret: The corresponding secret for your LaunchPoint.

    3. Rest Endpoint URL: The URL of your REST web service.

The following image shows the Marketo configuration with Spring property placeholders (for more information see Configuring Properties) for the connection field values. This is the recommended approach when you plan to deploy your app to CloudHub or to a Mule runtime server. However, you may hardcode your connection credentials into the Global Element Properties shown here if you are in the development stage and simply want to speed up the process.

marketo global configuration

Before testing or running a project that uses the Marketo connector, start adding the following to your project:

  • Your Marketo credentials and endpoints in a .properties file and load them using the Property Placeholder component.

  • An inbound endpoint into your flow. For example, HTTP.

  • A Transform Message component.

  • A transformer For example, Object to JSON.

Use the Connector

See a full list of operations for any version of the connector Marketo Technical Reference.

Namespace and Schema

When designing your app in Studio, dragging the connector from the Mule Palette view onto the Anypoint Studio canvas automatically populates the XML code with the connector namespace and schema location.

If you are manually coding the Mule app in Studio’s XML editor or another text editor, paste this into the header of your configuration XML, inside the tags:

Namespace: http://www.mulesoft.org/schema/mule/marketo

Schema Location: http://www.mulesoft.org/schema/mule/marketo/current/mule-marketo.xsd

Marketo API Limitations

  • Only static lists are accessible. Smart lists are not accessible via the API.

  • Marketo has a daily request limit. You can check this limit in your Sandbox > Admin > Web Services.

CRM Integration Limitations

Instances that have a native CRM integration enabled will have Company, Opportunity, and Sales Persons APIs disabled by Marketo. So while the operations are available for selection, Marketo’s API would respond with an error specifying they cannot be used. If you’re not sure about their availability in your environment, use the Test Connectivity button in your global configuration for Marketo connector.

To Invoke an Operation

To invoke a simple operation (such as the Leads > Create Or Update operation), follow these steps:

  1. From the palette, drag and drop the Marketo connector into your flow by placing it between the Transform Message and the Object to JSON Transformer.

  2. Configure the connector by selecting the connector configuration you previously created and choosing the operation to invoke.

  3. Click Transform Message. From DataSense, you are presented with a list of possible lead fields to use:

Marketo Connector
%dw 1.0
%output application/java
---
[{
	company: "ACME",
	billingCity: "Texas",
	website: "123boom.com",
	industry: "Explosives"
}]

The complete example flow is included here for your reference.

complete example flow
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata"
xmlns:json="http://www.mulesoft.org/schema/mule/json"
xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:marketo="http://www.mulesoft.org/schema/mule/marketo"
xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/marketo
http://www.mulesoft.org/schema/mule/marketo/current/mule-marketo.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking
http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/ee/dw
http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/json
http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
    <marketo:config name="Marketo__Configuration" clientId="${clientId}"
    clientSecret="${clientSecret}" restEndpointUrl="${restEndpointUrl}"
    doc:name="Marketo: Configuration"/>
    <http:listener-config name="HTTP_Listener_Configuration"
    host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>

<flow name="Create-Lead-Flow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
        <dw:transform-message doc:name="Transform Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
[{
	company: "ACME",
	billingCity: "Texas",
	website: "123boom.com",
	industry: "Explosives"
}]]]></dw:set-payload>
        </dw:transform-message>
        <marketo:create-or-update-lead config-ref="Marketo__Configuration" doc:name="Create Lead"/>
        <json:object-to-json-transformer doc:name="Object to JSON"/>
    </flow>
    </mule>

Using the Connector in a Mavenized Mule App

If you are coding a Mavenized Mule app, include this XML snippet in your pom.xml file:

<dependency>
  <groupId>org.mule.modules</groupId>
  <artifactId>mule-module-marketo</artifactId>
  <version>x.x.x</version>
</dependency>

Replace x.x.x with the version that corresponds to the connector you are using.

To obtain the most up-to-date pom.xml file information, access the connector in Anypoint Exchange and click Dependency Snippets.

See Also

View on GitHub