Skip to content

mimepost/mimepost-python

Repository files navigation

MimePost

MimePost API for sending email. You can find out more about MimePost at https://mimepost.com. For this sample, you can use the api key special-key to test the authorization filters.

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

  • API version: 0.1.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

Installation for Python 3.4 & below

pip3 install mimepost

Installation for Python 2.7 & below

pip install mimepost

Install directly from Github

pip install git+https://github.com/mimepost/mimepost-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/mimepost/mimepost-python.git)

Setuptools

Install via Setuptools.

python setup.py install --user

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

Import the package

Then import the package:

import MimePost

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import MimePost
from MimePost.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = MimePost.Configuration()
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = MimePost.EmailsApi(MimePost.ApiClient(configuration))

to_email     = MimePost.EmailTo(email = "[email protected]");

body = MimePost.Email(
    subject     =   "Test email sent using MimePost Python SDK",
    from_email  =   "[email protected]",
    html        =   "<p>This is a body of the test email sent using MimePost Python SDK</p>",
    to          =   [to_email],
) # Email | Single Email object 

try:
    # Send email
    api_response = api_instance.send_email(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EmailsApi->send_email: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.mimepost.com/v1/

Class Method HTTP request Description
AccountsApi account_profile_get GET /account/profile/ Get account profile details
AccountsApi account_profile_post POST /account/profile/ Update account profile details
AccountsApi settings_get GET /settings/ Get all the settings
AccountsApi settings_post POST /settings/ Set a setting
DomainsApi domains_get GET /domains/ Get a list of all the domains
DomainsApi domains_id_approve_post POST /domains/{id}/approve/ Submit request for the approval of a verified domain
DomainsApi domains_id_delete DELETE /domains/{id} Remove a single domain
DomainsApi domains_id_get GET /domains/{id} Get the details of a single domain
DomainsApi domains_id_verify_dkim_post POST /domains/{id}/verify_dkim/ Request for the verification of DKIM record for a single domain
DomainsApi domains_id_verify_spf_post POST /domains/{id}/verify_spf/ Request for the verification of SPF record for a single domain
DomainsApi domains_id_verify_tracking_post POST /domains/{id}/verify_tracking/ Request for the verification of tracking record for a single domain
DomainsApi domains_post POST /domains/ Add single domain
EmailsApi send_email POST /emails/ Send email
StatsApi emaillogs_get GET /emaillogs/ Get the logs of a particular date
StatsApi stats_get GET /stats/ Get the summary of stats for a range of dates
WebhooksApi webhooks_get GET /webhooks/ Get the list of all the webhooks
WebhooksApi webhooks_id_delete DELETE /webhooks/{id} Remove a single webhook
WebhooksApi webhooks_id_get GET /webhooks/{id} Get the details of a single webhook
WebhooksApi webhooks_id_put PUT /webhooks/{id} Update the details of a single webhook
WebhooksApi webhooks_post POST /webhooks/ Add single webhook

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key
  • API key parameter name: X-Auth-Token
  • Location: HTTP header

Author

[email protected]