All URIs are relative to https://api.elasticemail.com/v4
Method | HTTP request | Description |
---|---|---|
campaignsByNameDelete | DELETE /campaigns/{name} | Delete Campaign |
campaignsByNameGet | GET /campaigns/{name} | Load Campaign |
campaignsByNamePausePut | PUT /campaigns/{name}/pause | Pause Campaign |
campaignsByNamePut | PUT /campaigns/{name} | Update Campaign |
campaignsGet | GET /campaigns | Load Campaigns |
campaignsPost | POST /campaigns | Add Campaign |
campaignsByNameDelete(name)
Delete Campaign
Delete the specific campaign. This does not cancel in progress email, see Cancel In Progress. Required Access Level: ModifyCampaigns
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.CampaignsApi();
let name = "name_example"; // String | Name of Campaign to delete
apiInstance.campaignsByNameDelete(name, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
name | String | Name of Campaign to delete |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Campaign campaignsByNameGet(name)
Load Campaign
Returns the specified campaign details. Required Access Level: ViewCampaigns
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.CampaignsApi();
let name = "name_example"; // String | Name of Campaign to get
apiInstance.campaignsByNameGet(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 Campaign to get |
- Content-Type: Not defined
- Accept: application/json
campaignsByNamePausePut(name)
Pause Campaign
Pauses the specific campaign, cancelling emails that are waiting to be sent. Required Access Level: ModifyCampaigns
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.CampaignsApi();
let name = "name_example"; // String | Name of Campaign to pause
apiInstance.campaignsByNamePausePut(name, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
name | String | Name of Campaign to pause |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Campaign campaignsByNamePut(name, campaign)
Update Campaign
Updates a previously added campaign. Only Active and Paused campaigns can be updated. Required Access Level: ModifyCampaigns
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.CampaignsApi();
let name = "name_example"; // String | Name of Campaign to update
let campaign = new ElasticEmail.Campaign(); // Campaign | JSON representation of a campaign
apiInstance.campaignsByNamePut(name, campaign, (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 Campaign to update | |
campaign | Campaign | JSON representation of a campaign |
- Content-Type: application/json
- Accept: application/json
[Campaign] campaignsGet(opts)
Load Campaigns
Returns a list all of your campaigns. Limited to 1000 results. Required Access Level: ViewCampaigns
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.CampaignsApi();
let opts = {
'search': "search_example", // String | Text fragment used for searching in Campaign name (using the 'contains' rule)
'offset': 20, // Number | How many items should be returned ahead.
'limit': 100 // Number | Maximum number of returned items.
};
apiInstance.campaignsGet(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
search | String | Text fragment used for searching in Campaign name (using the 'contains' rule) | [optional] |
offset | Number | How many items should be returned ahead. | [optional] |
limit | Number | Maximum number of returned items. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Campaign campaignsPost(campaign)
Add Campaign
Add a campaign for processing. Required Access Level: ModifyCampaigns
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.CampaignsApi();
let campaign = new ElasticEmail.Campaign(); // Campaign | JSON representation of a campaign
apiInstance.campaignsPost(campaign, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
campaign | Campaign | JSON representation of a campaign |
- Content-Type: application/json
- Accept: application/json