Skip to content

mailmojo/mailmojo-python-sdk

Repository files navigation

MailMojo SDK for Python

v1 of the MailMojo API

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 1.1.0
  • Package version: 0.6.0
  • Build package: io.swagger.codegen.languages.PythonClientCodegen

For more information, please visit https://mailmojo.dev

Requirements

Python 2.7 and 3.4+

Installation & Usage

pip install

We recommend you install with pip:

pip install mailmojo-sdk

Then import the package:

import mailmojo_sdk

Setuptools

Install via Setuptools is also possible.

Clone the repo and perform the installation:

git clone https://github.com/eliksir/mailmojo-python-sdk.git
cd mailmojo-python-sdk
python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import mailmojo_sdk

Getting Started

Please follow the installation procedure and then run the following:

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.AccountApi(mailmojo_sdk.ApiClient(configuration))
user = mailmojo_sdk.UserCreation() # UserCreation | 

try:
    # Create an account.
    api_response = api_instance.create_account(user)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->create_account: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.mailmojo.no

Class Method HTTP request Description
AccountApi create_account POST /v1/accounts/ Create an account.
AccountApi get_account_by_username GET /v1/accounts/{username}/ Retrieve account details.
AccountApi get_domain GET /v1/domains/{domain}/ Retrieve domain details and authentication status.
AccountApi update_account POST /v1/accounts/{username}/ Update account details.
AutomationApi get_campaign_by_id GET /v1/campaigns/{campaign_id}/ Retrieve an automation campaign by id.
ContactApi get_contact_by_email GET /v1/contacts/{email}/ Retrieve a contact in any list by email.
ContactApi get_contacts GET /v1/contacts/ Retrieve all contacts across every list.
ContactApi get_historical_contact_stats GET /v1/contacts/stats/ Retrieve historical stats over contacts across every list.
ContactApi get_subscriber_on_list_by_email GET /v1/lists/{list_id}/subscribers/{email}/ Retrieve a subscriber.
ContactApi get_subscribers_on_list GET /v1/lists/{list_id}/subscribers/ Retrieve subscribers on a list.
ContactApi get_unsubscribed_on_list GET /v1/lists/{list_id}/unsubscribed/ Retrieve unsubscribed contacts on a list.
ContactApi subscribe_contact_to_list POST /v1/lists/{list_id}/subscribers/ Subscribe a contact to the email list.
ContactApi unsubscribe_contact_on_list_by_email DELETE /v1/lists/{list_id}/subscribers/{email}/ Unsubscribe a contact.
ContactApi update_contact PATCH /v1/contacts/{email}/ Update details about a contact.
EmbedApi create_embed_session POST /v1/embed/ Create a new embedded application session.
FormApi form_add_subscriber PATCH /v1/forms/{id}/subscribers/ Add a subscriber through a form and track the conversion.
FormApi get_form_by_id GET /v1/forms/{id}/ Retrieve a form.
FormApi get_forms GET /v1/forms/ Retrieve all forms.
FormApi track_form_view PATCH /v1/forms/{id}/track/view/ Track a view of a form.
FormApi update_form PATCH /v1/forms/{id}/ Update a form partially.
ListApi create_segment POST /v1/lists/{list_id}/segments/ Create a segment in the email list.
ListApi get_list_by_id GET /v1/lists/{list_id}/ Retrieve an email list.
ListApi get_lists GET /v1/lists/ Retrieve all email lists.
ListApi get_subscriber_on_list_by_email GET /v1/lists/{list_id}/subscribers/{email}/ Retrieve a subscriber.
ListApi get_subscribers_on_list GET /v1/lists/{list_id}/subscribers/ Retrieve subscribers on a list.
ListApi get_unsubscribed_on_list GET /v1/lists/{list_id}/unsubscribed/ Retrieve unsubscribed contacts on a list.
ListApi import_subscribers_to_list POST /v1/lists/{list_id}/subscribers/import/ Subscribe contacts to the email list.
ListApi subscribe_contact_to_list POST /v1/lists/{list_id}/subscribers/ Subscribe a contact to the email list.
ListApi unsubscribe_contact_on_list_by_email DELETE /v1/lists/{list_id}/subscribers/{email}/ Unsubscribe a contact.
ListApi update_list PATCH /v1/lists/{list_id}/ Update an email list partially.
NewsletterApi cancel_newsletter PUT /v1/newsletters/{newsletter_id}/cancel/ Cancel a newsletter.
NewsletterApi create_newsletter POST /v1/newsletters/ Create a newsletter draft.
NewsletterApi get_newsletter_by_id GET /v1/newsletters/{newsletter_id}/ Retrieve a newsletter by id.
NewsletterApi get_newsletters GET /v1/newsletters/ Retrieve all newsletters.
NewsletterApi send_newsletter PUT /v1/newsletters/{newsletter_id}/send/ Send a newsletter.
NewsletterApi test_newsletter POST /v1/newsletters/{newsletter_id}/send_test/ Send a test newsletter.
NewsletterApi update_newsletter PATCH /v1/newsletters/{newsletter_id}/ Update a newsletter draft partially.
PageApi get_page_by_id GET /v1/pages/{id}/ Retrieve a landing page.
PageApi get_pages GET /v1/pages/ Retrieve all landing pages.
PageApi track_page_view PATCH /v1/pages/{id}/track/view/ Track a view of a landing page.
PageApi update_page PATCH /v1/pages/{id}/ Update a landing page partially.
SegmentApi create_segment POST /v1/lists/{list_id}/segments/ Create a segment in the email list.
TemplateApi get_templates GET /v1/templates/ Retrieve all templates.
WebhookApi create_webhook POST /v1/webhooks/ Create a webhook.
WebhookApi delete_webhook DELETE /v1/webhooks/{id}/ Delete a webhook.

Documentation For Models

Documentation For Authorization

mailmojo_auth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://api.mailmojo.no/oauth/authorize/
  • Scopes:
    • account: Manage your MailMojo account.
    • account_creation: Create new MailMojo accounts.
    • account_creation.trial_30: Create new MailMojo accounts with a 30 day trial period.
    • account_settings: Manage your MailMojo account settings.
    • campaigns: Manage your automated campaigns.
    • campaigns:read: Retrieve your automated campaigns.
    • contacts: Manage your contacts across all your email lists.
    • contacts:read: Retrieve your contacts across all your email lists.
    • embed: Give you an embedded MailMojo application with access to your account.
    • events: Track events on your forms and landing pages.
    • forms: Manage your forms.
    • forms:read: Retrieve your forms.
    • lists: Manage your email lists, excluding subscribers.
    • lists:read: Retrieve your email lists, excluding subscribers.
    • newsletters: Manage your newsletters.
    • newsletters:read: Retrieve your newsletters.
    • pages: Manage your landing pages.
    • pages:read: Retrieve your landing pages.
    • subscribe: Add subscribers to email lists.
    • templates: Manage your templates.
    • templates:read: Retrieve your templates
    • webhooks: Manage your webhooks.

Author

[email protected]