All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| templatesByNameDelete | DELETE /templates/{name} | Delete Template |
| templatesByNameGet | GET /templates/{name} | Load Template |
| templatesByNamePut | PUT /templates/{name} | Update Template |
| templatesGet | GET /templates | Load Templates |
| templatesPost | POST /templates | Add Template |
templatesByNameDelete(name)
Delete Template
Delete template with the specified name. Required Access Level: ModifyTemplates
import ElasticEmail from '@elasticemail/elasticemail-client';
let defaultClient = ElasticEmail.ApiClient.instance;
// Configure API key authorization: apikey
let apikey = defaultClient.authentications['apikey'];
apikey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.apiKeyPrefix = 'Token';
let apiInstance = new ElasticEmail.TemplatesApi();
let name = "Template01"; // String | Name of template.
apiInstance.templatesByNameDelete(name, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of template. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Template templatesByNameGet(name)
Load Template
Load detailed information of the specified template. Required Access Level: ViewTemplates
import ElasticEmail from '@elasticemail/elasticemail-client';
let defaultClient = ElasticEmail.ApiClient.instance;
// Configure API key authorization: apikey
let apikey = defaultClient.authentications['apikey'];
apikey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.apiKeyPrefix = 'Token';
let apiInstance = new ElasticEmail.TemplatesApi();
let name = "Template01"; // String | Name of template.
apiInstance.templatesByNameGet(name, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of template. |
- Content-Type: Not defined
- Accept: application/json
Template templatesByNamePut(name, templatePayload)
Update Template
Update existing template, overwriting existing data. Required Access Level: ModifyTemplates
import ElasticEmail from '@elasticemail/elasticemail-client';
let defaultClient = ElasticEmail.ApiClient.instance;
// Configure API key authorization: apikey
let apikey = defaultClient.authentications['apikey'];
apikey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.apiKeyPrefix = 'Token';
let apiInstance = new ElasticEmail.TemplatesApi();
let name = "Template01"; // String | Name of template.
let templatePayload = new ElasticEmail.TemplatePayload(); // TemplatePayload |
apiInstance.templatesByNamePut(name, templatePayload, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of template. | |
| templatePayload | TemplatePayload |
- Content-Type: application/json
- Accept: application/json
[Template] templatesGet(scopeType, opts)
Load Templates
Returns a list of templates for the specified type. Required Access Level: ViewTemplates
import ElasticEmail from '@elasticemail/elasticemail-client';
let defaultClient = ElasticEmail.ApiClient.instance;
// Configure API key authorization: apikey
let apikey = defaultClient.authentications['apikey'];
apikey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.apiKeyPrefix = 'Token';
let apiInstance = new ElasticEmail.TemplatesApi();
let scopeType = [new ElasticEmail.TemplateScope()]; // [TemplateScope] | Return templates with specified scope only
let opts = {
'templateTypes': [new ElasticEmail.TemplateType()], // [TemplateType] | Return templates with specified type only
'limit': 100, // Number | Maximum number of returned items.
'offset': 20 // Number | How many items should be returned ahead.
};
apiInstance.templatesGet(scopeType, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| scopeType | [TemplateScope] | Return templates with specified scope only | |
| templateTypes | [TemplateType] | Return templates with specified type only | [optional] |
| limit | Number | Maximum number of returned items. | [optional] |
| offset | Number | How many items should be returned ahead. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Template templatesPost(templatePayload)
Add Template
Add a new Template. Required Access Level: ModifyTemplates
import ElasticEmail from '@elasticemail/elasticemail-client';
let defaultClient = ElasticEmail.ApiClient.instance;
// Configure API key authorization: apikey
let apikey = defaultClient.authentications['apikey'];
apikey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.apiKeyPrefix = 'Token';
let apiInstance = new ElasticEmail.TemplatesApi();
let templatePayload = new ElasticEmail.TemplatePayload(); // TemplatePayload |
apiInstance.templatesPost(templatePayload, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| templatePayload | TemplatePayload |
- Content-Type: application/json
- Accept: application/json