API Kits

We’ve put together a range of samples in a number of common languages to make integrating with our API as easy as possible. While each sample doesn’t cover every method available, they can be adapted quite easily to work for the other methods.

We’re continually expanding our range of samples, but if you’ve put together some code for yourself or a client for a language or a method we haven’t covered, get in touch with support and we’ll share it here. Right now we have samples in the following:

.NET C# Sample

For the .NET samples we decided to create a small Visual Studio console project for the API wrapper. This project contains a number of samples to demonstrate the usage of all of the different API methods available. We make use of our .NET Campaign Monitor wrapper, thereby showing the easiest way to interact with the API. We'll walk you through how to set this up below, but the accompanying sample project has this dll included already.

Download the .NET sample with source or without source

Usage Instructions

  1. Create a new project of whatever type is desired.
  2. Right-click on the References folder, select Add Reference.

    {title}

  3. Choose the Browse tab, and navigate to the location of the CampaignMonitorAPIWrapper dll. Select the dll, and click OK.

    {title}

  4. You can now make use of the wrapper like so.

    {title}

 

Flash Sample

Located at our GitHub account, we have a single Flash AS3 sample for download. This sample shows how to add a subscriber with custom fields. Thanks goes out to Ben Vogelzang for the original file. If you've got an extra sample that you'd like to contribute, feel free to let us know!

Download the ActionScript 2 or ActionScript 3 sample

 

Java Sample

This SOAP-based Java wrapper supports all API methods and packages all functionality into a jar file. Available at GitHub - feel free to fork!

 

Perl sample

A Perl class written by Nicolas Ramz that is a basic implementation of some API methods including Subscriber.AddAndResubscribeWithCustomFields, Client.GetLists, and Subscriber.AddWithCustomFields.

 

PHP Sample

The PHP sample is easily our most requested and it shouldn't be very hard to follow what's happening here. There's a base class included along with a number of example API calls to see how to use the different methods. You can find everything related to the PHP sample over at the Google Code page.

PHP developers using the PHP sample may also like to read The Campaign Monitor API and the PHP wrapper forum topic.

 

Python Sample

There are currently two different Python wrappers for the Campaign Monitor API.

The first is a wrapper written by Christopher Cote of Entropealabs for integration with a Django app, which dynamically supports all Campaign Monitor API methods. It's up on our GitHub account, so you can fork the code yourself!

The second is a Python class that is a bare-bones implementation of common Campaign Monitor API methods, now updated to use the new API endpoints. Originally by Grant Young, fixes contributed by Juan Pablo Di Lelle.

 

Ruby Sample

There are currently three types of Ruby Gems available for working with the Campaign Monitor API.

The first uses the SOAP protocol to interface with the API and was developed by Marcelo Menezes. It currently supports all available API methods.

The second is an extremely lightweight wrapper built by Tim Morgan. In Tim’s words - It’s possibly exaggeration to call this a “library” since it’s really only a class that utilizes HTTParty—a wonderful gem for consuming REST APIs. The code here is only about 20 lines or so; HTTParty does all the hard work. Because it uses the HTTP protocol, this wrapper doesn’t support our SOAP based API methods.

The third wrapper, developed by Jordan Brock and maintained by Jeremy Weiskotten also uses the HTTP protocol to access the API. Like the wrapper above, it supports most, but not all Campaign Monitor API methods.

 

WSDL file

You can find the WSDL file for the Campaign Monitor API at either http://api.createsend.com/api/api.asmx?wsdl or https://api.createsend.com/api/api.asmx?wsdl.