Java Wrapper for PostageApp
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

PostageApp for Java

Build Status



To get started with PostageApp using maven, you can add the following to your pom.xml file:



You ahead and download the latest release tag and you can build the uber jar for requiring into your project as well as a thin jar if you wish to include the other dependencies yourself. Once you download the tag, go into the project directory and run:

mvn clean package

Inside the target/ folder you will have uber jar as well as the thin jar.


To get started, grab a copy of PostageApp client and set your API key:

	PostageAppClient postageClient = PostageAppFactory.getSingleton();
	postageClient.setAPIKey("Your API Key Here!");

Sending a Message

Setting up a message to send is easy! Using the MessageParams class you can build your message before sending it to the API:

MessageParams params = new MessageParams()

Once you have configured your MessageParams you can ship it off to the API using the sendMessage call:

try {
} catch (PostageAppException exception) {
	// Handle API Exception
Adding Recipients

To add a list of recipients to your message:

List<String> recipients = new ArrayList<String>();

Adding Attachments

To add attachments to your message parameters:

String pdfName = "filename.pdf";
String contentType = "application/octet-stream";
String encodedData = "BASE64_ENCODED_DATA";

params.addAttachment(pdfName, contentType, encodedDate);
Adding Content

Adding content to message paramters:

String contentType = "text/plain";
String content = "This is a test!";

params.addContentType(contentType, content);
Method Chaining

For convenience, you can also change the building of parameters using the builder pattern:

List<String> recipients = new ArrayList<String>();
   MessageParams params = new MessageParams()
   	.addContentType("text/plain", "This is a test!");

Besides sending messages you have access to all the other API endpoints as well:

  • getMessageReceipt
  • getMethodList
  • getAccountInfo
  • getProjectInfo
  • getMessages
  • getMessageTranmissions
  • getMetrics
  • getMessageStatus
  • getMessageDeliveryStatus
  • getRecipientsList

Refer to the online documation / javadocs for usage for these endpoints.


API Documentation: PostageApp API Documentation