The method returns information about the specified template.
Principle of use
Syntax and URL to call the method |
getTemplate (int template_id) |
https://api.selzy.com/en/api/getTemplate?format=json&api_key=KEY&template_id=ID |
Arguments | |
api_key * | API access key. |
template_id * | User template ID. It is returned by the createEmailTemplate, getTemplates or listTemplates methods. The parameter is optional if system_template_id is indicated. |
system_template_id | System template ID. It is returned by the getTemplates or listTemplates methods. |
format | The display format of the returned result. It can obtain values of html | json, json is set by default (the html format is intended only for visual viewing of the result, the parser will not work in this format). |
Return value | |
JSON array, an object with fields. Description of fields is under the example. Example of the return value: { "result": { "id": "10423223", "sub_user_login": "", "title": "test", "description" : "This is the test template", "lang_code": "en", "subject": "test", "attachments": "", "screenshot_url": "https://api.selzy.com/en/v5/preview/template/ 5gkzx4yg4zjae1swo1cqzy1sbui", "fullsize_screenshot_url":"", "created": "2020-02-23 13:29:51", "updated": "2020-04-17 16:31:51", "message_format": "raw_html", "type": "user", "body": "<html>n<head><title></title></head>n<body></body>n</html>", "raw_body": ""} } |
Where:
id — identifier of the template in the system;
sub_user_login — either the login of the sub-user who created the template or NULL if the letter was created by the master user;
title — name of the template in the system;
description — text description of the template;
lang_code — two-letter language code to be automatically added to the letter with the unsubscribe form (for example, 'en', 'ru');
subject — template subject;
screenshot_url — link to the template screenshot;
fullsize_screenshot_url — returns the link to the full-size image of the system template;
created — template creation date and time, UTC;
updated - template updation date and time, UTC;
type — template type (system/user);
body — template body;
raw_body — system parameter containing the json structure of the block editor data;
message_format — returns the manner of creating a template: «block» — block editor, «raw_htm» — html editor.
Errors format:
{ {"error":"VK151214-01 [ 'date_from' value is not a valid datetime "2015-12-14 12:5x"]"} {"error":"VK151214-01 [ 'date_to' value is not a valid datetime "2015-12-14 22:0x"]"} {"error":"VK151214-01 [ 'limit' value should be a valid number]"} {"error":"VK151214-01 [ 'offset' value should be greater than or equal to 0]"} }