All URIs are relative to https://api.mailmojo.no
Method | HTTP request | Description |
---|---|---|
create_segment | POST /v1/lists/{list_id}/segments/ | Create a segment in the email list. |
get_list_by_id | GET /v1/lists/{list_id}/ | Retrieve an email list. |
get_lists | GET /v1/lists/ | Retrieve all email lists. |
get_subscriber_on_list_by_email | GET /v1/lists/{list_id}/subscribers/{email}/ | Retrieve a subscriber. |
get_subscribers_on_list | GET /v1/lists/{list_id}/subscribers/ | Retrieve subscribers on a list. |
get_unsubscribed_on_list | GET /v1/lists/{list_id}/unsubscribed/ | Retrieve unsubscribed contacts on a list. |
import_subscribers_to_list | POST /v1/lists/{list_id}/subscribers/import/ | Subscribe contacts to the email list. |
subscribe_contact_to_list | POST /v1/lists/{list_id}/subscribers/ | Subscribe a contact to the email list. |
unsubscribe_contact_on_list_by_email | DELETE /v1/lists/{list_id}/subscribers/{email}/ | Unsubscribe a contact. |
update_list | PATCH /v1/lists/{list_id}/ | Update an email list partially. |
Segment create_segment(list_id, segment)
Create a segment in the email list.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = NULL # object | ID of the email list to create a segment in.
segment = mailmojo_sdk.SegmentCreation() # SegmentCreation |
try:
# Create a segment in the email list.
api_response = api_instance.create_segment(list_id, segment)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->create_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | object | ID of the email list to create a segment in. | |
segment | SegmentCreation |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListDetail get_list_by_id(list_id)
Retrieve an email list.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = 56 # int | ID of the email list to retrieve.
try:
# Retrieve an email list.
api_response = api_instance.get_list_by_id(list_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->get_list_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | int | ID of the email list to retrieve. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[List] get_lists()
Retrieve all email lists.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
try:
# Retrieve all email lists.
api_response = api_instance.get_lists()
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->get_lists: %s\n" % e)
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Subscriber get_subscriber_on_list_by_email(list_id, email)
Retrieve a subscriber.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = 56 # int | ID of the email list to retrieve the subscriber from.
email = 'email_example' # str | Email address of the contact to retrieve.
try:
# Retrieve a subscriber.
api_response = api_instance.get_subscriber_on_list_by_email(list_id, email)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->get_subscriber_on_list_by_email: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | int | ID of the email list to retrieve the subscriber from. | |
str | Email address of the contact to retrieve. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Subscriber] get_subscribers_on_list(list_id, limit=limit)
Retrieve subscribers on a list.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = 56 # int | ID of the email list.
limit = 56 # int | Limits the result to given count. (optional)
try:
# Retrieve subscribers on a list.
api_response = api_instance.get_subscribers_on_list(list_id, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->get_subscribers_on_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | int | ID of the email list. | |
limit | int | Limits the result to given count. | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Contact] get_unsubscribed_on_list(list_id, limit=limit)
Retrieve unsubscribed contacts on a list.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = 56 # int | ID of the email list.
limit = 56 # int | Limits the result to given count. (optional)
try:
# Retrieve unsubscribed contacts on a list.
api_response = api_instance.get_unsubscribed_on_list(list_id, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->get_unsubscribed_on_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | int | ID of the email list. | |
limit | int | Limits the result to given count. | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ImportResult import_subscribers_to_list(list_id, contacts)
Subscribe contacts to the email list.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = 56 # int | ID of the email list to subscribe to.
contacts = [mailmojo_sdk.Contacts()] # list[Contacts] |
try:
# Subscribe contacts to the email list.
api_response = api_instance.import_subscribers_to_list(list_id, contacts)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->import_subscribers_to_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | int | ID of the email list to subscribe to. | |
contacts | list[Contacts] |
- Content-Type: text/csv
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Contact subscribe_contact_to_list(list_id, contact)
Subscribe a contact to the email list.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = 56 # int | ID of the email list to subscribe to.
contact = mailmojo_sdk.Subscriber() # Subscriber |
try:
# Subscribe a contact to the email list.
api_response = api_instance.subscribe_contact_to_list(list_id, contact)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->subscribe_contact_to_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | int | ID of the email list to subscribe to. | |
contact | Subscriber |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Contact unsubscribe_contact_on_list_by_email(list_id, email)
Unsubscribe a contact.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = 56 # int | ID of the email list to unsubscribe from.
email = 'email_example' # str | Email address of the contact to unsubscribe.
try:
# Unsubscribe a contact.
api_response = api_instance.unsubscribe_contact_on_list_by_email(list_id, email)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->unsubscribe_contact_on_list_by_email: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | int | ID of the email list to unsubscribe from. | |
str | Email address of the contact to unsubscribe. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListDetail update_list(list_id, list=list)
Update an email list partially.
from __future__ import print_function
import time
import mailmojo_sdk
from mailmojo_sdk.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: mailmojo_auth
configuration = mailmojo_sdk.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = mailmojo_sdk.ListApi(mailmojo_sdk.ApiClient(configuration))
list_id = 56 # int | ID of the email list to retrieve.
list = mailmojo_sdk.ListDetail() # ListDetail | (optional)
try:
# Update an email list partially.
api_response = api_instance.update_list(list_id, list=list)
pprint(api_response)
except ApiException as e:
print("Exception when calling ListApi->update_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
list_id | int | ID of the email list to retrieve. | |
list | ListDetail | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]