This documentation is no longer kept up-to-date.  As of 2015 the new Reseller API documentation can be found here: link

 

 

Introduction

 

For Email Previews the work flow is:

 

 

Details

 

Step 1 :: Start a Litmus email test by sending a POST request to https://previews-api.litmus.com/api/v1/EmailTests

 

You can customze the request by only requesting a few TestingApplications.

You can get a complete list of TestingApplications by making a GET request to https://previews-api.litmus.com/api/v1/EmailTests/TestingApplications.  If you want to test all TestingApplications you can just send an empty EmailTest object.

 

An example of a creating an email preview for all TestingApplications would look like this:

 

curl -u username:password -X POST -H "Content-type: application/json"  https://previews-api.litmus.com/api/v1/EmailTests -d '{}'

 

An example of a creating an email preview for only some TestingApplications would look like this:

 

curl -u username:password -X POST -H "Content-type: application/json"  https://previews-api.litmus.com/api/v1/EmailTests -d '{ "TestingApplications" : [ { "ApplicationLongName" : "Outlook 2010",
        "ApplicationName" : "ol2010",
        "AverageTimeToProcess" : 0,
        "BusinessOrPopular" : true,
        "Completed" : null,
        "DesktopClient" : true,
        "FoundInSpam" : null,
        "FullpageImage" : null,
        "FullpageImageContentBlocking" : null,
        "FullpageImageNoContentBlocking" : null,
        "FullpageImageThumb" : null,
        "FullpageImageThumbContentBlocking" : null,
        "FullpageImageThumbNoContentBlocking" : null,
        "Id" : 0,
        "PlatformLongName" : "",
        "PlatformName" : "",
        "RenderedHtmlUrl" : null,
        "ResultType" : 0,
        "SpamHeaders" : null,
        "SpamScore" : 0,
        "State" : null,
        "Status" : 0,
        "SupportsContentBlocking" : false,
        "SupportsSpamScoring" : null,
        "WindowImage" : null,
        "WindowImageContentBlocking" : null,
        "WindowImageNoContentBlocking" : null,
        "WindowImageThumb" : null,
        "WindowImageThumbContentBlocking" : null,
        "WindowImageThumbNoContentBlocking" : null
      },
      { "ApplicationLongName" : "iPhone 5s",
        "ApplicationName" : "iphone5s",
        "AverageTimeToProcess" : 0,
        "BusinessOrPopular" : true,
        "Completed" : null,
        "DesktopClient" : true,
        "FoundInSpam" : null,
        "FullpageImage" : null,
        "FullpageImageContentBlocking" : null,
        "FullpageImageNoContentBlocking" : null,
        "FullpageImageThumb" : null,
        "FullpageImageThumbContentBlocking" : null,
        "FullpageImageThumbNoContentBlocking" : null,
        "Id" : 0,
        "PlatformLongName" : "",
        "PlatformName" : "",
        "RenderedHtmlUrl" : null,
        "ResultType" : 0,
        "SpamHeaders" : null,
        "SpamScore" : 0,
        "State" : null,
        "Status" : 0,
        "SupportsContentBlocking" : false,
        "SupportsSpamScoring" : null,
        "WindowImage" : null,
        "WindowImageContentBlocking" : null,
        "WindowImageNoContentBlocking" : null,
        "WindowImageThumb" : null,
        "WindowImageThumbContentBlocking" : null,
        "WindowImageThumbNoContentBlocking" : null
      }
    ] }'

 

Optional:  If you wanted to include a UserGuid (see Generating User GUIDS) you can make the call like this:

 

curl -u username:password -X POST -H "Content-type: application/json"  https://previews-api.litmus.com/api/v1/EmailTests -d '{"UserGuid":"SomeGuid"}'

 

or

 

curl -u username:password -X POST -H "Content-type: application/json"  https://previews-api.litmus.com/api/v1/EmailTests -d '{"UserGuid":"SomeGuid","TestingApplications": [...full array of TestingApplications...]}'

 

 

Step 2 :: Send your email to Litmus

 

The response you receive from Step 1 will look something like this (note the ellipses are used to omit longer portions of the response that aren't needed right now):

 

{ "Error" : false,
  "ErrorMessage" : null,
  "Html" : null,
  "Id" : 17344221,
  "InboxGuid" : "740617c",
  "Sandbox" : false,
  "Source" : "https://s3.amazonaws.com/sitevista/",
  "State" : "waiting",
  "Subject" : "",
  "TestType" : 0,
  "TestingApplications" : [ { "ApplicationLongName" : "Outlook 2010" ...],
  "UserGuid" : null,
  "ZipFile" : "http://zip.litmus.com/resellers/?guid=..."
}

 

In this response you received from your request in Step 1 there are two things we want to look at.

 

InboxGuid - This is a unique string for this test.  You will want to send your email to InboxGuid@emailtests.com  When we receive your email we will know to tie it to your previously created test.

 

Id - This is unique integer for your test.  This is the id you will use to make future calls regarding this test to check the status and to get your results.

 

Step 3 :: Check to ensure your email has been received and is being processed

 

Make a GET request to https://previews-api.litmus.com/api/v1/EmailTests/{id} with the Id of your test which you received in the response to Step 1.  Check the State field.  There are 3 possible States:

 

waiting - Litmus is still waiting to receive your email.  Your test is not running.

processing - Litmus has received your email and is running your test.

complete - Litmus has completed processing of your email test.

 

If after a few minutes your test continues to be in a Waiting status it is safe to resend your email.  If this happens frequently or if your test never leaves the Waiting status you should contact our support team at resellers@litmus.com

 

Step 4 :: Getting your results

 

You can check on the status of your results by making a GET request to https://previews-api.litmus.com/api/v1/EmailTests/{id}

 

Make sure to check the State of each TestingApplication.  A State of Complete means you can parse that result and the images.

 

For more information on how best to parse the results see REST Understanding email results.

 

For more information on how to integrate mobile results see REST Using mobile results