Skip to content

Legacy Previews API

TIP

Access to our APIs is evaluated on a case-by-case basis. To find out if your use case is one that we support feel free to get in touch with the details of your project. partners@litmus.com

Core Functionality

For all Email Previews tests you will follow the same basic process:

  1. Create: Create a new test and get a unique test guid.
  2. Send: Send in your email, HTML, or URL.
  3. Verify: Verify that we have received your test and are processing it.
  4. Process Results: Once you receive your results via polling or callbacks you can provide them to your end user.

Additional Functionality

In addition to the core functionality of the Litmus API, there are a few other functions you can perform. These supplemental functions are especially helpful for email designers to ensure everything is working as planned:

  • Link Check: Your email may include links to external sources or back to your company's homepage. To ensure that your links are working Litmus will check them for you.

  • Code Analysis: The Code Analysis feature provides a compatibility report for your email's HTML/CSS within several email clients.

  • Spam Testing: Include Litmus' spam seed addresses in your Email Previews test to receive valuable information about your email.

Integration Assistance

There are few additional areas of resources to look at when building your integration with the Litmus API:

  • Polling: To request information from Litmus.
  • Callbacks: To receive information from Litmus as soon as your EmailTests have completed.
  • Index: An explanation of some of the most important attributes in the API.
  • Generating and Using User GUIDs: If you are offering unlimited testing to your users, we need to identify the unique users of your application. See the guide for more information.
  • See the API Documentation at work: Visit https://previews-api.litmus.com/

SSL/TLS

All API endpoints are only available via HTTPS, using TLS 1.2 or greater.

Start Your Test

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

You can customize the request by requesting whatever TestingApplications you want. If you want to test all TestingApplications simply send an empty EmailTest object. To retrieve all TestingApplications follow the steps listed here for GET TestingApplications.

An example of creating an email preview for all TestingApplications looks like this:

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

An example of creating an email preview for only one TestingApplications for Outlook 2010 ("ol2010") looks like this:

sh
curl https://previews-api.litmus.com/api/v1/EmailTests\
  -u username:password\
  -X POST\
  -H "Content-type: application/json"\
  -d '{"TestingApplications": [
    { "ApplicationName": "OL2010" }
  ]
}'

Here is an example of a response from Litmus:

json
{
  "TestingApplications": [
    {
      "State": "pending",
      "WindowImageContentBlocking": "s3.amazonaws.com",
      "FullpageImageThumb": "s3.amazonaws.com",
      "BusinessOrPopular": true,
      "WindowImageThumbNoContentBlocking": "s3.amazonaws.com",
      "Completed": false,
      "FullpageImage": "s3.amazonaws.com",
      "FoundInSpam": false,
      "SupportsSpamScoring": null,
      "Status": 0,
      "WindowImageNoContentBlocking": "s3.amazonaws.com",
      "PlatformName": "Windows",
      "AverageTimeToProcess": 38,
      "SpamHeaders": [],
      "WindowImageThumb": "s3.amazonaws.com",
      "RenderedHtmlUrl": null,
      "PlatformLongName": "Microsoft Windows",
      "FullpageImageThumbContentBlocking": "s3.amazonaws.com",
      "WindowImage": "s3.amazonaws.com",
      "FullpageImageContentBlocking": "s3.amazonaws.com",
      "SupportsContentBlocking": true,
      "ApplicationName": "OL2010",
      "FullpageImageThumbNoContentBlocking": "s3.amazonaws.com",
      "SpamScore": 0.0,
      "DesktopClient": true,
      "WindowImageThumbContentBlocking": "s3.amazonaws.com",
      "Id": your-result-id-here,
      "ResultType": 0,
      "FullpageImageNoContentBlocking": "s3.amazonaws.com",
      "ApplicationLongName": "Outlook 2010"
    }
  ],
  "State": "waiting",
  "InboxGuid": your-inbox-guid-here,
  "Id": your-test-set-id-here,
  "Source": "https://s3.amazonaws.com/sitevista/",
  "Subject": "",
  "Html": "https://html.litmus.com/email/?url=/sitevista/",
  "ZipFile": "http://zip.litmus.com/resellers/?guid="your-guid-here,
  "TestType": 0,
  "Sandbox": false,
  "UserGuid": null,
  "Error": false,
  "ErrorMessage": null
}

