Pardot API Client

A fluent client for Pardot's API 4

License

License

Categories

Categories

Net CLI User Interface
GroupId

GroupId

net.jakubpas
ArtifactId

ArtifactId

pardot-api-client
Last Version

Last Version

0.1.6
Release Date

Release Date

Type

Type

jar
Description

Description

Pardot API Client
A fluent client for Pardot's API 4
Project URL

Project URL

https://github.com/jakubpas/pardot-java-client.git
Source Code Management

Source Code Management

https://github.com/jakubpas/pardot-java-client

Download pardot-api-client

How to add to project

<!-- https://jarcasting.com/artifacts/net.jakubpas/pardot-api-client/ -->
<dependency>
    <groupId>net.jakubpas</groupId>
    <artifactId>pardot-api-client</artifactId>
    <version>0.1.6</version>
</dependency>
// https://jarcasting.com/artifacts/net.jakubpas/pardot-api-client/
implementation 'net.jakubpas:pardot-api-client:0.1.6'
// https://jarcasting.com/artifacts/net.jakubpas/pardot-api-client/
implementation ("net.jakubpas:pardot-api-client:0.1.6")
'net.jakubpas:pardot-api-client:jar:0.1.6'
<dependency org="net.jakubpas" name="pardot-api-client" rev="0.1.6">
  <artifact name="pardot-api-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.jakubpas', module='pardot-api-client', version='0.1.6')
)
libraryDependencies += "net.jakubpas" % "pardot-api-client" % "0.1.6"
[net.jakubpas/pardot-api-client "0.1.6"]

Dependencies

compile (9)

Group / Artifact Type Version
org.apache.maven.plugins : maven-gpg-plugin jar 1.6
org.apache.httpcomponents : httpclient jar 4.5.3
com.fasterxml.jackson.core : jackson-core jar 2.9.0
com.fasterxml.jackson.core : jackson-databind jar 2.9.0
com.fasterxml.jackson.dataformat : jackson-dataformat-xml jar 2.9.0
com.fasterxml.jackson.datatype : jackson-datatype-joda jar 2.9.0
org.apache.logging.log4j : log4j-api jar 2.1
org.apache.logging.log4j : log4j-core jar 2.1
org.apache.logging.log4j : log4j-slf4j-impl jar 2.1

test (4)

Group / Artifact Type Version
junit : junit jar 4.12
com.tngtech.java : junit-dataprovider jar 1.12.0
org.mockito : mockito-all jar 1.10.19
commons-io : commons-io jar 2.5

Project Modules

There are no modules declared in this project.

Pardot Java API version 4 Client

Build Status

What is it?

This library intends to be a fluent style API client for Pardot's API (version 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.

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>net.jakubpas</groupId>
            <artifactId>pardot-api-client</artifactId>
            <version>0.1.6</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");

/*
 * 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

Emails

Official Documentation: Emails

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

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.

Users

Official Documentation: Users

  • Abilities of current API User
  • 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).

Changelog

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

View Changelog

Versions

Version
0.1.6