All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| createEmailTemplate | POST /template/email | Create email template |
| deleteEmailTemplate | DELETE /template/email/{identifier} | Delete template |
| getAllEmailTemplates | GET /template/email | Get all templates |
| getEmailTemplate | GET /template/email/{identifier} | Get template by ID |
| updateEmailTemplate | PUT /template/email/{identifier} | Update template |
RestRTemplate createEmailTemplate(restETemplate)
Create email template
Creates a new reusable email template.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.TemplateApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
TemplateApi apiInstance = new TemplateApi(defaultClient);
RestETemplate restETemplate = new RestETemplate(); // RestETemplate |
try {
RestRTemplate result = apiInstance.createEmailTemplate(restETemplate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplateApi#createEmailTemplate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| restETemplate | RestETemplate |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | ✅ Template created successfully | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 403 | ❌ Forbidden - Resource name already exists | - |
| 422 | ❌ Unprocessable Entity - Invalid request format | - |
| 500 | ❌ Internal Server Error - System error occurred | - |
DeleteResponse deleteEmailTemplate(identifier)
Delete template
Deletes an email template.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.TemplateApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
TemplateApi apiInstance = new TemplateApi(defaultClient);
String identifier = "template_f3lJvTEhSjKGVb5Lwc5SWS"; // String | The unique template identifier to update. - `template_f3lJvTEhSjKGVb5Lwc5SWS`
try {
DeleteResponse result = apiInstance.deleteEmailTemplate(identifier);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplateApi#deleteEmailTemplate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | The unique template identifier to update. - `template_f3lJvTEhSjKGVb5Lwc5SWS` |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | ✅ Template deleted successfully | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 404 | ❌ Not Found - Resource does not exist | - |
| 500 | ❌ Internal Server Error - System error occurred | - |
List<RestRTemplate> getAllEmailTemplates(offset, limit, search)
Get all templates
Retrieves all email templates.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.TemplateApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
TemplateApi apiInstance = new TemplateApi(defaultClient);
Integer offset = 0; // Integer | Number of records to skip for pagination. **Examples:** - `0` - First page (default) - `25` - Second page (with limit=25) - `50` - Third page (with limit=25)
Integer limit = 10; // Integer | Maximum number of templates to return per page. **Guidelines:** - Default: 10 templates - Maximum: 100 templates - Recommended: 25-100 for optimal performance
String search = "search_example"; // String | Search templates by name (case-insensitive partial matching). **Examples:** - `newsletter` - Finds \"Weekly Newsletter\", \"Monthly Newsletter\" - `welcome` - Finds \"Welcome Email\", \"New User Welcome\" - `product` - Finds \"Product Launch\", \"Product Update\"
try {
List<RestRTemplate> result = apiInstance.getAllEmailTemplates(offset, limit, search);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplateApi#getAllEmailTemplates");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| offset | Integer | Number of records to skip for pagination. Examples: - `0` - First page (default) - `25` - Second page (with limit=25) - `50` - Third page (with limit=25) | [optional] [default to 0] |
| limit | Integer | Maximum number of templates to return per page. Guidelines: - Default: 10 templates - Maximum: 100 templates - Recommended: 25-100 for optimal performance | [optional] [default to 10] |
| search | String | Search templates by name (case-insensitive partial matching). Examples: - `newsletter` - Finds "Weekly Newsletter", "Monthly Newsletter" - `welcome` - Finds "Welcome Email", "New User Welcome" - `product` - Finds "Product Launch", "Product Update" | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | ✅ Templates retrieved successfully | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 500 | ❌ Internal Server Error - System error occurred | - |
RestRTemplate getEmailTemplate(identifier)
Get template by ID
Retrieves a specific email template.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.TemplateApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
TemplateApi apiInstance = new TemplateApi(defaultClient);
String identifier = "template_f3lJvTEhSjKGVb5Lwc5SWS"; // String | The unique template identifier. - `template_f3lJvTEhSjKGVb5Lwc5SWS` - Standard prefixed ID
try {
RestRTemplate result = apiInstance.getEmailTemplate(identifier);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplateApi#getEmailTemplate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | The unique template identifier. - `template_f3lJvTEhSjKGVb5Lwc5SWS` - Standard prefixed ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | ✅ Template retrieved successfully | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 404 | ❌ Not Found - Resource does not exist | - |
| 500 | ❌ Internal Server Error - System error occurred | - |
RestRTemplate updateEmailTemplate(identifier, restETemplate)
Update template
Updates an existing email template.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.TemplateApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
TemplateApi apiInstance = new TemplateApi(defaultClient);
String identifier = "template_f3lJvTEhSjKGVb5Lwc5SWS"; // String | The unique template identifier to update. - `template_f3lJvTEhSjKGVb5Lwc5SWS`
RestETemplate restETemplate = new RestETemplate(); // RestETemplate |
try {
RestRTemplate result = apiInstance.updateEmailTemplate(identifier, restETemplate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplateApi#updateEmailTemplate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | The unique template identifier to update. - `template_f3lJvTEhSjKGVb5Lwc5SWS` | |
| restETemplate | RestETemplate |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | ✅ Template updated successfully | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 403 | ❌ Forbidden - Resource name already exists | - |
| 404 | ❌ Not Found - Resource does not exist | - |
| 422 | ❌ Unprocessable Entity - Invalid request format | - |
| 500 | ❌ Internal Server Error - System error occurred | - |