Get one Template with its body (Read-Only)

GET/api/templates/{type}/{id}

The full template, body included. Which columns come back depends on the type: an email template carries email_subject, default_message, custom_message, template_type and language, a ticket template carries description and ticket_type, and a contract or proposal template carries its template column.

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
type String Template type
id Number Template unique ID inside that type
curl -X GET "https://yoursite.com/api/templates/lead/123" \
  -H "authtoken: YOUR_API_TOKEN"

Success-Response:

HTTP/1.1 200 OK
{
  "id": "1",
  "template_name": "login_info",
  "email_subject": "Login details",
  "default_message": "<div>Hello {USER_FIRST_NAME} ...</div>",
  "custom_message": "",
  "template_type": "default",
  "language": "",
  "deleted": "0"
}

Invalid-Type:

HTTP/1.1 400 Bad Request
{ "status": false, "messages": { "type": "Invalid template type. Allowed values: email, ticket, contract, proposal" } }

No-Data:

HTTP/1.1 404 Not Found
{ "status": false, "messages": { "error": "No data were found" } }
MethodGET
Path/api/templates/{type}/{id}
GroupTemplates
Sincev1.0.0
Defined inRestApi/Controllers/TemplatesController.php