All URIs are relative to https://api.mailmojo.no
Method | HTTP request | Description |
---|---|---|
get_contact_by_email | GET /v1/contacts/{email}/ | Retrieve a contact in any list by email. |
get_contacts | GET /v1/contacts/ | Retrieve all contacts across every list. |
get_historical_contact_stats | GET /v1/contacts/stats/ | Retrieve historical stats over contacts across every list. |
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. |
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_contact | PATCH /v1/contacts/{email}/ | Update details about a contact. |
Contact get_contact_by_email(email)
Retrieve a contact in any list by email.
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.ContactApi(mailmojo_sdk.ApiClient(configuration))
email = 'email_example' # str |
try:
# Retrieve a contact in any list by email.
api_response = api_instance.get_contact_by_email(email)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactApi->get_contact_by_email: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
str |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Contact] get_contacts()
Retrieve all contacts across every list.
This endpoint currently returns all contacts in your account without any pagination and should be considered EXPERIMENTAL. The response schema will change without any warning in the near future to account for pagination.
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.ContactApi(mailmojo_sdk.ApiClient(configuration))
try:
# Retrieve all contacts across every list.
api_response = api_instance.get_contacts()
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactApi->get_contacts: %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]
list[HistoricalContactsStats] get_historical_contact_stats(start_date=start_date)
Retrieve historical stats over contacts across every 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.ContactApi(mailmojo_sdk.ApiClient(configuration))
start_date = '2013-10-20' # date | The starting date to include stats from. (optional)
try:
# Retrieve historical stats over contacts across every list.
api_response = api_instance.get_historical_contact_stats(start_date=start_date)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactApi->get_historical_contact_stats: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
start_date | date | The starting date to include stats from. | [optional] |
- 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.ContactApi(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 ContactApi->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.ContactApi(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 ContactApi->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.ContactApi(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 ContactApi->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]
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.ContactApi(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 ContactApi->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.ContactApi(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 ContactApi->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]
BaseContact update_contact(email, contact=contact)
Update details about 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.ContactApi(mailmojo_sdk.ApiClient(configuration))
email = 'email_example' # str | Email address of contact to update.
contact = mailmojo_sdk.BaseContact() # BaseContact | (optional)
try:
# Update details about a contact.
api_response = api_instance.update_contact(email, contact=contact)
pprint(api_response)
except ApiException as e:
print("Exception when calling ContactApi->update_contact: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
str | Email address of contact to update. | ||
contact | BaseContact | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]