Get Campaign Variant HTML
Retrieve a campaign variant's content: the editor JSON and the rendered HTML.
Endpoint
GET https://api.campaignlark.com/v1/campaigns/:id/variants/:type/html
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | required | The campaign ID. |
type | string | required | Variant type: A or B (case-insensitive). |
Sample Request
GET https://api.campaignlark.com/v1/campaigns/64f1a2b3c4d5e6f7a8b9c0d1/variants/A/html
Response
Success — 200 OK
{
"error": null,
"data": {
"id": "6512a...",
"type": "A",
"template_type": "EDITOR",
"body_json": "{...}",
"body_html": "<html>...</html>"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | The variant's object ID. |
type | string | A or B. |
template_type | string | EDITOR (drag-and-drop builder) or CODE (raw HTML). |
body_json | string or null | The editor's JSON document. null for CODE variants. |
body_html | string | The rendered HTML. May be empty if no content has been set. |
Errors
| Status | Message | Cause |
|---|---|---|
400 | Please provide a campaign ID. | id path param is missing. |
400 | Invalid variant type. Must be 'A' or 'B'. | type is not A or B. |
400 | We could not find the campaign you are looking for. | Campaign not found. |
400 | We could not find the variant you are looking for. | Variant not found. |