Send Us Your Email

The response you will receive contains some important information, including theInboxGuid. The InboxGuid is a unique identifier for this test. You will use the InboxGuid to create and send an email to InboxGuid@emailtests.com. When we receive your email at that unique email address we will know to associate it with the test you created.

NOTE

The email address InboxGuid@emailtests.com must appear in the email headers in the To:, CC:, or BCC: field in order for us to associate that message with your test.

The second piece of important information is the Id. The Id is the unique integer for this test or result that you will use to poll for results or match a callback to.

Head back up above to see the a sample of InboxGuid and Id from a sample Litmus response.

Verify Your Test

At this point you will need to ensure that your email has been received and is being processed.

Make a GET request to https://previews-api.litmus.com/api/v1/EmailTests/{id} where {id} = the Id from the Litmus response you received from your POST request.

Here is an example of the GET request:

sh
curl -u username:password https://previews-api.litmus.com/api/v1/EmailTests/{id}

Your response should look similar to the response you received from your POST request.

Check the State field. There are 4 possible States:

  1. waiting: Litmus is still waiting to receive your email. Your test isn't running.
  2. processing: Litmus has received your email and is in the process of running your test.
  3. complete: Litmus has completed your test. Your images are ready.
  4. error: Something went wrong. You will have to retest for this client.

TIP

If you receive a waiting State for several minutes it is safe to resend your email. If your test never leaves the waiting State it is possible that:

  1. Your message never made it to your unique InboxGuid email address. Contact support at resellers@litmus.com and/or contact your email service provider.
  2. Your email service is providing placeholder data in the To:, CC:, and BCC: fields. We cannot associate your email with your unique InboxGuid if InboxGuid@emailtests.com doesn't appear in the email headers. Contact your email service provider for additional assistance.

Process Results

Each of the results contained within emailTest.Results can be used to display capture images to your users. There are a few things to check before attempting to use the image URLs in EmailTests results:

Has the result completed?

If you verified that your result's Completed property is true, it is safe to use the result to find its images (covered below).

Is the result a type with captures?

If result's ResultType property is email, it will have capture images. If it's spam, it won't.

If the answer to the above questions is "yes," then you can move onto deciding which properties contain the capture images you want.

Choosing the right images

If your result's SupportsContentBlocking property is true, you should use the following properties:

WindowImageNoContentBlocking
WindowImageContentBlocking
FullpageImageNoContentBlocking
FullpageImageContentBlocking
WindowImageNoContentBlockingThumb
WindowImageContentBlockingThumb
FullpageImageNoContentBlockingThumb
FullpageImageContentBlockingThumb

If SupportsContentBlocking is false, you should use the following properties:

WindowImage
FullpageImage
WindowImageThumb
FullpageImageThumb

The Litmus Link Check tool will make sure links in your HTML are valid. This is ideal for email designers who need to ensure everything is perfect before clicking "Send."

Create a LinkTest by sending a POST request that includes your email's HTML to our API:

sh
curl https://previews-api.litmus.com/api/v1/LinkTests\
  -u username:password\
  -i\
  -X POST\
  -H "Content-type: application/json"\
  -d "\"<div><a href='http://www.litmus.com?utm_source=twitter&utm_term=oct'>Litmus</a></div>\""

Note: There are quotes surrounding the HTML.

WARNING

You should only paste the HTML portion of your email—no subject line, plain text parts etc.

Just like an Email Previews test, once you POST to the API you will need to poll the API to determine if your Link Check Test has completed. Make the following GET request to check the State:

sh
curl -u username:password https://previews-api.litmus.com/api/v1/LinkTests/{id}

