Introduction

API is built on HTTP. Our API is RESTful. There is no need to learn yet another 3rd party library to use the API. You can use your favorite HTTP/REST library available for your programming language to make HTTP calls. You can also use our prepared libraries to use MailerSoft. All code examples will be using our prepared libraries.

Base URL

All API requests should start with the following base part:

https://api.mailersoft.com/api/v1/

Authentication

When you sign up for an account, you are given an API key. You authenticate to the MailerSoft API by providing your API key in the request. You can find your API key in page: Account & Settings ยป Account Settings

To authenticate you should pass apiKey parameter in the request. When sending POST/PUT/DELETE requests you can pass apiKey parameter together with other parameters. It is not necessary to pass it as GET parameter.

You can try the following API call right in your browser:

https://api.mailersoft.com/api/v1/campaigns/?apiKey=YOUR_API_KEY
Warning Keep your API key secret!

Formats

POST requests that are made to MailerSoft must have header Content-Type: application/x-www-form-urlencoded value and the data should be formatted respectively. All responses from MailerSoft are in JSON format. There is an option to use XML format instead of JSON. Just add .xml to your request link and all responses will be in XML, e.g.

https://api.mailersoft.com/api/v1/campaigns.xml/?apiKey=YOUR_API_KEY

If you are using XML format your requests should be enclosed in <request> element. All responses received will be in <response> element.

Wrappers

PHP library which implements the complete functionality of the MailerSoft REST API. Examples how to use it are shown next to every function in documentation.

https://github.com/mailersoft/mailersoft-php

Errors

MailerSoft uses standard HTTP response codes.

Code Description
200 Everything is OK
400 Missing a required parameter or calling invalid method
401 Invalid API key provided
404 Can't find requested items