Official MailSlurp Python SDK Email API
Project description
mailslurp-client
MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more.
Resources
- Homepage
- Get an API KEY
- Generated SDK Clients
- Examples repository
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 6.5.2
- Package version: 8.0.1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import mailslurp_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import mailslurp_client
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
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'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.AliasControllerApi(api_client)
create_owned_alias_options = mailslurp_client.CreateOwnedAliasOptions() # CreateOwnedAliasOptions | createOwnedAliasOptions
try:
# Create an email alias
api_instance.create_alias(create_owned_alias_options)
except ApiException as e:
print("Exception when calling AliasControllerApi->create_alias: %s
" % e)
Documentation for API Endpoints
All URIs are relative to https://api.mailslurp.com
Class | Method | HTTP request | Description |
---|---|---|---|
AliasControllerApi | create_alias | POST /aliases | Create an email alias |
AliasControllerApi | create_anonymous_alias | POST /aliases/anonymous | Create an anonymous email alias |
AliasControllerApi | delete_alias | DELETE /aliases/{aliasId} | Delete an owned alias |
AliasControllerApi | get_alias | GET /aliases/{aliasId} | Get an email alias |
AliasControllerApi | get_aliases | GET /aliases | Get all email aliases |
AliasControllerApi | update_alias | PUT /aliases/{aliasId} | Update an owned alias |
AttachmentControllerApi | upload_attachment | POST /attachments | Upload an attachment for sending |
AttachmentControllerApi | upload_multipart_form | POST /attachments/multipart | Upload an attachment for sending using Multipart Form |
BulkActionsControllerApi | bulk_create_inboxes | POST /bulk/inboxes | Bulk create Inboxes (email addresses) |
BulkActionsControllerApi | bulk_delete_inboxes | DELETE /bulk/inboxes | Bulk Delete Inboxes |
BulkActionsControllerApi | bulk_send_emails | POST /bulk/send | Bulk Send Emails |
CommonActionsControllerApi | create_new_email_address | POST /createInbox | Create new random inbox |
CommonActionsControllerApi | create_new_email_address1 | POST /newEmailAddress | Create new random inbox |
CommonActionsControllerApi | empty_inbox | DELETE /emptyInbox | Delete all emails in an inbox |
CommonActionsControllerApi | send_email_simple | POST /sendEmail | Send an email |
ContactControllerApi | create_contact | POST /contacts | Create a contact |
ContactControllerApi | delete_contact | DELETE /contacts/{contactId} | Delete contact |
ContactControllerApi | get_all_contacts | GET /contacts/paginated | Get all contacts |
ContactControllerApi | get_contact | GET /contacts/{contactId} | Get contact |
ContactControllerApi | get_contacts | GET /contacts | Get all contacts |
DomainControllerApi | create_domain | POST /domains | Create Domain |
DomainControllerApi | delete_domain | DELETE /domains/{id} | Delete a domain |
DomainControllerApi | get_domain | GET /domains/{id} | Get a domain |
DomainControllerApi | get_domains | GET /domains | Get domains |
EmailControllerApi | delete_all_emails | DELETE /emails | Delete all emails |
EmailControllerApi | delete_email | DELETE /emails/{emailId} | Delete an email |
EmailControllerApi | download_attachment | GET /emails/{emailId}/attachments/{attachmentId} | Get email attachment bytes |
EmailControllerApi | forward_email | POST /emails/{emailId}/forward | Forward email |
EmailControllerApi | get_attachment_meta_data | GET /emails/{emailId}/attachments/{attachmentId}/metadata | Get email attachment metadata |
EmailControllerApi | get_attachments | GET /emails/{emailId}/attachments | Get all email attachment metadata |
EmailControllerApi | get_email | GET /emails/{emailId} | Get email content |
EmailControllerApi | get_email_html | GET /emails/{emailId}/html | Get email content as HTML |
EmailControllerApi | get_emails_paginated | GET /emails | Get all emails |
EmailControllerApi | get_raw_email_contents | GET /emails/{emailId}/raw | Get raw email string |
EmailControllerApi | get_raw_email_json | GET /emails/{emailId}/raw/json | Get raw email in JSON |
EmailControllerApi | get_unread_email_count | GET /emails/unreadCount | Get unread email count |
EmailControllerApi | validate_email | POST /emails/{emailId}/validate | Validate email |
FormControllerApi | submit_form | POST /forms | Submit a form to be parsed and sent as an email to an address determined by the form fields |
GroupControllerApi | add_contacts_to_group | PUT /groups/{groupId}/contacts | Add contacts to a group |
GroupControllerApi | create_group | POST /groups | Create a group |
GroupControllerApi | delete_group | DELETE /groups/{groupId} | Delete group |
GroupControllerApi | get_all_groups | GET /groups/paginated | Get all Contact Groups in paginated format |
GroupControllerApi | get_group | GET /groups/{groupId} | Get group |
GroupControllerApi | get_group_with_contacts | GET /groups/{groupId}/contacts | Get group and contacts belonging to it |
GroupControllerApi | get_group_with_contacts_paginated | GET /groups/{groupId}/contacts-paginated | Get group and paginated contacts belonging to it |
GroupControllerApi | get_groups | GET /groups | Get all groups |
GroupControllerApi | remove_contacts_from_group | DELETE /groups/{groupId}/contacts | Remove contacts from a group |
InboxControllerApi | create_inbox | POST /inboxes | Create an Inbox (email address) |
InboxControllerApi | delete_all_inboxes | DELETE /inboxes | Delete all inboxes |
InboxControllerApi | delete_inbox | DELETE /inboxes/{inboxId} | Delete inbox |
InboxControllerApi | get_all_inboxes | GET /inboxes/paginated | List Inboxes Paginated |
InboxControllerApi | get_emails | GET /inboxes/{inboxId}/emails | Get emails in an Inbox |
InboxControllerApi | get_inbox | GET /inboxes/{inboxId} | Get Inbox |
InboxControllerApi | get_inbox_emails_paginated | GET /inboxes/{inboxId}/emails/paginated | Get inbox emails paginated |
InboxControllerApi | get_inbox_sent_emails | GET /inboxes/{inboxId}/sent | Get Inbox Sent Emails |
InboxControllerApi | get_inbox_tags | GET /inboxes/tags | Get inbox tags |
InboxControllerApi | get_inboxes | GET /inboxes | List Inboxes / Email Addresses |
InboxControllerApi | send_email | POST /inboxes/{inboxId} | Send Email |
InboxControllerApi | set_inbox_favourited | PUT /inboxes/{inboxId}/favourite | Set inbox favourited state |
InboxControllerApi | update_inbox | PATCH /inboxes/{inboxId} | Update Inbox |
MailServerControllerApi | describe_mail_server_domain | POST /mail-server/describe/domain | Get DNS Mail Server records for a domain |
MailServerControllerApi | verify_email_address | POST /mail-server/verify/email-address | Verify the existence of an email address at a given mail server. |
SentEmailsControllerApi | get_sent_email | GET /sent/{id} | Get sent email receipt |
SentEmailsControllerApi | get_sent_emails | GET /sent | Get all sent emails in paginated form |
TemplateControllerApi | create_template | POST /templates | Create a Template |
TemplateControllerApi | delete_template | DELETE /templates/{TemplateId} | Delete Template |
TemplateControllerApi | get_all_templates | GET /templates/paginated | Get all Templates in paginated format |
TemplateControllerApi | get_template | GET /templates/{TemplateId} | Get Template |
TemplateControllerApi | get_templates | GET /templates | Get all Templates |
WaitForControllerApi | wait_for | POST /waitFor | Wait for conditions to be met |
WaitForControllerApi | wait_for_email_count | GET /waitForEmailCount | Wait for and return count number of emails |
WaitForControllerApi | wait_for_latest_email | GET /waitForLatestEmail | Fetch inbox's latest email or if empty wait for an email to arrive |
WaitForControllerApi | wait_for_matching_email | POST /waitForMatchingEmails | Wait or return list of emails that match simple matching patterns |
WaitForControllerApi | wait_for_nth_email | GET /waitForNthEmail | Wait for or fetch the email with a given index in the inbox specified |
WebhookControllerApi | create_webhook | POST /inboxes/{inboxId}/webhooks | Attach a WebHook URL to an inbox |
WebhookControllerApi | delete_webhook | DELETE /inboxes/{inboxId}/webhooks/{webhookId} | Delete and disable a Webhook for an Inbox |
WebhookControllerApi | get_all_webhooks | GET /webhooks/paginated | List Webhooks Paginated |
WebhookControllerApi | get_webhook | GET /webhooks/{webhookId} | Get a webhook for an Inbox |
WebhookControllerApi | get_webhooks | GET /inboxes/{inboxId}/webhooks | Get all Webhooks for an Inbox |
WebhookControllerApi | send_test_data | POST /webhooks/{webhookId}/test | Send webhook test data |
Documentation For Models
- Alias
- AttachmentMetaData
- BasicAuthOptions
- BulkSendEmailOptions
- ContactDto
- ContactProjection
- CreateAnonymousAliasOptions
- CreateContactOptions
- CreateDomainOptions
- CreateGroupOptions
- CreateOwnedAliasOptions
- CreateTemplateOptions
- CreateWebhookOptions
- DescribeDomainOptions
- DescribeMailServerDomainResult
- DomainDto
- DomainPreview
- EmailAnalysis
- EmailPreview
- EmailProjection
- EmailVerificationResult
- ForwardEmailOptions
- GroupContactsDto
- GroupDto
- GroupProjection
- HTMLValidationResult
- Inbox
- InboxProjection
- MatchOption
- MatchOptions
- NameServerRecord
- PageAlias
- PageContactProjection
- PageEmailPreview
- PageEmailProjection
- PageGroupProjection
- PageInboxProjection
- PageSentEmailProjection
- PageTemplateProjection
- PageWebhookProjection
- Pageable
- RawEmailJson
- SendEmailOptions
- SentEmailDto
- SentEmailProjection
- SetInboxFavouritedOptions
- SimpleSendEmailOptions
- Sort
- TemplateDto
- TemplateProjection
- TemplateVariable
- UnreadCount
- UpdateGroupContacts
- UpdateInboxOptions
- UploadAttachmentOptions
- ValidationDto
- ValidationMessage
- VerifyEmailAddressOptions
- WaitForConditions
- WebhookDto
- WebhookProjection
- WebhookTestRequest
- WebhookTestResponse
- WebhookTestResult
Documentation For Authorization
API_KEY
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mailslurp_client-8.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a442d196523150cf65c6e3c7b64effa46574592a8522a6687411e8d4cec4a99f |
|
MD5 | 1ed76b8eeea488dfe93d2a3808179c2e |
|
BLAKE2b-256 | df907d6770cc5d532d6048a76286998c708489f461c0e98c80ed071b1349789f |