Once the State of the test is Complete you can parse through the object to get the result of your test.

LinkTest Object

AttributeDescription
IdUnique Id for this LinkTest. Use this value to poll for results
LinksCollection of Link Objects with details about the links we've detected in your email
SourceUrlThe HTML source that was used for this test
ImageUrlA screenshot of the rendered HTML
StateProcessing, Complete, or Error
ErrorBoolean value indicating if there was an error processing this LinkTest
ErrorMessageDetails about the error if Error == true.

Link Object

AttributeDescription
UrlThe Url for this Link
IsValidIf the Url returned a 200 via an HTTP request
ExceptionIf the Url did not return a 200—what error did it return
IsBlackListedIs the Url listed on common blocklists?
HasGoogleAnalyticsDoes the Url have Google Analytics parameters?
HasClickTrackingDoes the Url have click tracking turned on? This is determined by detecting a URL redirect, which is the most common way to perform click tracking
PageTtitleThe title of the page the link leads to
TopLeftXX position of the link in the rendered HTML
TopLeftYY position of the link in the rendered HTML
GoogleAnalyticsParametersIf the link does have GoogleAnalyticsParameters this will contain a parsed collection of those parameters
ThumbnailsUrlA small screenshot of the page the the link leads to

Code Analysis

The Litmus Code Analysis tool will check submitted HTML and CSS for style problems. If the tool identifies a problem we will provide the line number and problem description.

To retrieve a list of all ApplicationName fields for CodeAnalysisByTestingApplicationsplace a GET request to https://previews-api.litmus.com/api/v1/TestingApplications.

Submit your CodeAnalysis request by POST request:

sh
curl https://previews-api.litmus.com/api/v1/CodeAnalysis\
  -u username:password\
  -i\
  -X POST\
  -H "Content-type: application/json"\
  -d "\"<div><a href='http://www.litmus.com?utm_source=twitter&utm_term=oct'>Litmus</a></div>\""

You can request a CodeAnalysis test for only certain applications by making a call to CodeAnalysisByTestingApplications:

sh
curl https://previews-api.litmus.com/api/v1/CodeAnalysisByTestingApplications\
  -u username:password\
  -i\
  -X POST\
  -H "Content-type: application/json"\
  -d '{"Html": "<h1>Test</h1><p><a href=\"http://www.litmus.com\">Litmus</a></p>","TestingApplications": [ "ol2010"]}'

Note: Quotes should be surrounding the HTML.

WARNING

You should only paste the HTML portion of your email—no subject line, plain text parts etc.

Understanding CodeAnalysis Results

CodeAnalysisTest

AttributeDescription
CompatibilityProblemsA collection of compatibility problems that we found in your HTML
CompatibilityRulesCountThe total number of compatibility rules we validated your HTML against
HtmlProblemsA collection of HTML format and syntax problems we found in your HTML

CodeAnalysisPotentialProblems

AttributeDescription
LineNumberThe line in the HTML where this problem was found
Severity0 or 1 where 0 is less severe an issue and 1 is more severe
DescriptionA text description of the problem

CodeAnalysisHtmlValidation

AttributeDescription
LineNumberThe line in the HTML where this problem was found
DescriptionA text description of the problem

Spam Testing

The process for Spam Testing is similar to the process for Email Previews, but there are a few additional steps.

Include Spam TestingApplications

Make sure you include all TestingApplications that have a ResultType of 1 or Spam. To retrieve all TestingApplications follow the steps listed here for GET TestingApplications. If you want to include all TestingApplications send an empty EmailTest object.

Include Spam Seed Addresses

In addition to sending your email to InboxGuid@emailtests.com, you will need to send the email to Litmus' spam seed addresses. To receive a list of spam seed addresses follow the steps here for GET SpamSeedAddresses. If you skip this step your email will not be tested for spam.

Verify

Verify that we have received your test and are processing it.

Process Results

