-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREST Email Previews.html
executable file
·151 lines (151 loc) · 10.8 KB
/
REST Email Previews.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!-- page=REST Email Previews -->
<!-- uid=8f58ab064efb2adbc1b126f0da2c1109fa7bd6b1 -->
<!-- time=1443529379 -->
<!-- ip=50.233.29.58 -->
<!-- content-type=text/html -->
<!-- name=Justin Unton -->
<!-- [email protected] -->
<h2><span style="color:#ff0000;">This documentation is no longer kept up-to-date. As of 2015 the new Reseller API documentation can be found here: </span><a href="https://litmus.com/partners/api/documentation"><span style="color:#ff0000;">link</span></a></h2>
<h2> </h2>
<h2> </h2>
<h2>Introduction</h2>
<p> </p>
<p>For Email Previews the work flow is:</p>
<p> </p>
<ul><li>Create an EmailTest with Litmus and get a result back from us</li>
<li>Send us your email to a unique email address you get from us</li>
<li>Poll the api periodically to see if your previews are complete </li>
</ul><h2> </h2>
<h2>Details</h2>
<p> </p>
<p><strong>Step 1</strong> :: Start a Litmus email test by sending a POST request to <a href="https://previews-api.litmus.com/api/v1/EmailTests" search_id="undefined">https://previews-api.litmus.com/api/v1/EmailTests</a></p>
<p> </p>
<p>You can customze the request by only requesting a few TestingApplications.</p>
<p>You can get a complete list of TestingApplications by making a GET request to <a href="https://previews-api.litmus.com/api/v1/EmailTests/TestingApplications" search_id="undefined">https://previews-api.litmus.com/api/v1/EmailTests/TestingApplications</a>. If you want to test all TestingApplications you can just send an empty EmailTest object.</p>
<p> </p>
<p>An example of a creating an email preview for all TestingApplications would look like this:</p>
<p> </p>
<pre>curl -u username:password -X POST -H "Content-type: application/json" https://previews-api.litmus.com/api/v1/EmailTests -d '{}'</pre>
<p> </p>
<p>An example of a creating an email preview for only some TestingApplications would look like this:</p>
<p> </p>
<pre>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
}
] }'</pre>
<p> </p>
<p>Optional: If you wanted to include a UserGuid (see <a href="Generating%20user%20GUIDs">Generating User GUIDS</a>) you can make the call like this:</p>
<p> </p>
<pre>curl -u username:password -X POST -H "Content-type: application/json" <a href="https://previews-api.litmus.com/api/v1/EmailTests">https://previews-api.litmus.com/api/v1/EmailTests</a> -d '{"UserGuid":"SomeGuid"}'</pre>
<p> </p>
<p>or</p>
<p> </p>
<pre>curl -u username:password -X POST -H "Content-type: application/json" <a href="https://previews-api.litmus.com/api/v1/EmailTests">https://previews-api.litmus.com/api/v1/EmailTests</a> -d '{"UserGuid":"SomeGuid","TestingApplications": [...full array of TestingApplications...]}'</pre>
<p> </p>
<p> </p>
<p><strong>Step 2 </strong>:: Send your email to Litmus</p>
<p> </p>
<p>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):</p>
<p> </p>
<pre>{ "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=..."
}</pre>
<p> </p>
<p>In this response you received from your request in Step 1 there are two things we want to look at.</p>
<p> </p>
<p>InboxGuid - This is a unique string for this test. You will want to send your email to [email protected] When we receive your email we will know to tie it to your previously created test.</p>
<p> </p>
<p>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.</p>
<p> </p>
<p><strong>Step 3</strong> :: Check to ensure your email has been received and is being processed</p>
<p> </p>
<p>Make a GET request to <a href="https://previews-api.litmus.com/api/%7Bversion%7D/EmailTests/%7Bid%7D">https://previews-api.litmus.com/api/v1/EmailTests/{id}</a> with the Id of your test which you received in the response to Step 1. Check the State field. There are 3 possible States:</p>
<p> </p>
<p><em>waiting</em> - Litmus is still waiting to receive your email. Your test is not running.</p>
<p><em>processing</em> - Litmus has received your email and is running your test.</p>
<p><em>complete</em> - Litmus has completed processing of your email test.</p>
<p> </p>
<p>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 [email protected]</p>
<p> </p>
<p><strong>Step 4</strong> :: Getting your results</p>
<p> </p>
<p>You can check on the status of your results by making a GET request to <a href="https://previews-api.litmus.com/api/%7Bversion%7D/EmailTests/%7Bid%7D">https://previews-api.litmus.com/api/v1/EmailTests/{id}</a></p>
<p> </p>
<p>Make sure to check the State of each TestingApplication. A State of Complete means you can parse that result and the images.</p>
<p> </p>
<p>For more information on how best to parse the results see <a href="REST%20Understanding%20email%20results">REST Understanding email results</a>.</p>
<p> </p>
<p>For more information on how to integrate mobile results see <a href="REST%20Using%20mobile%20results">REST Using mobile results</a></p>
<p> </p>
<p> </p>
<!-- pbraw=eJztWXtz2zYS/1+fAsObNO1MJUryW1XUJnbs+KZtPJE9ubtOpwORoIkYBHgAaMXp5LvfLkBSlETGzuNu5qbJJHYILBb7+O0Cu8jpNZu8ej6/JM8zygW50OyWs6XpFTyeHCZ7h3Qx3N9lyWJM40U0WozG+8kwpuNoNBoeJfRgEe8vRj3LMzYZ7e7u7I2Pdg6Oejyf7A0H452dwfhosHfYi5S0TNq+vcvZxLK3NkxtJnqSwrK/F8ZySa6kVbLHUIjJmwI/fhLcZoUZRCrrIXn/lutrLidS9fr9PjmhlpJTJYRaGgIDvWk6nk1NTiUx9k6wJ0GkhNKTvyXJEP78EMwuU25IrKIiA1mo5UoSGJCKCCWvmSY3LLekyPtW9WNq2YB8Ixcm/+GpISoh4+Foj9iUEcmW5BUzTAhY8vTifINjBPsvGElUIWOSMs0mnss0RNFmU0pSzZInQW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