Python Documentation

Create real email addresses in Python. Send and receive emails in Django, Flask, or any Python context.

mailslurp_client.ExtraOperationsApi

All URIs are relative to https://api.mailslurp.com

Method HTTP request Description
bulk_create_inboxes POST /bulk/inboxes Bulk create Inboxes (email addresses)
bulk_delete_inboxes DELETE /bulk/inboxes Bulk Delete Inboxes
bulk_send_emails POST /bulk/send Bulk Send Emails
create_domain POST /domains Create Domain
create_inbox POST /inboxes Create an Inbox (email address)
create_webhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
delete_domain DELETE /domains/{id} Delete a domain
delete_email1 DELETE /emails/{emailId} Delete Email
delete_inbox DELETE /inboxes/{inboxId} Delete Inbox / Email Address
delete_webhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a WebHook for an Inbox
download_attachment GET /emails/{emailId}/attachments/{attachmentId} Get email attachment
forward_email POST /emails/{emailId}/forward Forward Email
get_domain GET /domains/{id} Get a domain
get_domains GET /domains Get domains
get_email GET /emails/{emailId} Get Email Content
get_emails GET /inboxes/{inboxId}/emails List Emails in an Inbox / EmailAddress
get_emails_paginated GET /emails Get all emails
get_inbox GET /inboxes/{inboxId} Get Inbox / EmailAddress
get_inboxes GET /inboxes List Inboxes / Email Addresses
get_raw_email_contents GET /emails/{emailId}/raw Get Raw Email Content
get_webhooks GET /inboxes/{inboxId}/webhooks Get all WebHooks for an Inbox
send_email POST /inboxes/{inboxId} Send Email
upload_attachment POST /attachments Upload an attachment for sending
upload_multipart_form POST /attachments/multipart Upload an attachment for sending using Multipart Form

bulk_create_inboxes

list[Inbox] bulk_create_inboxes(count)

Bulk create Inboxes (email addresses)

Enterprise Plan Required

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
count = 56 # int | Number of inboxes to be created in bulk

try:
    # Bulk create Inboxes (email addresses)
    api_response = api_instance.bulk_create_inboxes(count)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->bulk_create_inboxes: %s\n" % e)

Parameters

Name Type Description Notes
count int Number of inboxes to be created in bulk

Return type

list[Inbox]

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

bulk_delete_inboxes

bulk_delete_inboxes(request_body)

Bulk Delete Inboxes

Enterprise Plan Required

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
request_body = NULL # list[str] | ids

try:
    # Bulk Delete Inboxes
    api_instance.bulk_delete_inboxes(request_body)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->bulk_delete_inboxes: %s\n" % e)

Parameters

Name Type Description Notes
request_body list[str] ids

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

bulk_send_emails

bulk_send_emails(bulk_send_email_options)

Bulk Send Emails

Enterprise Plan Required

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
bulk_send_email_options = mailslurp_client.BulkSendEmailOptions() # BulkSendEmailOptions | bulkSendEmailOptions

try:
    # Bulk Send Emails
    api_instance.bulk_send_emails(bulk_send_email_options)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->bulk_send_emails: %s\n" % e)

Parameters

Name Type Description Notes
bulk_send_email_options BulkSendEmailOptions bulkSendEmailOptions

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_domain

DomainPlusVerificationRecordsAndStatus create_domain(create_domain_options)

Create Domain

Link a domain that you own with MailSlurp so you can create inboxes with it. Returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain.

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
create_domain_options = mailslurp_client.CreateDomainOptions() # CreateDomainOptions | domainOptions

try:
    # Create Domain
    api_response = api_instance.create_domain(create_domain_options)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->create_domain: %s\n" % e)

Parameters

Name Type Description Notes
create_domain_options CreateDomainOptions domainOptions

Return type

DomainPlusVerificationRecordsAndStatus

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_inbox

Inbox create_inbox(email_address=email_address)

Create an Inbox (email address)

Create a new inbox and with a ranmdomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
email_address = 'email_address_example' # str | Optional email address including domain you wish inbox to use (eg: test123@mydomain.com). Only supports domains that you have registered and verified with MailSlurp using dashboard or `createDomain` method. (optional)

try:
    # Create an Inbox (email address)
    api_response = api_instance.create_inbox(email_address=email_address)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->create_inbox: %s\n" % e)

Parameters

Name Type Description Notes
email_address str Optional email address including domain you wish inbox to use (eg: test123@mydomain.com). Only supports domains that you have registered and verified with MailSlurp using dashboard or `createDomain` method. [optional]

Return type