Process your results and provide them to your end user. Once you receive your results via polling or callbacks you can provide them to your end user.

Understanding Spam Test Results

SpamHeader

AttributeDescription
KeyString key returned by the spam provider for this header
IdInteger unique Id in Litmus for this header
DescriptionText description in English of what potential issue this header indicates
RatingA value, determined by Litmus, indicating the severity of this potential issue. The values are 1 - 5 with 1 being very minor and 5 being a serious issue

Polling

Once the State of your EmailTests is processing you may start polling for results.

TIP

Litmus recommends polling sequentially. For example: 3s, 3s, 6s, 9s, 15s, 24s, 30s. Once you reach 30s poll every 30s to avoid polling aggressively.

WARNING

Aggressive polling will trigger slower updates.

To begin polling your program should start GetEmailTest once the State is processing. The Result for each ApplicationName should begin to return completed. You may poll every 60 seconds until every Result is completed.

Callbacks

To get started using callbacks you will need to provide us with a URL to send Litmus test results to. You can set this up easily by contacting our reseller support at resellers@litmus.com.

We strongly recommend that your URL is SSL (served over HTTPS) with a valid certificate and uses basic authentication. This means you'll need to provide us with a username and password.

Once we have your URL stored in our system we will POST data to that URL every time one of your individual results completes.

Here is an example of what your POST request might look like:

js
var emailTest = new EmailTest();

// Create our list and make space for two clients
emailTest.Results = new Client[3]
// Create a Client object within the first space
emailTest.Results[0] = new Client
// Assign Outlook 2003's ApplicationName to that new Client object
emailTest.Results[0].ApplicationName = "OL2010"
// Repeat for Spam Asassin
emailTest.Results[2] = new Client
emailTest.Results[2].ApplicationName = "SPAMASSASSIN3"
emailTest = LitmusApi.CreateEmailTest("api-key", "api-pass", emailTest);

As soon as the Completed becomes true we will POST data to your URL.

Here is an example of what that data might look like:

xml
<?xml version="1.0" encoding="utf-8"?>
<TestResult type="mail">
  <Id>your-id</Id>
  <ApiId>OL2010</ApiId>
  <SupportsContentBlocking>False</SupportsContentBlocking>
  <ResultImageSet>
    <ImagesOnUrls>
      <WindowUrls>
        <ImageUrl>s3.amazonaws.com/resultcaptures/unique-guid.windowon.png</ImageUrl>
        <ThumbUrl>s3.amazonaws.com/resultcaptures/unique-guid.windowonthumb.png</ThumbUrl>
      </WindowUrls>
      <FullPageUrls>
        <ImageUrl>s3.amazonaws.com/resultcaptures/unique-guid.fullpageon.png</ImageUrl>
        <ThumbUrl>s3.amazonaws.com/resultcaptures/unique-guid.fullpageonthumb.png</ThumbUrl>
      </FullPageUrls>
    </ImagesOnUrls>
    <ImagesOffUrls>
      <WindowUrls>
        <ImageUrl>s3.amazonaws.com/resultcaptures/unique-guid.windowon.png</ImageUrl>
        <ThumbUrl>s3.amazonaws.com/resultcaptures/unique-guid.windowonthumb.png</ThumbUrl>
      </WindowUrls>
      <FullPageUrls>
        <ImageUrl>s3.amazonaws.com/resultcaptures/unique-guid.fullpageon.png</ImageUrl>
        <ThumbUrl>s3.amazonaws.com/resultcaptures/unique-guid.fullpageonthumb.png</ThumbUrl>
      </FullPageUrls>
    </ImagesOffUrls>
  </ResultImageSet>
  <SpamResult />
  <State>Completed</State>
  <CallbackUrl>http://mysite.com/callback/</CallbackUrl>
</TestResult>

For spam tests, the XML will have the following format:

