All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| lists_by_listname_contacts_get | GET /lists/{listname}/contacts | Load Contacts in List |
| lists_by_name_contacts_post | POST /lists/{name}/contacts | Add Contacts to List |
| lists_by_name_contacts_remove_post | POST /lists/{name}/contacts/remove | Remove Contacts from List |
| lists_by_name_delete | DELETE /lists/{name} | Delete List |
| lists_by_name_get | GET /lists/{name} | Load List |
| lists_by_name_put | PUT /lists/{name} | Update List |
| lists_get | GET /lists | Load Lists |
| lists_post | POST /lists | Add List |
List[Contact] lists_by_listname_contacts_get(listname, limit=limit, offset=offset)
Load Contacts in List
Returns a list of contacts. Required Access Level: ViewContacts
- Api Key Authentication (apikey):
import ElasticEmail
from ElasticEmail.models.contact import Contact
from ElasticEmail.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = ElasticEmail.Configuration(
host = "https://api.elasticemail.com/v4"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Enter a context with an instance of the API client
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ElasticEmail.ListsApi(api_client)
listname = 'My List 1' # str | Name of your list.
limit = 100 # int | Maximum number of returned items. (optional)
offset = 20 # int | How many items should be returned ahead. (optional)
try:
# Load Contacts in List
api_response = api_instance.lists_by_listname_contacts_get(listname, limit=limit, offset=offset)
print("The response of ListsApi->lists_by_listname_contacts_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ListsApi->lists_by_listname_contacts_get: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| listname | str | Name of your list. | |
| limit | int | Maximum number of returned items. | [optional] |
| offset | int | How many items should be returned ahead. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ContactsList lists_by_name_contacts_post(name, emails_payload)
Add Contacts to List
Add existing Contacts to specified list. Required Access Level: ModifyContacts
- Api Key Authentication (apikey):
import ElasticEmail
from ElasticEmail.models.contacts_list import ContactsList
from ElasticEmail.models.emails_payload import EmailsPayload
from ElasticEmail.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = ElasticEmail.Configuration(
host = "https://api.elasticemail.com/v4"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Enter a context with an instance of the API client
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ElasticEmail.ListsApi(api_client)
name = 'My List 1' # str | Name of your list.
emails_payload = ElasticEmail.EmailsPayload() # EmailsPayload | Provide either rule or a list of emails, not both.
try:
# Add Contacts to List
api_response = api_instance.lists_by_name_contacts_post(name, emails_payload)
print("The response of ListsApi->lists_by_name_contacts_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ListsApi->lists_by_name_contacts_post: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Name of your list. | |
| emails_payload | EmailsPayload | Provide either rule or a list of emails, not both. |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
lists_by_name_contacts_remove_post(name, emails_payload)
Remove Contacts from List
Remove specified Contacts from your list. Required Access Level: ModifyContacts
- Api Key Authentication (apikey):
import ElasticEmail
from ElasticEmail.models.emails_payload import EmailsPayload
from ElasticEmail.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = ElasticEmail.Configuration(
host = "https://api.elasticemail.com/v4"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Enter a context with an instance of the API client
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ElasticEmail.ListsApi(api_client)
name = 'My List 1' # str | Name of your list.
emails_payload = ElasticEmail.EmailsPayload() # EmailsPayload | Provide either rule or a list of emails, not both.
try:
# Remove Contacts from List
api_instance.lists_by_name_contacts_remove_post(name, emails_payload)
except Exception as e:
print("Exception when calling ListsApi->lists_by_name_contacts_remove_post: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Name of your list. | |
| emails_payload | EmailsPayload | Provide either rule or a list of emails, not both. |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
lists_by_name_delete(name)
Delete List
Deletes List and removes all the Contacts from it (does not delete Contacts). Required Access Level: ModifyContacts
- Api Key Authentication (apikey):
import ElasticEmail
from ElasticEmail.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = ElasticEmail.Configuration(
host = "https://api.elasticemail.com/v4"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Enter a context with an instance of the API client
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ElasticEmail.ListsApi(api_client)
name = 'My List 1' # str | Name of your list.
try:
# Delete List
api_instance.lists_by_name_delete(name)
except Exception as e:
print("Exception when calling ListsApi->lists_by_name_delete: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Name of your list. |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ContactsList lists_by_name_get(name)
Load List
Returns detailed information about specified list. Required Access Level: ViewContacts
- Api Key Authentication (apikey):
import ElasticEmail
from ElasticEmail.models.contacts_list import ContactsList
from ElasticEmail.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = ElasticEmail.Configuration(
host = "https://api.elasticemail.com/v4"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Enter a context with an instance of the API client
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ElasticEmail.ListsApi(api_client)
name = 'My List 1' # str | Name of your list.
try:
# Load List
api_response = api_instance.lists_by_name_get(name)
print("The response of ListsApi->lists_by_name_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ListsApi->lists_by_name_get: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Name of your list. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ContactsList lists_by_name_put(name, list_update_payload)
Update List
Update existing list. Required Access Level: ModifyContacts
- Api Key Authentication (apikey):
import ElasticEmail
from ElasticEmail.models.contacts_list import ContactsList
from ElasticEmail.models.list_update_payload import ListUpdatePayload
from ElasticEmail.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = ElasticEmail.Configuration(
host = "https://api.elasticemail.com/v4"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Enter a context with an instance of the API client
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ElasticEmail.ListsApi(api_client)
name = 'My List 1' # str | Name of your list.
list_update_payload = ElasticEmail.ListUpdatePayload() # ListUpdatePayload |
try:
# Update List
api_response = api_instance.lists_by_name_put(name, list_update_payload)
print("The response of ListsApi->lists_by_name_put:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ListsApi->lists_by_name_put: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Name of your list. | |
| list_update_payload | ListUpdatePayload |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List[ContactsList] lists_get(limit=limit, offset=offset)
Load Lists
Returns all your existing lists. Required Access Level: ViewContacts
- Api Key Authentication (apikey):
import ElasticEmail
from ElasticEmail.models.contacts_list import ContactsList
from ElasticEmail.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = ElasticEmail.Configuration(
host = "https://api.elasticemail.com/v4"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Enter a context with an instance of the API client
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ElasticEmail.ListsApi(api_client)
limit = 100 # int | Maximum number of returned items. (optional)
offset = 20 # int | How many items should be returned ahead. (optional)
try:
# Load Lists
api_response = api_instance.lists_get(limit=limit, offset=offset)
print("The response of ListsApi->lists_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ListsApi->lists_get: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Maximum number of returned items. | [optional] |
| offset | int | How many items should be returned ahead. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ContactsList lists_post(list_payload)
Add List
Add a new list. Required Access Level: ModifyContacts
- Api Key Authentication (apikey):
import ElasticEmail
from ElasticEmail.models.contacts_list import ContactsList
from ElasticEmail.models.list_payload import ListPayload
from ElasticEmail.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = ElasticEmail.Configuration(
host = "https://api.elasticemail.com/v4"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Enter a context with an instance of the API client
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ElasticEmail.ListsApi(api_client)
list_payload = ElasticEmail.ListPayload() # ListPayload |
try:
# Add List
api_response = api_instance.lists_post(list_payload)
print("The response of ListsApi->lists_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ListsApi->lists_post: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list_payload | ListPayload |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Created | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]