-
Notifications
You must be signed in to change notification settings - Fork 2
/
REST Web Page Previews.html
executable file
·101 lines (101 loc) · 9 KB
/
REST Web Page 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
<!-- page=REST Web Page Previews -->
<!-- uid=8f58ab064efb2adbc1b126f0da2c1109fa7bd6b1 -->
<!-- time=1443529493 -->
<!-- ip=50.233.29.58 -->
<!-- content-type=text/html -->
<!-- name=Justin Unton -->
<!-- email=junton@litmus.com -->
<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><span style="color:#ff0000;"><a href="https://litmus.com/partners/api/documentation">link</a></span></h2>
<p><span style="font-family:'Segoe UI', 'Lucida Grande', Arial, sans-serif;font-size:17px;font-weight:bold;line-height:1.25em;"> </span></p>
<h2>Introduction</h2>
<p> </p>
<p>For Web Page Previews the work flow is:</p>
<p> </p>
<ul><li><span style="font-size:13px;line-height:1.5em;">Create an PageTest with Litmus and get a result back from us</span></li>
<li><span style="font-size:13px;line-height:1.5em;">Poll the api periodically to see if your previews are complete </span></li>
</ul><p> </p>
<h2>Details</h2>
<p> </p>
<p><strong>Step 1 </strong>:: Start a Litmus web page test by sending a POST request to <a href="https://previews-api.litmus.com/api/v1/PageTests">https://previews-api.litmus.com/api/v1/PageTests</a></p>
<p> </p>
<p>You can customize 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/PageTests/TestingApplications">https://previews-api.litmus.com/api/v1/PageTests/TestingApplications</a>. If you want to test all TestingApplications you can just send an empty PageTest object with only details about the url to be tested.</p>
<p> </p>
<p>An example of a creating an web page preview for all TestingApplications would look 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/PageTests">https://previews-api.litmus.com/api/v1/PageTests</a> -d '{ "Url" : "<a href="https://www.google.com/?">https://www.google.com/?"</a>, "Title" : "Google" }'</pre>
<p> </p>
<p>An example of a creating an web page preview for only some TestingApplications would look 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/PageTests">https://previews-api.litmus.com/api/v1/PageTests</a> -d '{ "Url" : "<a href="https://www.google.com/?">https://www.google.com/?"</a>, "Title" : "Google", "TestingApplications" : [ { "ApplicationLongName" : "Explorer 10",</pre>
<pre> "ApplicationName" : "IE10",</pre>
<pre> "AverageTimeToProcess" : 0,</pre>
<pre> "BusinessOrPopular" : true,</pre>
<pre> "Completed" : null,</pre>
<pre> "DesktopClient" : true,</pre>
<pre> "FoundInSpam" : null,</pre>
<pre> "FullpageImage" : null,</pre>
<pre> "FullpageImageContentBlocking" : null,</pre>
<pre> "FullpageImageNoContentBlocking" : null,</pre>
<pre> "FullpageImageThumb" : null,</pre>
<pre> "FullpageImageThumbContentBlocking" : null,</pre>
<pre> "FullpageImageThumbNoContentBlocking" : null,</pre>
<pre> "Id" : 0,</pre>
<pre> "PlatformLongName" : "",</pre>
<pre> "PlatformName" : "",</pre>
<pre> "RenderedHtmlUrl" : null,</pre>
<pre> "ResultType" : 0,</pre>
<pre> "SpamHeaders" : null,</pre>
<pre> "SpamScore" : 0,</pre>
<pre> "State" : null,</pre>
<pre> "Status" : 0,</pre>
<pre> "SupportsContentBlocking" : false,</pre>
<pre> "SupportsSpamScoring" : null,</pre>
<pre> "WindowImage" : null,</pre>
<pre> "WindowImageContentBlocking" : null,</pre>
<pre> "WindowImageNoContentBlocking" : null,</pre>
<pre> "WindowImageThumb" : null,</pre>
<pre> "WindowImageThumbContentBlocking" : null,</pre>
<pre> "WindowImageThumbNoContentBlocking" : null</pre>
<pre> },</pre>
<pre> { "ApplicationLongName" : "Firefox (OS X)",</pre>
<pre> "ApplicationName" : "fflatestosx",</pre>
<pre> "AverageTimeToProcess" : 0,</pre>
<pre> "BusinessOrPopular" : true,</pre>
<pre> "Completed" : null,</pre>
<pre> "DesktopClient" : true,</pre>
<pre> "FoundInSpam" : null,</pre>
<pre> "FullpageImage" : null,</pre>
<pre> "FullpageImageContentBlocking" : null,</pre>
<pre> "FullpageImageNoContentBlocking" : null,</pre>
<pre> "FullpageImageThumb" : null,</pre>
<pre> "FullpageImageThumbContentBlocking" : null,</pre>
<pre> "FullpageImageThumbNoContentBlocking" : null,</pre>
<pre> "Id" : 0,</pre>
<pre> "PlatformLongName" : "",</pre>
<pre> "PlatformName" : "",</pre>
<pre> "RenderedHtmlUrl" : null,</pre>
<pre> "ResultType" : 0,</pre>
<pre> "SpamHeaders" : null,</pre>
<pre> "SpamScore" : 0,</pre>
<pre> "State" : null,</pre>
<pre> "Status" : 0,</pre>
<pre> "SupportsContentBlocking" : false,</pre>
<pre> "SupportsSpamScoring" : null,</pre>
<pre> "WindowImage" : null,</pre>
<pre> "WindowImageContentBlocking" : null,</pre>
<pre> "WindowImageNoContentBlocking" : null,</pre>
<pre> "WindowImageThumb" : null,</pre>
<pre> "WindowImageThumbContentBlocking" : null,</pre>
<pre> "WindowImageThumbNoContentBlocking" : null</pre>
<pre> }</pre>
<pre> ] }'</pre>
<p> </p>
<p><strong>Step 2</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/v1/PageTests/%7Bid%7D">https://previews-api.litmus.com/api/v1/PageTests/{id}</a> using the Id you received in the response to Step 1.</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> </p>
<!-- pbraw=eJztWW1zGjcQ/s6v2KGTup0xYLAdx2dC6/gtdNKEMWSSTqcfxN0eyOgkVdIZ00z+e1c6wNjGSbCdf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