Create Template
This API allows you to create templates.
Request Type
- POST
Request URL
https://campaigns.zoho.com/emailapi/v1/templates
Content-Type
application/json
List of Request Body Attributes
Parameters | Data Type | Description |
template_name* | String | Name of the template. |
content* | String | Content of the template. |
content_type* | String | Shows the type of content between 'html' and 'text'. |
List of Response Body Attributes
Parameters | Data Type | Description |
template_id | String | Unique ID of the list which can be used in APIs. |
response | JSON Object | Contains the response details of the API. |
code | Integer | Success or failure code. |
message | String | Success or failure message returned by the API. |
errors | JSON Object | Contains the error details of the API such as 'code' and 'message'. |
Possible Errors
Error Code | Description |
400702 | Invalid template name provided. |
400703 | Invalid content type. |
400704 | Content not provided. |
400705 | A template with the same name already exists. |
Sample Request Payload
Copied{
"template_name": "Newsletter Template",
"content": "<h1>Hello world</h1>",
"content_type": "html"
}
Sample Response - Success
Copied{
"response": {
"code": 200703,
"message": "Successfully added the template"
},
"template_id": "8000000125003"
}
Sample Response - Failure
Copied{
"errors": [
{
"code": 500701,
"message": "An error occurred in Templates API"
}
]
}