All URIs are relative to https://api.elasticemail.com/v4
Method | HTTP request | Description |
---|---|---|
listsByListnameContactsGet | GET /lists/{listname}/contacts | Load Contacts in List |
listsByNameContactsPost | POST /lists/{name}/contacts | Add Contacts to List |
listsByNameContactsRemovePost | POST /lists/{name}/contacts/remove | Remove Contacts from List |
listsByNameDelete | DELETE /lists/{name} | Delete List |
listsByNameGet | GET /lists/{name} | Load List |
listsByNamePut | PUT /lists/{name} | Update List |
listsGet | GET /lists | Load Lists |
listsPost | POST /lists | Add List |
[Contact] listsByListnameContactsGet(listname, opts)
Load Contacts in List
Returns a list of contacts. Required Access Level: ViewContacts
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.ListsApi();
let listname = "My List 1"; // String | Name of your list.
let opts = {
'limit': 100, // Number | Maximum number of returned items.
'offset': 20 // Number | How many items should be returned ahead.
};
apiInstance.listsByListnameContactsGet(listname, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
listname | String | Name of your list. | |
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
ContactsList listsByNameContactsPost(name, emailsPayload)
Add Contacts to List
Add existing Contacts to specified list. Required Access Level: ModifyContacts
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.ListsApi();
let name = "My List 1"; // String | Name of your list.
let emailsPayload = new ElasticEmail.EmailsPayload(); // EmailsPayload | Provide either rule or a list of emails, not both.
apiInstance.listsByNameContactsPost(name, emailsPayload, (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 your list. | |
emailsPayload | EmailsPayload | Provide either rule or a list of emails, not both. |
- Content-Type: application/json
- Accept: application/json
listsByNameContactsRemovePost(name, emailsPayload)
Remove Contacts from List
Remove specified Contacts from your list. Required Access Level: ModifyContacts
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.ListsApi();
let name = "My List 1"; // String | Name of your list.
let emailsPayload = new ElasticEmail.EmailsPayload(); // EmailsPayload | Provide either rule or a list of emails, not both.
apiInstance.listsByNameContactsRemovePost(name, emailsPayload, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
name | String | Name of your list. | |
emailsPayload | EmailsPayload | Provide either rule or a list of emails, not both. |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
listsByNameDelete(name)
Delete List
Deletes List and removes all the Contacts from it (does not delete Contacts). Required Access Level: ModifyContacts
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.ListsApi();
let name = "My List 1"; // String | Name of your list.
apiInstance.listsByNameDelete(name, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
name | String | Name of your list. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
ContactsList listsByNameGet(name)
Load List
Returns detailed information about specified list. Required Access Level: ViewContacts
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.ListsApi();
let name = "My List 1"; // String | Name of your list.
apiInstance.listsByNameGet(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 your list. |
- Content-Type: Not defined
- Accept: application/json
ContactsList listsByNamePut(name, listUpdatePayload)
Update List
Update existing list. Required Access Level: ModifyContacts
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.ListsApi();
let name = "My List 1"; // String | Name of your list.
let listUpdatePayload = new ElasticEmail.ListUpdatePayload(); // ListUpdatePayload |
apiInstance.listsByNamePut(name, listUpdatePayload, (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 your list. | |
listUpdatePayload | ListUpdatePayload |
- Content-Type: application/json
- Accept: application/json
[ContactsList] listsGet(opts)
Load Lists
Returns all your existing lists. Required Access Level: ViewContacts
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.ListsApi();
let opts = {
'limit': 100, // Number | Maximum number of returned items.
'offset': 20 // Number | How many items should be returned ahead.
};
apiInstance.listsGet(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
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
ContactsList listsPost(listPayload)
Add List
Add a new list. Required Access Level: ModifyContacts
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.ListsApi();
let listPayload = new ElasticEmail.ListPayload(); // ListPayload |
apiInstance.listsPost(listPayload, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
listPayload | ListPayload |
- Content-Type: application/json
- Accept: application/json