mailslurp_client.CommonOperationsApi

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

Method HTTP request Description
create_new_email_address POST /newEmailAddress Create new email address
delete_email DELETE /deleteEmail Delete an email
delete_email_address DELETE /deleteEmailAddress Delete email address and its emails
empty_inbox DELETE /emptyInbox Delete all emails in an inbox
send_email_simple POST /sendEmail Send an email from a random email address
wait_for_email_count GET /waitForEmailCount Wait for and return count number of emails
wait_for_latest_email GET /waitForLatestEmail Fetch inbox's latest email or if empty wait for email to arrive
wait_for_matching_email POST /waitForMatchingEmails Wait or return list of emails that match simple matching patterns
wait_for_nth_email GET /waitForNthEmail Wait for or fetch the email with a given index in the inbox specified

create_new_email_address

Inbox create_new_email_address()

Create new email address

Returns an Inbox with an id and an emailAddress

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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))

try:
    # Create new email address
    api_response = api_instance.create_new_email_address()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->create_new_email_address: %s\n" % e)

Parameters

This endpoint does not need any parameter.

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]

delete_email

delete_email(email_id)

Delete an email

Deletes an 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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))
email_id = 'email_id_example' # str | emailId

try:
    # Delete an email
    api_instance.delete_email(email_id)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->delete_email: %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_email_address

delete_email_address(inbox_id)

Delete email address and its emails

Deletes 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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | inboxId

try:
    # Delete email address and its emails
    api_instance.delete_email_address(inbox_id)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->delete_email_address: %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]

empty_inbox

empty_inbox(inbox_id)

Delete all emails in an inbox

Deletes all emails

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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | inboxId

try:
    # Delete all emails in an inbox
    api_instance.empty_inbox(inbox_id)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->empty_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]

send_email_simple

send_email_simple(send_email_options)

Send an email from a random email address

To specify an email address first create an inbox and use that with the other send email methods

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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))
send_email_options = mailslurp_client.SendEmailOptions() # SendEmailOptions | sendEmailOptions

try:
    # Send an email from a random email address
    api_instance.send_email_simple(send_email_options)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->send_email_simple: %s\n" % e)

Parameters

Name Type Description Notes
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]

wait_for_email_count

list[EmailPreview] wait_for_email_count(count=count, inbox_id=inbox_id, timeout=timeout)

Wait for and return count number of emails

Will only wait if count is greater that the found emails in given inbox.If you need to wait for an email for a non-empty inbox see the other receive methods.

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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))
count = 56 # int | Number of emails to wait for. Must be greater that 1 (optional)
inbox_id = 'inbox_id_example' # str | Id of the inbox we are fetching emails from (optional)
timeout = 56 # int | Max milliseconds to wait (optional)

try:
    # Wait for and return count number of emails 
    api_response = api_instance.wait_for_email_count(count=count, inbox_id=inbox_id, timeout=timeout)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->wait_for_email_count: %s\n" % e)

Parameters

Name Type Description Notes
count int Number of emails to wait for. Must be greater that 1 [optional]
inbox_id str Id of the inbox we are fetching emails from [optional]
timeout int Max milliseconds to wait [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]

wait_for_latest_email

Email wait_for_latest_email(inbox_id=inbox_id, timeout=timeout)

Fetch inbox's latest email or if empty wait for email to arrive

Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox see the other receive methods.

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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | Id of the inbox we are fetching emails from (optional)
timeout = 56 # int | Max milliseconds to wait (optional)

try:
    # Fetch inbox's latest email or if empty wait for email to arrive
    api_response = api_instance.wait_for_latest_email(inbox_id=inbox_id, timeout=timeout)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->wait_for_latest_email: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str Id of the inbox we are fetching emails from [optional]
timeout int Max milliseconds to wait [optional]

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]

wait_for_matching_email

list[EmailPreview] wait_for_matching_email(match_options, count=count, inbox_id=inbox_id, timeout=timeout)

Wait or return list of emails that match simple matching patterns

Results must also meet provided count. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM.

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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))
match_options = mailslurp_client.MatchOptions() # MatchOptions | matchOptions
count = 56 # int | Number of emails to wait for. Must be greater that 1 (optional)
inbox_id = 'inbox_id_example' # str | Id of the inbox we are fetching emails from (optional)
timeout = 56 # int | Max milliseconds to wait (optional)

try:
    # Wait or return list of emails that match simple matching patterns
    api_response = api_instance.wait_for_matching_email(match_options, count=count, inbox_id=inbox_id, timeout=timeout)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->wait_for_matching_email: %s\n" % e)

Parameters

Name Type Description Notes
match_options MatchOptions matchOptions
count int Number of emails to wait for. Must be greater that 1 [optional]
inbox_id str Id of the inbox we are fetching emails from [optional]
timeout int Max milliseconds to wait [optional]

Return type

list[EmailPreview]

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]

wait_for_nth_email

Email wait_for_nth_email(inbox_id=inbox_id, index=index, timeout=timeout)

Wait for or fetch the email with a given index in the inbox specified

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.CommonOperationsApi(mailslurp_client.ApiClient(configuration))
inbox_id = 'inbox_id_example' # str | Id of the inbox we are fetching emails from (optional)
index = 56 # int | Zero based index of the email to wait for (optional)
timeout = 56 # int | Max milliseconds to wait (optional)

try:
    # Wait for or fetch the email with a given index in the inbox specified
    api_response = api_instance.wait_for_nth_email(inbox_id=inbox_id, index=index, timeout=timeout)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommonOperationsApi->wait_for_nth_email: %s\n" % e)

Parameters

Name Type Description Notes
inbox_id str Id of the inbox we are fetching emails from [optional]
index int Zero based index of the email to wait for [optional]
timeout int Max milliseconds to wait [optional]

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]