xml
<?xml version="1.0" encoding="utf-8"?>
<TestResult type="spam">
  <Id>554</Id>
  <ApiId>SPAMASSASSIN3</ApiId>
  <SupportsContentBlocking>false</SupportsContentBlocking>
  <ResultImageSet />
  <SpamResult>
    <SpamScore>9.4</SpamScore>
    <IsSpam>True</IsSpam>
    <SpamHeaders>
      <SpamHeader>
        <Key>HTML_FONT_FACE_BAD</Key>
        <Description>The font face used in your email is not valid.
        Try validating the HTML of your email using the W3C
        validator to make sure you are using standard
        HTML.</Description>
        <Rating>4</Rating>
      </SpamHeader>
      <SpamHeader>
        <Key>HTML_MESSAGE</Key>
        <Description>Your email contains HTML content. This won't
        usually cause you to fail any spam filters.</Description>
        <Rating>2</Rating>
      </SpamHeader>
      <SpamHeader>
        <Key>URIBL_AB_SURBL</Key>
        <Description>Your email contains a URL blacklisted by &lt;a
        href="http://www.abusebutler.com/"&gt;Abuse
        Butler&lt;/a&gt;.</Description>
        <Rating>3</Rating>
      </SpamHeader>
      <SpamHeader>
        <Key>URIBL_JP_SURBL</Key>
        <Description>Your email contains a URL blacklisted by &lt;a
        href="http://www.joewein.de/sw/blacklist.htm"&gt;jwSpamSpy&lt;/a&gt;.</Description>
        <Rating>3</Rating>
      </SpamHeader>
      <SpamHeader>
        <Key>URIBL_OB_SURBL</Key>
        <Description>Your email contains a URL blacklisted by &lt;a
        href="http://www.outblaze.com/"&gt;Outblaze&lt;/a&gt;.</Description>
        <Rating>3</Rating>
      </SpamHeader>
      <SpamHeader>
        <Key>URIBL_SC_SURBL</Key>
        <Description>Your email contains a URL blacklisted by &lt;a
        href="http://www.spamcop.net/"&gt;SpamCop&lt;/a&gt;.</Description>
        <Rating>3</Rating>
      </SpamHeader>
    </SpamHeaders>
  </SpamResult>
 <CallbackUrl>http://mysite.com/callback/</CallbackUrl>
</TestResult>

Generating and Using User GUIDs

If you are offering an unlimited testing facility to your users, we need to be able to identify the number of unique users of your application. This is done by setting a user GUID for each test you create.

If you are billing your users exclusively on a per-test basis you can ignore this feature.

WARNING

You must be certain that the GUID used is unique to that user. The GUID should be stored in a unique field within your database and should not change for the life of that user's account.

This information is never shared with anyone, not even your user. It will be used in your billing reports and returned to you along with your test results.

Do not use a hash of your user's details unless you ensure that this will remain unchanged and unique for that user. You will want to refrain from hashing user details because, by doing so, a hash of their email address could change over time and cause them to be identified twice in one month.

Some examples of using Generated User GUIDs in POST requests:

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

Create test

POST https://previews-api.litmus.com/api/v1/EmailTests

Posting an Email Test will return the following:

  • Statewaitingprocessing, or complete

  • InboxGuid: This is used to send your email to InboxGuid@emailtests.com

  • Id: You will receive an Id for each of theTestingApplications and one for the EmailTests. You will need the Id to perform GET requests later.

The following is the full model for Outlook 2010 serialized to JSON:

Examples

cURL

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

Result Format

200 OK

