All URIs are relative to https://api.elasticemail.com/v4
Method | HTTP request | Description |
---|---|---|
contactsByEmailDelete | DELETE /contacts/{email} | Delete Contact |
contactsByEmailGet | GET /contacts/{email} | Load Contact |
contactsByEmailPut | PUT /contacts/{email} | Update Contact |
contactsDeletePost | POST /contacts/delete | Delete Contacts Bulk |
contactsExportByIdStatusGet | GET /contacts/export/{id}/status | Check Export Status |
contactsExportPost | POST /contacts/export | Export Contacts |
contactsGet | GET /contacts | Load Contacts |
contactsImportPost | POST /contacts/import | Upload Contacts |
contactsPost | POST /contacts | Add Contact |
contactsByEmailDelete(email)
Delete Contact
Deletes the provided contact. 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.ContactsApi();
let email = "mail@example.com"; // String | Proper email address.
apiInstance.contactsByEmailDelete(email, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
String | Proper email address. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Contact contactsByEmailGet(email)
Load Contact
Load detailed contact information for specified email. 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.ContactsApi();
let email = "mail@example.com"; // String | Proper email address.
apiInstance.contactsByEmailGet(email, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
String | Proper email address. |
- Content-Type: Not defined
- Accept: application/json
Contact contactsByEmailPut(email, contactUpdatePayload)
Update Contact
Update selected contact. Omitted contact's fields will not be changed. 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.ContactsApi();
let email = "mail@example.com"; // String | Proper email address.
let contactUpdatePayload = new ElasticEmail.ContactUpdatePayload(); // ContactUpdatePayload |
apiInstance.contactsByEmailPut(email, contactUpdatePayload, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
String | Proper email address. | ||
contactUpdatePayload | ContactUpdatePayload |
- Content-Type: application/json
- Accept: application/json
contactsDeletePost(emailsPayload)
Delete Contacts Bulk
Deletes provided contacts in bulk. 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.ContactsApi();
let emailsPayload = new ElasticEmail.EmailsPayload(); // EmailsPayload | Provide either rule or a list of emails, not both.
apiInstance.contactsDeletePost(emailsPayload, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
emailsPayload | EmailsPayload | Provide either rule or a list of emails, not both. |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
ExportStatus contactsExportByIdStatusGet(id)
Check Export Status
Check the current status of the export. Required Access Level: Export
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.ContactsApi();
let id = "E33EBA7A-C20D-4D3D-8F2F-5EEF42F58E6F"; // String | ID of the exported file
apiInstance.contactsExportByIdStatusGet(id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | ID of the exported file |
- Content-Type: Not defined
- Accept: application/json
ExportLink contactsExportPost(opts)
Export Contacts
Request an Export of specified Contacts. Required Access Level: Export
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.ContactsApi();
let opts = {
'fileFormat': new ElasticEmail.ExportFileFormats(), // ExportFileFormats | Format of the exported file
'rule': "Status%20=%20Engaged", // String | Query used for filtering.
'emails': ["null"], // [String] | Comma delimited list of contact emails
'compressionFormat': new ElasticEmail.CompressionFormat(), // CompressionFormat | FileResponse compression format. None or Zip.
'fileName': "filename.txt" // String | Name of your file including extension.
};
apiInstance.contactsExportPost(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
fileFormat | ExportFileFormats | Format of the exported file | [optional] |
rule | String | Query used for filtering. | [optional] |
emails | [String] | Comma delimited list of contact emails | [optional] |
compressionFormat | CompressionFormat | FileResponse compression format. None or Zip. | [optional] |
fileName | String | Name of your file including extension. | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Contact] contactsGet(opts)
Load Contacts
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.ContactsApi();
let opts = {
'limit': 100, // Number | Maximum number of returned items.
'offset': 20 // Number | How many items should be returned ahead.
};
apiInstance.contactsGet(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
contactsImportPost(opts)
Upload Contacts
Upload contacts from a file. 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.ContactsApi();
let opts = {
'listName': "listName_example", // String | Name of an existing list to add these contacts to
'encodingName': "encodingName_example", // String | In what encoding the file is uploaded
'fileUrl': "fileUrl_example", // String | Optional url of csv to import
'file': "/path/to/file" // File |
};
apiInstance.contactsImportPost(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
listName | String | Name of an existing list to add these contacts to | [optional] |
encodingName | String | In what encoding the file is uploaded | [optional] |
fileUrl | String | Optional url of csv to import | [optional] |
file | File | [optional] |
null (empty response body)
- Content-Type: multipart/form-data
- Accept: Not defined
[Contact] contactsPost(contactPayload, opts)
Add Contact
Add new Contacts to your Lists. Up to 1000 can be added (for more please refer to the import request). 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.ContactsApi();
let contactPayload = [new ElasticEmail.ContactPayload()]; // [ContactPayload] |
let opts = {
'listnames': ["null"] // [String] | Names of lists to which the uploaded contacts should be added to
};
apiInstance.contactsPost(contactPayload, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
contactPayload | [ContactPayload] | ||
listnames | [String] | Names of lists to which the uploaded contacts should be added to | [optional] |
- Content-Type: application/json
- Accept: application/json