Inbox

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_webhook

Webhook create_webhook(inbox_id, create_webhook_options)

Attach a WebHook URL to an inbox

Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | inboxId
create_webhook_options = mailslurp_client.CreateWebhookOptions() # CreateWebhookOptions | webhookOptions

try:
    # Attach a WebHook URL to an inbox
    api_response = api_instance.create_webhook(inbox_id, create_webhook_options)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->create_webhook: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str inboxId
create_webhook_options CreateWebhookOptions webhookOptions

Return type

Webhook

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_domain

delete_domain(id)

Delete a domain

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
id = 'id_example' # str | id

try:
    # Delete a domain
    api_instance.delete_domain(id)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->delete_domain: %s\n" % e)

Parameters

Name Type Description Notes
id str id

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_email1

delete_email1(email_id)

Delete Email

Deletes an email and removes it from the inbox

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
email_id = 'email_id_example' # str | emailId

try:
    # Delete Email
    api_instance.delete_email1(email_id)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->delete_email1: %s\n" % e)

Parameters

Name Type Description Notes
email_id str emailId

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_inbox

delete_inbox(inbox_id)

Delete Inbox / Email Address

Permanently delete an inbox and associated email address

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | inboxId

try:
    # Delete Inbox / Email Address
    api_instance.delete_inbox(inbox_id)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->delete_inbox: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str inboxId

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_webhook

delete_webhook(inbox_id, webhook_id)

Delete and disable a WebHook for an Inbox

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | inboxId
webhook_id = 'webhook_id_example' # str | webhookId

try:
    # Delete and disable a WebHook for an Inbox
    api_instance.delete_webhook(inbox_id, webhook_id)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->delete_webhook: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str inboxId
webhook_id str webhookId

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

download_attachment

download_attachment(attachment_id, email_id, api_key=api_key)

Get email attachment

Returns the specified attachment for a given email as a byte stream (file download). Get the attachmentId from the email response. Requires enterprise account.

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
attachment_id = 'attachment_id_example' # str | attachmentId
email_id = 'email_id_example' # str | emailId
api_key = 'api_key_example' # str | Can pass apiKey in url for this request if you wish to download the file in a browser (optional)

try:
    # Get email attachment
    api_instance.download_attachment(attachment_id, email_id, api_key=api_key)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->download_attachment: %s\n" % e)

Parameters

Name Type Description Notes
attachment_id str attachmentId
email_id str emailId
api_key str Can pass apiKey in url for this request if you wish to download the file in a browser [optional]

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

forward_email

forward_email(email_id, forward_email_options)

Forward Email

Forward email content to given recipients

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
email_id = 'email_id_example' # str | emailId
forward_email_options = mailslurp_client.ForwardEmailOptions() # ForwardEmailOptions | forwardEmailOptions

try:
    # Forward Email
    api_instance.forward_email(email_id, forward_email_options)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->forward_email: %s\n" % e)

Parameters

Name Type Description Notes
email_id str emailId
forward_email_options ForwardEmailOptions forwardEmailOptions

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_domain

DomainPlusVerificationRecordsAndStatus get_domain(id)

Get a domain

Returns domain verification status and tokens

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
id = 'id_example' # str | id

try:
    # Get a domain
    api_response = api_instance.get_domain(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_domain: %s\n" % e)

Parameters

Name Type Description Notes
id str id

Return type

DomainPlusVerificationRecordsAndStatus

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_domains

list[DomainPreview] get_domains()

Get domains

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))

try:
    # Get domains
    api_response = api_instance.get_domains()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_domains: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

list[DomainPreview]

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_email

Email get_email(email_id)

Get Email Content

Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawMessage endpoint

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
email_id = 'email_id_example' # str | emailId

