All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| sendEmail | POST /send/email | Send transactional email |
| sendEmailWithTemplate | POST /send/template | Send email using template |
[XEmailResponse] sendEmail(xEmailMessage)
Send transactional email
Sends transactional emails to specified recipients with support for personalization, attachments, and tracking.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.EmailSendingApi();
let xEmailMessage = new sendx.XEmailMessage(); // XEmailMessage |
apiInstance.sendEmail(xEmailMessage).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| xEmailMessage | XEmailMessage |
- Content-Type: application/json
- Accept: application/json
[XEmailResponse] sendEmailWithTemplate(xEmailMessage)
Send email using template
Sends emails using a pre-defined template with variable substitution.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.EmailSendingApi();
let xEmailMessage = new sendx.XEmailMessage(); // XEmailMessage |
apiInstance.sendEmailWithTemplate(xEmailMessage).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| xEmailMessage | XEmailMessage |
- Content-Type: application/json
- Accept: application/json