Update a template
http
POST https://services.leadconnectorhq.com/emails/builder/dataAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | ve9EPM428h8vShlRW1KT | |
templateId | string | Yes | zYy3YOUuHxgomU1uYJty | |
updatedBy | string | Yes | zYy3YOUuHxgomU1uYJty | |
dnd | object | Yes | {elements:[], attrs:{}, templateSettings:{}} | |
html | string | Yes | ||
editorType | string | Yes | Possible values: 'html', 'builder' | |
previewText | string | No | zYy3YOUuHxgomU1uYJty | |
isPlainText | boolean | No | false |
Responses
201 - Success
ok(string): ok Example:truetraceId(string): trace id Example:0c52e980-41f6-4be7-8c4b-32332sspreviewUrl(string): preview url Example:https://example.comtemplateDownloadUrl(string): template data download url Example:https://example.com
json
{
"ok": "true",
"traceId": "0c52e980-41f6-4be7-8c4b-32332ss",
"previewUrl": "https://example.com",
"templateDownloadUrl": "https://example.com"
}400 - Bad Request
json
{}404 - Not Found
422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/emails/builder/data' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "ve9EPM428h8vShlRW1KT",
"templateId": "zYy3YOUuHxgomU1uYJty",
"updatedBy": "zYy3YOUuHxgomU1uYJty",
"dnd": "{elements:[], attrs:{}, templateSettings:{}}",
"html": "",
"editorType": "html",
"previewText": "zYy3YOUuHxgomU1uYJty",
"isPlainText": "false"
}'const response = await fetch('https://services.leadconnectorhq.com/emails/builder/data', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"locationId": "ve9EPM428h8vShlRW1KT", "templateId": "zYy3YOUuHxgomU1uYJty", "updatedBy": "zYy3YOUuHxgomU1uYJty", "dnd": "{elements:[], attrs:{}, templateSettings:{}}", "html": "", "editorType": "html", "previewText": "zYy3YOUuHxgomU1uYJty", "isPlainText": "false"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/emails/builder/data',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"locationId": "ve9EPM428h8vShlRW1KT", "templateId": "zYy3YOUuHxgomU1uYJty", "updatedBy": "zYy3YOUuHxgomU1uYJty", "dnd": "{elements:[], attrs:{}, templateSettings:{}}", "html": "", "editorType": "html", "previewText": "zYy3YOUuHxgomU1uYJty", "isPlainText": "false"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/emails/builder/data');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'locationId': 've9EPM428h8vShlRW1KT', 'templateId': 'zYy3YOUuHxgomU1uYJty', 'updatedBy': 'zYy3YOUuHxgomU1uYJty', 'dnd': '{elements:[], attrs:{}, templateSettings:{}}', 'html': '', 'editorType': 'html', 'previewText': 'zYy3YOUuHxgomU1uYJty', 'isPlainText': 'false'}),
]);
$data = json_decode(curl_exec($ch), true);