Retrieve email client previews for an asset
Render an email's latest saved version in each of the email clients your company has selected for email testing, and retrieve a screenshot per client.
Rendering is asynchronous. Call this endpoint without test_id to start a test: the response carries a test_id and is a 202 while any client is still rendering. Then poll with ?test_id= until a 200 is returned, which means every client has finished. Calling again without test_id within 30 minutes of a test, with the email unchanged, may return that test rather than starting a new one.
Each new test is billed. Starting a test consumes one render per selected email client from your contracted email testing allowance, the same allowance used by email testing in the Knak app. Polling an existing test with test_id is not billed. To avoid paying for duplicate tests, always poll with the test_id you were given instead of calling again without it.
Starting a test is limited to 5 requests per minute per user; polling is limited to 60 requests per minute per user. There is no server-side timeout on a test, so set your own limit on how long to keep polling: most tests finish within two minutes, and three minutes is a reasonable cut-off.
Requires the "Can generate email client previews" permission, email client previews enabled for your company, and at least one email client selected by an administrator in Knak.
Request
- Base URLhttps://enterprise.knak.io/api/published/v1
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
ID of the email asset
Query parameters
ID of a test previously returned by this endpoint for the same asset. When given, the endpoint returns that test's current progress instead of starting a new test.
Response
Every email client has finished rendering.
Example response
{
"test_id": "4815162342",
"data": [
{
"display_name": "Outlook 2019 (125% DPI)",
"client": "Outlook",
"os": "Windows 10",
"category": "Application",
"screenshot": "https://cdn.example.com/outlook19.png",
"thumbnail": "https://cdn.example.com/outlook19-thumb.png",
"completed": true
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.