json
{
  "TestingApplications": [
    {
      "State": "pending",
      "WindowImageContentBlocking": "s3.amazonaws.com",
      "FullpageImageThumb": "s3.amazonaws.com",
      "BusinessOrPopular": true,
      "WindowImageThumbNoContentBlocking": "s3.amazonaws.com",
      "Completed": false,
      "FullpageImage": "s3.amazonaws.com",
      "FoundInSpam": false,
      "SupportsSpamScoring": null,
      "Status": 0,
      "WindowImageNoContentBlocking": "s3.amazonaws.com",
      "PlatformName": "Windows",
      "AverageTimeToProcess": 38,
      "SpamHeaders": [],
      "WindowImageThumb": "s3.amazonaws.com",
      "RenderedHtmlUrl": null,
      "PlatformLongName": "Microsoft Windows",
      "FullpageImageThumbContentBlocking": "s3.amazonaws.com",
      "WindowImage": "s3.amazonaws.com",
      "FullpageImageContentBlocking": "s3.amazonaws.com",
      "SupportsContentBlocking": true,
      "ApplicationName": "OL2010",
      "FullpageImageThumbNoContentBlocking": "s3.amazonaws.com",
      "SpamScore": 0,
      "DesktopClient": true,
      "WindowImageThumbContentBlocking": "s3.amazonaws.com",
      "Id": your-result-id-here,
      "ResultType": 0,
      "FullpageImageNoContentBlocking": "s3.amazonaws.com",
      "ApplicationLongName": "Outlook 2010"
    }
  ],
  "State": "waiting",
  "InboxGuid": your-inbox-guid-here,
  "Id": your-test-id-here,
  "Source": "https:\/\/s3.amazonaws.com\/sitevista\/",
  "Subject": "",
  "Html": "https:\/\/html.litmus.com\/email\/?url=\/sitevista\/",
  "ZipFile": "http:\/\/zip.litmus.com\/resellers\/?guid="your-guid-here,
  "TestType": 0,
  "Sandbox": false,
  "UserGuid": null,
  "Error": false,
  "ErrorMessage": null
}

Retrieve test

GET https://previews-api.litmus.com/api/v1/EmailTests/:Id

For this GET request you will need the Id for the entire POST EmailTests request. This request will find out the State of your test and provide you with the URLs to the finished images, if the State of your test is complete.

For the full model of EmailTests see POST EmailTests.

Path parametersDescription
IdREQUIRED

string

Examples

cURL

sh
curl  -u username:password https://previews-api.litmus.com/api/v1/EmailTests/{Id}

Testing applications

GET https://previews-api.litmus.com/api/v1/EmailTests/TestingApplications

This GET request will produce a list of all of the available TestingApplications and the corresponding JSON model.

The following is the full model serialized to JSON for the Outlook 2010 TestingApplication.

Understanding TestingApplications Results

ResultType returns an integer and that integer is associated with a type of test.

IntegerTest Type
0Email Previews
1Spam Testing
2Page Testing
3Browser Testing

Examples

cURL

sh
curl -u username:password https://previews-api.litmus.com/api/v1/EmailTests/TestingApplications

Result Format

200 OK

json
{
  "State": null,
  "WindowImageContentBlocking": null,
  "FullpageImageThumb": null,
  "BusinessOrPopular": true,
  "WindowImageThumbNoContentBlocking": null,
  "Completed": null,
  "FullpageImage": null,
  "FoundInSpam": null,
  "SupportsSpamScoring": null,
  "Status": 0,
  "WindowImageNoContentBlocking": null,
  "PlatformName": "Windows",
  "AverageTimeToProcess": 38,
  "SpamHeaders": null,
  "WindowImageThumb": null,
  "RenderedHtmlUrl": null,
  "PlatformLongName": "Microsoft Windows",
  "FullpageImageThumbContentBlocking": null,
  "WindowImage": null,
  "FullpageImageContentBlocking": null,
  "SupportsContentBlocking": false,
  "ApplicationName": "ol2010",
  "FullpageImageThumbNoContentBlocking": null,
  "SpamScore": 0,
  "DesktopClient": true,
  "WindowImageThumbContentBlocking": null,
  "Id": 0,
  "ResultType": 0,
  "FullpageImageNoContentBlocking": null,
  "ApplicationLongName": "Outlook 2010"
}

Result

GET https://previews-api.litmus.com/api/v1/Result/:Id

For this GET request you will need the Id for the individual TestingApplications you want a Result for. See POST EmailTests for information on how to obtain the Id.

