Skip to content
A Java Client for the Pardot API
Java
Branch: master
Clone or download
Latest commit 760af0b May 20, 2019

README.md

Pardot Java API Client

Build Status

What is it?

This library intends to be a fluent style API client for Pardot's API (version 3 and 4).

Note It currently is not fully featured/fully implemented. If there is a feature/end point that you need that is not yet implemented, please read the How to Contribute section, or Create an issue requesting it.

Note Use this library at your own risk! Currently there are no known issues, but as an unofficial library, there are no guarantees.

Important Breaking Change to Pardot API

As of October 31, 2018 Pardot is disabling the TLS 1.0 encryption protocol. This means that versions of this library prior to 1.0.0 will cease to be able to connect to the Pardot Api.

Version 1.0.0 updates the library to use TLS 1.1 and 1.2 protocols. Everyone is encouraged to update the library prior to October 31st 2018.

How to use this library

This client library is released on Maven Central. Add a new dependency to your project's POM file:

<dependency>
    <groupId>com.darksci</groupId>
    <artifactId>pardot-api-client</artifactId>
    <version>1.0.0</version>
</dependency>

Example Code:

/*
 * Create a new configuration object with your Pardot credentials.
 *
 * This configuration also allows you to define some optional details on your connection,
 * such as using an outbound proxy (authenticated or not).
 */
final Configuration configuration = new Configuration("YourPardotUserNameHere", "PardotPassword", "UserKey");

/*
 * Optionally select which API version to use, if none is explicitly selected
 * the library will default to version 3.
 */
configuration.withApiVersion3();

/* Or */
configuration.withApiVersion4();

/*
 * Create an instance of PardotClient, passing your configuration.
 */
final PardotClient client = new PardotClient(configuration);

/*
 * The client will automatically authenticate when you make your first request, no need to
 * explicitly login.
 *
 * Lets create a simple Account request, and execute it.
 */
final AccountReadRequest accountReadRequest = new AccountReadRequest();
final Account account = client.accountRead(accountReadRequest);


/*
 * Or lets do a more complex Campaign search.
 */
final CampaignQueryRequest campaignQueryRequest = new CampaignQueryRequest()
    .withUpdatedAfter(DateParameter.last7Days())
    .withIdLessThan(1234L)
    .withSortById()
    .withSortOrderDescending();
final CampaignQueryResponse.Result campaignQueryResponse = client.campaignQuery(campaignQueryRequest);

/*
 * And when you're done, call close on PardotClient.
 */
client.close();

Or Using the Try-With-Resources Pattern:

/*
 * Since PardotClient implements Autoclosable, you can also use the try-with-resources pattern.
 */
final Configuration configuration = new Configuration("YourPardotUserNameHere", "PardotPassword", "UserKey");
try (final PardotClient client = new PardotClient(configuration)) {
    // Use client instance as needed
    client.accountRead(new AccountReadRequest());

    // client.close() is automatically called at the end of the try {} block.
}

What Features are implemented?

Authentication

Official Documentation: Authentication

Authenticating with Pardot's API using your Pardot Username, Password, and User Token.

Accounts

Official Documentation: Accounts

  • Read

Campaigns

Official Documentation: Campaigns

  • Create
  • Query
  • Read
  • Update

Custom Fields

Official Documentation: Custom Fields

  • Create
  • Query
  • Read
  • Update

Custom Redirects

Official Documentation: Custom Redirects

  • Query
  • Read

Emails

Official Documentation: Emails

  • Read
  • Sending List Emails
  • Sending One to One Emails
  • Stats

Email Clicks

Official Documentation: Email Clicks

  • Query

Email Templates

Official Documentation: Email Templates

  • List One to One templates
  • Read

Forms

Official Documentation: Forms

  • Create
  • Delete
  • Query
  • Read
  • Update

Lists

Official Documentation: Lists

  • Create
  • Query
  • Read
  • Update

List Memberships

Official Documentation: ListMemberships

  • Create
  • Query
  • Read
  • Update

Opportunities

Official Documentation: Opportunities

  • Create
  • Delete
  • Query
  • Read
  • Undelete
  • Update

Prospects

Official Documentation: Prospects

  • Assign
  • Create - Does not support multiple values for record-multiple fields.
  • Delete
  • Query
  • Read
  • Unassign
  • Update - Does not support multiple values for record-multiple fields.
  • Upsert - Does not support multiple values for record-multiple fields.

Tags

Official Documentation: Tags

  • Query
  • Read

TagObjects

Official Documentation: TagObjects

  • Query
  • Read

Users

Official Documentation: Users

  • Abilities of current API User
  • Query
  • Read

Visitors

Official Documentation: Visitors

  • Assign
  • Query
  • Read

Visitor Activities

Official Documentation: VisitorActivities

  • Query
  • Read

How to Contribute

Want to help implement the missing API end points? Fork the repository, write some code, and submit a PR to the project!

Implementing new API requests really only requires implementing the two following interfaces, along with minimal glue code.

Request

The Request interface can typically be implemented by extending either BaseRequest or BaseQueryRequest. This defines the end point that the request will hit, along with what parameters will be passed along with it.

ResponseParser

The ResponseParser interface defines how to take the API's response and convert it back into user friendly Plain Old Java Objects (POJOs).

Contributors

Crim LoRez

Changelog

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

View Changelog

You can’t perform that action at this time.