Glen Mazza's Weblog

https://glenmazza.net/blog/date/20231106 Monday November 06, 2023

Java Client for Adobe Marketo

Updated August 2024

I created a Spring OAuth2-based Marketo client, located in my blog-samples project on Github. Its format follows clients I had created previously for Salesforce CRM and Domo. While only a relatively small subset of the Marketo API is covered, the client covers some of its most important functionality, including:

  1. Lead maintenance, including querying, creating, updating, and deleting leads

  2. Activities - limited, just querying activity types supported

  3. Bulk Extracts - creating, enqueuing, polling, and downloading CSVs, both for leads and activities. Note there is a marketo.max.response.size.mb property used in the client's MarketoOAuth2Config class that can be increased beyond its default 2MB for larger downloads.

To deal with Marketo's 602 (expired token) and 606 (too many requests) error codes, Spring Retry is used, via a MarketoRetryable annotation placed on methods making outgoing API calls and a response-checker that upon receiving those codes will throw specific exceptions to trigger the retry mechanism. So far, these are the only two error codes I've found necessary to check for, but this logic can be expanded if others incurred.

The functionality is well-tested by means of the integration tests provided in the project, which also serve as examples of how to work with the client. Note also the configuration instructions given in its properties file, needed for projects using this client.

Posted by Glen Mazza in Programming at 02:00AM Nov 06, 2023 | Tags:  marketo | Comments[0]

Post a Comment:

Calendar
« November 2024
Sun Mon Tue Wed Thu Fri Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Today
About Me
Java Software Engineer
TightBlog project maintainer
Arlington, Virginia USA
glen.mazza at pm dot me
GitHub profile for Glen Mazza at Stack Overflow, Q&A for professional and enthusiast programmers
Blog Search


Blog article index
Navigation
About Blog
Blog software: TightBlog 4.0.0
Application Server: Tomcat
Database: MySQL
Hosted on: Linode
SSL Certificate: Let's Encrypt
Installation Instructions