This request is handy for TestingApplications in a State of waiting or processing.

The result will be the same as found for an individual ApplicationName in TestingApplications. See POST EmailTests for the full model.

Path parametersDescription
IdREQUIRED

string

Examples

cURL

sh
curl -u username:password https://previews-api.litmus.com/api/v1/Result/{Id}

Spam seed addresses

GET https://previews-api.litmus.com/api/v1/SpamSeedAddresses

If you would like to send your email to Litmus to perform a spam filter analysis, you will need to send to seed addresses. To get a current list of Litmus spam seed addresses perform this GET request.

Examples

cURL

sh
curl -u username:password https://previews-api.litmus.com/api/v1/SpamSeedAddresses

GET https://previews-api.litmus.com/api/v1/LinkTests/:Id

For this request you will need the Id from the Link Check Test you performed. This request will find out the State of your test and provide you with the URLs to the finished images, if the State of your test is Complete.

Path parametersDescription
IdREQUIRED

string

Examples

cURL

sh
curl -u username:password https://previews-api.litmus.com/api/v1/LinkTests/{Id}

Using mobile results

From an API point of view, our mobile email tests work exactly the same way as our regular email tests. Mobile email clients are simply additional 'Testing Applications'—you'll access them using the exact same API calls. The mobile results are returned amongst your regular email test results and consist of URLs to the screenshots.

However, there is one crucial difference. Mobile email tests are interactive, in some cases, even animated. We use a handful of different image files, some CSS magic, and a touch of Javascript to achieve these results. In order to include these types of results in your application, you'll need to add our Javascript to your site, and load in our HTML/CSS code, rather than just the screenshot image. We've tried to make it as easy as possible for you to do—there is a full code sample to download below.

Code sample

Each mobile device requires different client-side (HTML/CSS/JS) code. Your application should check which mobile device is being viewed and serve up the appropriate client-side code. A list of mobile devices can be found at: Browsers/operating systems/platforms we use for testing in Previews.

Sample HTML, CSS, Javascript, as well as transparent devices images can be found at: https://github.com/litmus/litmus-mobile-samples.

Index

Here are some descriptions of the more important attributes you will find in the API.

  • Id: The most important property. This is the unique identifier for your EmailTestsSpamTest, and individual result from TestingApplications.

  • ApiId: This code references the platform for the specific test result. It will match the ApplicationName property of the results collection.

  • SupportsContentBlocking: This value indicates true if the requested client supports content blocking and false if it does not. Content blocking clients, sometimes referred to as image blocking, will return different result images for ImagesOn and ImagesOff.

  • ResultImageSet: The ResultImageSet, as the name would suggest, is the collection of images that makes up your completed test. It consists of two main blocks ImagesOnUrls and ImagesOffUrls. Each main block contains two sub blocks for WindowUrls and FullPageUrls. Further, each capture block contains an ImageUrland ThumbUrl. For clients that do not support content blocking the outerblocks (ImagesOnUrls and ImagesOffUrls) will be identical. For clients who do support content blocking (SupportsContentBlocking == true) the ImagesOffUrl will show the blocked versions and ImagesOnUrl will show the non-blocked versions.

  • State: Indicates the current status of your test. By the time you receive a callback Completed will be true. Values include: pendingdeferredfailedcompletedcanceled.

  • CallbackUrl: This is the Url Litmus will post test results to.

  • SpamResult:

    • SpamScore: Numerical spam indicator returned by the particular Spam filter.
    • IsSpam: Boolean indicating if this particular filter deems the message to be spam or not.
    • SpamHeaders: Each header consists of a key, description and rating indicating it's severity.
  • Status: Indicates the current status of the testing application on the Litmus platform. This will return an integer value of 0, 1 or 2.  0 indicates the application is available and processing tests, 1 indicates we're currently experiencing some issues with the applications and 2 indicates the applications is currently unavailable for testing. You can also visit https://status.litmus.com/ to find out about any issues affecting our platform.