try:
    # Get Email Content
    api_response = api_instance.get_email(email_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_email: %s\n" % e)

Parameters

Name Type Description Notes
email_id str emailId

Return type

Email

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_emails

list[EmailPreview] get_emails(inbox_id, limit=limit, min_count=min_count, retry_timeout=retry_timeout, since=since)

List Emails in an Inbox / EmailAddress

List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the minCount parameter. The server will retry the inbox database until the minCount is satisfied or the retryTimeout is reached

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | Id of inbox that emails belongs to
limit = 56 # int | Limit the result set, ordered by descending received date time (optional)
min_count = 56 # int | Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional)
retry_timeout = 56 # int | Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional)
since = '2013-10-20T19:20:30+01:00' # datetime | Exclude emails received before this ISO 8601 date time (optional)

try:
    # List Emails in an Inbox / EmailAddress
    api_response = api_instance.get_emails(inbox_id, limit=limit, min_count=min_count, retry_timeout=retry_timeout, since=since)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_emails: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str Id of inbox that emails belongs to
limit int Limit the result set, ordered by descending received date time [optional]
min_count int Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. [optional]
retry_timeout int Maximum milliseconds to spend retrying inbox database until minCount emails are returned [optional]
since datetime Exclude emails received before this ISO 8601 date time [optional]

Return type

list[EmailPreview]

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_emails_paginated

PageEmailProjection get_emails_paginated(page=page, size=size)

Get all emails

Responses are paginated

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
page = 0 # int | Optional page index in email list pagination (optional) (default to 0)
size = 20 # int | Optional page size in email list pagination (optional) (default to 20)

try:
    # Get all emails
    api_response = api_instance.get_emails_paginated(page=page, size=size)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_emails_paginated: %s\n" % e)

Parameters

Name Type Description Notes
page int Optional page index in email list pagination [optional][default to 0]
size int Optional page size in email list pagination [optional][default to 20]

Return type

PageEmailProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_inbox

Inbox get_inbox(inbox_id)

Get Inbox / EmailAddress

Returns an inbox's properties, including its email address and ID.

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | inboxId

try:
    # Get Inbox / EmailAddress
    api_response = api_instance.get_inbox(inbox_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_inbox: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str inboxId

Return type

Inbox

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_inboxes

list[Inbox] get_inboxes()

List Inboxes / Email Addresses

List the inboxes you have created

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))

try:
    # List Inboxes / Email Addresses
    api_response = api_instance.get_inboxes()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_inboxes: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

list[Inbox]

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_raw_email_contents

str get_raw_email_contents(email_id)

Get Raw Email Content

Returns a raw, unparsed and unprocessed email

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
email_id = 'email_id_example' # str | emailId

try:
    # Get Raw Email Content
    api_response = api_instance.get_raw_email_contents(email_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_raw_email_contents: %s\n" % e)

Parameters

Name Type Description Notes
email_id str emailId

Return type

str

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_webhooks

list[Webhook] get_webhooks(inbox_id)

Get all WebHooks for an Inbox

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | inboxId

try:
    # Get all WebHooks for an Inbox
    api_response = api_instance.get_webhooks(inbox_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->get_webhooks: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str inboxId

Return type

list[Webhook]

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

send_email

send_email(inbox_id, send_email_options)

Send Email

Send an email from the inbox's email address. Specify the email recipients and contents in the request body. See the SendEmailOptions for more information. Note the inboxId refers to the inbox's id NOT its email address

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | inboxId
send_email_options = mailslurp_client.SendEmailOptions() # SendEmailOptions | sendEmailOptions

try:
    # Send Email
    api_instance.send_email(inbox_id, send_email_options)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->send_email: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str inboxId
send_email_options SendEmailOptions sendEmailOptions

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upload_attachment

list[str] upload_attachment(upload_attachment_options)

Upload an attachment for sending

When sending emails with attachments first upload each attachment with this endpoint. Record the returned attachment IDs. Then use these attachment IDs in the SendEmailOptions when sending an email. This means that attachments can easily be reused.

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
upload_attachment_options = mailslurp_client.UploadAttachmentOptions() # UploadAttachmentOptions | uploadOptions

try:
    # Upload an attachment for sending
    api_response = api_instance.upload_attachment(upload_attachment_options)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->upload_attachment: %s\n" % e)

Parameters

Name Type Description Notes
upload_attachment_options UploadAttachmentOptions uploadOptions

Return type

list[str]

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upload_multipart_form

list[str] upload_multipart_form(file, content_type=content_type, filename=filename)

Upload an attachment for sending using Multipart Form

When sending emails with attachments first upload each attachment with this endpoint. Record the returned attachment IDs. Then use these attachment IDs in the SendEmailOptions when sending an email. This means that attachments can easily be reused.

Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'

# create an instance of the API class
api_instance = mailslurp_client.ExtraOperationsApi(mailslurp_client.ApiClient(configuration))
file = '/path/to/file' # file | file
content_type = 'content_type_example' # str | contentType (optional)
filename = 'filename_example' # str | filename (optional)

try:
    # Upload an attachment for sending using Multipart Form
    api_response = api_instance.upload_multipart_form(file, content_type=content_type, filename=filename)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExtraOperationsApi->upload_multipart_form: %s\n" % e)

Parameters

Name Type Description Notes
file file file
content_type str contentType [optional]
filename str filename [optional]

Return type

list[str]

Authorization

API_KEY

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]