Contact Us 1-800-596-4880

Adobe Marketo Connector - Mule 4

Adobe Marketo Connector v3.0

Anypoint Connector for Adobe Marketo (Marketo Connector) is a closed-source connector that provides a connection between the Mule runtime engine (Mule) and Adobe Marketo REST APIs. This connector implements all supported v1.0 Adobe Marketo API endpoints and provides Mule 4 DataWeave functionality.

Before You Begin

To use this information, you must be familiar with Adobe Marketo, Mule runtime engine (Mule), Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow, and Global Elements.

You need login credentials to test your connection to your target resource.

For software requirements and compatibility information, see the Connector Release Notes.

POM File Information

To use this connector with Maven, use this pom.xml dependency:

<dependency>
  <groupId>com.mulesoft.connectors</groupId>
  <artifactId>mule-marketo-connector</artifactId>
  <version>x.x.x</version>
  <classifier>mule-plugin</classifier>
</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.

Add the Connector to Your Studio Project

Anypoint Studio provides two ways to add the connector to your Studio project: from the Exchange button in the Studio taskbar or from the Mule Palette view.

Add the Connector Using Exchange

  1. In Studio, create a Mule project.

  2. Click the Exchange icon (X) in the upper-left of the Studio task bar.

  3. In Exchange, click Login and supply your Anypoint Platform username and password.

  4. In Exchange, search for "marketo".

  5. Select the connector and click Add to project.

  6. Follow the prompts to install the connector.

Add the Connector in Studio

  1. In Studio, create a Mule project.

  2. In the Mule Palette view, click (X) Search in Exchange.

  3. In Add Modules to Project, type "marketo" in the search field.

  4. Click this connector’s name in Available modules.

  5. Click Add.

  6. Click Finish.

To Configure in Studio

  1. Drag the connector operation to the Studio Canvas.

  2. Click the green plus button to configure the connector

  3. A window appears so that you can configure the following fields:

Studio Configuration options
Field Description

Base Path

The Marketo base path to start from, for example / (forward slash).

Client Id

Your Marketo Client ID.

Client Secret

Your Marketo Client Secret.

Host

Domain where your Marketo instance is hosted.

Port

Port of Marketo instance.

Protocol

The protocol to use for data transfer such as HTTPS.

Access Token Url

The URL used to achieve an authorization token.

Use Case: Create a Program in Studio 7

Studio flow Listener

Use Case: XML

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

<mule xmlns:os="http://www.mulesoft.org/schema/mule/os"
xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:marketo-rest-api="http://www.mulesoft.org/schema/mule/marketo-rest-api"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.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/marketo-rest-api
http://www.mulesoft.org/schema/mule/marketo-rest-api/current/mule-marketo-rest-api.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/os
http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd">
	<configuration-properties file="mule-app.properties"
	doc:name="Configuration properties"/>
	<http:listener-config name="HTTP_Listener_config"
	doc:name="HTTP Listener config">
		<http:listener-connection host="localhost" port="8081" />
	</http:listener-config>
	<marketo-rest-api:config name="Marketo_Rest_API_Config" doc:name="Marketo Rest API Config" property_basePath="/"
	property_clientId="${clientId}"
	property_clientSecret="${clientSecret}"
	property_host="${host}"
	property_accessTokenUrl="${accessTokenUrl}"
	property_port="${port}"
	property_protocol="${protocol}"/>
	<os:object-store name="Object_store" doc:name="Object store"  config-ref="ObjectStore_Config"/>
	<os:config name="ObjectStore_Config" doc:name="ObjectStore Config"  />
	<flow name="Create_Form" >
		<http:listener doc:name="HTTP"  config-ref="HTTP_Listener_config" path="/createForm" />
		<ee:transform doc:name="Transform Message">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
{
	"description": "FormDemo",
	"folder":"22498",
	"name": "MarketoDemoForm_01"
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<marketo-rest-api:create-form doc:name="Create form" config-ref="Marketo_Rest_API_Config"/>
		<ee:transform doc:name="Object to JSON">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<os:store doc:name="Store form id" key="formId" objectStore="Object_store">
			<os:value ><![CDATA[#[payload.result[0].id]]]></os:value>
		</os:store>
		<set-variable
		value="#[payload.result[0].id]"
		doc:name="Set Variable"
		variableName="id"/>
		<set-variable
		value="#[payload.result[0].name]"
		doc:name="Set Variable"
		variableName="name" />
		<logger level="INFO" doc:name="Logger"
		message="Created form named: #[vars.name] with id: #[vars.id]" />
	</flow>
</mule>
View on GitHub