# MailSlurp Objective C 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

This ObjC package is automatically generated by the OpenAPI Generator (opens new window) project:

  • API version: 6.5.2
  • Package version:
  • Build package: org.openapitools.codegen.languages.ObjcClientCodegen

# Requirements

The SDK requires ARC (Automatic Reference Counting) (opens new window) to be enabled in the Xcode project.

# Installation & Usage

# Install from Github using CocoaPods (opens new window)

Add the following to the Podfile:

pod 'mailslurp', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

To specify a particular branch, append , :branch => 'branch-name-here'

To specify a particular commit, append , :commit => '11aa22'

# Install from local path using CocoaPods (opens new window)

Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/mailslurp) and then add the following to the Podfile:

pod 'mailslurp', :path => 'Vendor/mailslurp'

# Usage

Import the following:

#import <mailslurp/OAIApiClient.h>
#import <mailslurp/OAIDefaultConfiguration.h>
// load models
#import <mailslurp/OAIAlias.h>
#import <mailslurp/OAIAttachmentMetaData.h>
#import <mailslurp/OAIBasicAuthOptions.h>
#import <mailslurp/OAIBulkSendEmailOptions.h>
#import <mailslurp/OAIContactDto.h>
#import <mailslurp/OAIContactProjection.h>
#import <mailslurp/OAICreateAnonymousAliasOptions.h>
#import <mailslurp/OAICreateContactOptions.h>
#import <mailslurp/OAICreateDomainOptions.h>
#import <mailslurp/OAICreateGroupOptions.h>
#import <mailslurp/OAICreateOwnedAliasOptions.h>
#import <mailslurp/OAICreateTemplateOptions.h>
#import <mailslurp/OAICreateWebhookOptions.h>
#import <mailslurp/OAIDescribeDomainOptions.h>
#import <mailslurp/OAIDescribeMailServerDomainResult.h>
#import <mailslurp/OAIDomainDto.h>
#import <mailslurp/OAIDomainPreview.h>
#import <mailslurp/OAIEmail.h>
#import <mailslurp/OAIEmailAnalysis.h>
#import <mailslurp/OAIEmailPreview.h>
#import <mailslurp/OAIEmailProjection.h>
#import <mailslurp/OAIEmailVerificationResult.h>
#import <mailslurp/OAIForwardEmailOptions.h>
#import <mailslurp/OAIGroupContactsDto.h>
#import <mailslurp/OAIGroupDto.h>
#import <mailslurp/OAIGroupProjection.h>
#import <mailslurp/OAIHTMLValidationResult.h>
#import <mailslurp/OAIInbox.h>
#import <mailslurp/OAIInboxProjection.h>
#import <mailslurp/OAIMatchOption.h>
#import <mailslurp/OAIMatchOptions.h>
#import <mailslurp/OAINameServerRecord.h>
#import <mailslurp/OAIPageAlias.h>
#import <mailslurp/OAIPageContactProjection.h>
#import <mailslurp/OAIPageEmailPreview.h>
#import <mailslurp/OAIPageEmailProjection.h>
#import <mailslurp/OAIPageGroupProjection.h>
#import <mailslurp/OAIPageInboxProjection.h>
#import <mailslurp/OAIPageSentEmailProjection.h>
#import <mailslurp/OAIPageTemplateProjection.h>
#import <mailslurp/OAIPageWebhookProjection.h>
#import <mailslurp/OAIPageable.h>
#import <mailslurp/OAIRawEmailJson.h>
#import <mailslurp/OAISendEmailOptions.h>
#import <mailslurp/OAISentEmailDto.h>
#import <mailslurp/OAISentEmailProjection.h>
#import <mailslurp/OAISetInboxFavouritedOptions.h>
#import <mailslurp/OAISimpleSendEmailOptions.h>
#import <mailslurp/OAISort.h>
#import <mailslurp/OAITemplateDto.h>
#import <mailslurp/OAITemplateProjection.h>
#import <mailslurp/OAITemplateVariable.h>
#import <mailslurp/OAIUnreadCount.h>
#import <mailslurp/OAIUpdateGroupContacts.h>
#import <mailslurp/OAIUpdateInboxOptions.h>
#import <mailslurp/OAIUploadAttachmentOptions.h>
#import <mailslurp/OAIValidationDto.h>
#import <mailslurp/OAIValidationMessage.h>
#import <mailslurp/OAIVerifyEmailAddressOptions.h>
#import <mailslurp/OAIWaitForConditions.h>
#import <mailslurp/OAIWebhookDto.h>
#import <mailslurp/OAIWebhookProjection.h>
#import <mailslurp/OAIWebhookTestRequest.h>
#import <mailslurp/OAIWebhookTestResponse.h>
#import <mailslurp/OAIWebhookTestResult.h>
// load API classes for accessing endpoints
#import <mailslurp/OAIAliasControllerApi.h>
#import <mailslurp/OAIAttachmentControllerApi.h>
#import <mailslurp/OAIBulkActionsControllerApi.h>
#import <mailslurp/OAICommonActionsControllerApi.h>
#import <mailslurp/OAIContactControllerApi.h>
#import <mailslurp/OAIDomainControllerApi.h>
#import <mailslurp/OAIEmailControllerApi.h>
#import <mailslurp/OAIFormControllerApi.h>
#import <mailslurp/OAIGroupControllerApi.h>
#import <mailslurp/OAIInboxControllerApi.h>
#import <mailslurp/OAIMailServerControllerApi.h>
#import <mailslurp/OAISentEmailsControllerApi.h>
#import <mailslurp/OAITemplateControllerApi.h>
#import <mailslurp/OAIWaitForControllerApi.h>
#import <mailslurp/OAIWebhookControllerApi.h>

# Recommendation

It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues.

# Getting Started

Please follow the installation procedure and then run the following:


OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig];
// Configure API key authorization: (authentication scheme: API_KEY)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-api-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-api-key"];
OAICreateOwnedAliasOptions* *createOwnedAliasOptions = [[OAICreateOwnedAliasOptions alloc] init]; // createOwnedAliasOptions
OAIAliasControllerApi *apiInstance = [[OAIAliasControllerApi alloc] init];
// Create an email alias
[apiInstance createAliasWithCreateOwnedAliasOptions:createOwnedAliasOptions
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

# Documentation for API Endpoints

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

Class Method HTTP request Description
OAIAliasControllerApi createAlias POST /aliases Create an email alias
OAIAliasControllerApi createAnonymousAlias POST /aliases/anonymous Create an anonymous email alias
OAIAliasControllerApi deleteAlias DELETE /aliases/{aliasId} Delete an owned alias
OAIAliasControllerApi getAlias GET /aliases/{aliasId} Get an email alias
OAIAliasControllerApi getAliases GET /aliases Get all email aliases
OAIAliasControllerApi updateAlias PUT /aliases/{aliasId} Update an owned alias
OAIAttachmentControllerApi uploadAttachment POST /attachments Upload an attachment for sending
OAIAttachmentControllerApi uploadMultipartForm POST /attachments/multipart Upload an attachment for sending using Multipart Form
OAIBulkActionsControllerApi bulkCreateInboxes POST /bulk/inboxes Bulk create Inboxes (email addresses)
OAIBulkActionsControllerApi bulkDeleteInboxes DELETE /bulk/inboxes Bulk Delete Inboxes
OAIBulkActionsControllerApi bulkSendEmails POST /bulk/send Bulk Send Emails
OAICommonActionsControllerApi createNewEmailAddress POST /createInbox Create new random inbox
OAICommonActionsControllerApi createNewEmailAddress1 POST /newEmailAddress Create new random inbox
OAICommonActionsControllerApi emptyInbox DELETE /emptyInbox Delete all emails in an inbox
OAICommonActionsControllerApi sendEmailSimple POST /sendEmail Send an email
OAIContactControllerApi createContact POST /contacts Create a contact
OAIContactControllerApi deleteContact DELETE /contacts/{contactId} Delete contact
OAIContactControllerApi getAllContacts GET /contacts/paginated Get all contacts
OAIContactControllerApi getContact GET /contacts/{contactId} Get contact
OAIContactControllerApi getContacts GET /contacts Get all contacts
OAIDomainControllerApi createDomain POST /domains Create Domain
OAIDomainControllerApi deleteDomain DELETE /domains/{id} Delete a domain
OAIDomainControllerApi getDomain GET /domains/{id} Get a domain
OAIDomainControllerApi getDomains GET /domains Get domains
OAIEmailControllerApi deleteAllEmails DELETE /emails Delete all emails
OAIEmailControllerApi deleteEmail DELETE /emails/{emailId} Delete an email
OAIEmailControllerApi downloadAttachment GET /emails/{emailId}/attachments/{attachmentId} Get email attachment bytes
OAIEmailControllerApi forwardEmail POST /emails/{emailId}/forward Forward email
OAIEmailControllerApi getAttachmentMetaData GET /emails/{emailId}/attachments/{attachmentId}/metadata Get email attachment metadata
OAIEmailControllerApi getAttachments GET /emails/{emailId}/attachments Get all email attachment metadata
OAIEmailControllerApi getEmail GET /emails/{emailId} Get email content
OAIEmailControllerApi getEmailHTML GET /emails/{emailId}/html Get email content as HTML
OAIEmailControllerApi getEmailsPaginated GET /emails Get all emails
OAIEmailControllerApi getRawEmailContents GET /emails/{emailId}/raw Get raw email string
OAIEmailControllerApi getRawEmailJson GET /emails/{emailId}/raw/json Get raw email in JSON
OAIEmailControllerApi getUnreadEmailCount GET /emails/unreadCount Get unread email count
OAIEmailControllerApi validateEmail POST /emails/{emailId}/validate Validate email
OAIFormControllerApi submitForm POST /forms Submit a form to be parsed and sent as an email to an address determined by the form fields
OAIGroupControllerApi addContactsToGroup PUT /groups/{groupId}/contacts Add contacts to a group
OAIGroupControllerApi createGroup POST /groups Create a group
OAIGroupControllerApi deleteGroup DELETE /groups/{groupId} Delete group
OAIGroupControllerApi getAllGroups GET /groups/paginated Get all Contact Groups in paginated format
OAIGroupControllerApi getGroup GET /groups/{groupId} Get group
OAIGroupControllerApi getGroupWithContacts GET /groups/{groupId}/contacts Get group and contacts belonging to it
OAIGroupControllerApi getGroupWithContactsPaginated GET /groups/{groupId}/contacts-paginated Get group and paginated contacts belonging to it
OAIGroupControllerApi getGroups GET /groups Get all groups
OAIGroupControllerApi removeContactsFromGroup DELETE /groups/{groupId}/contacts Remove contacts from a group
OAIInboxControllerApi createInbox POST /inboxes Create an Inbox (email address)
OAIInboxControllerApi deleteAllInboxes DELETE /inboxes Delete all inboxes
OAIInboxControllerApi deleteInbox DELETE /inboxes/{inboxId} Delete inbox
OAIInboxControllerApi getAllInboxes GET /inboxes/paginated List Inboxes Paginated
OAIInboxControllerApi getEmails GET /inboxes/{inboxId}/emails Get emails in an Inbox
OAIInboxControllerApi getInbox GET /inboxes/{inboxId} Get Inbox
OAIInboxControllerApi getInboxEmailsPaginated GET /inboxes/{inboxId}/emails/paginated Get inbox emails paginated
OAIInboxControllerApi getInboxSentEmails GET /inboxes/{inboxId}/sent Get Inbox Sent Emails
OAIInboxControllerApi getInboxTags GET /inboxes/tags Get inbox tags
OAIInboxControllerApi getInboxes GET /inboxes List Inboxes / Email Addresses
OAIInboxControllerApi sendEmail POST /inboxes/{inboxId} Send Email
OAIInboxControllerApi setInboxFavourited PUT /inboxes/{inboxId}/favourite Set inbox favourited state
OAIInboxControllerApi updateInbox PATCH /inboxes/{inboxId} Update Inbox
OAIMailServerControllerApi describeMailServerDomain POST /mail-server/describe/domain Get DNS Mail Server records for a domain
OAIMailServerControllerApi verifyEmailAddress POST /mail-server/verify/email-address Verify the existence of an email address at a given mail server.
OAISentEmailsControllerApi getSentEmail GET /sent/{id} Get sent email receipt
OAISentEmailsControllerApi getSentEmails GET /sent Get all sent emails in paginated form
OAITemplateControllerApi createTemplate POST /templates Create a Template
OAITemplateControllerApi deleteTemplate DELETE /templates/{TemplateId} Delete Template
OAITemplateControllerApi getAllTemplates GET /templates/paginated Get all Templates in paginated format
OAITemplateControllerApi getTemplate GET /templates/{TemplateId} Get Template
OAITemplateControllerApi getTemplates GET /templates Get all Templates
OAIWaitForControllerApi waitFor POST /waitFor Wait for conditions to be met
OAIWaitForControllerApi waitForEmailCount GET /waitForEmailCount Wait for and return count number of emails
OAIWaitForControllerApi waitForLatestEmail GET /waitForLatestEmail Fetch inbox's latest email or if empty wait for an email to arrive
OAIWaitForControllerApi waitForMatchingEmail POST /waitForMatchingEmails Wait or return list of emails that match simple matching patterns
OAIWaitForControllerApi waitForNthEmail GET /waitForNthEmail Wait for or fetch the email with a given index in the inbox specified
OAIWebhookControllerApi createWebhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
OAIWebhookControllerApi deleteWebhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a Webhook for an Inbox
OAIWebhookControllerApi getAllWebhooks GET /webhooks/paginated List Webhooks Paginated
OAIWebhookControllerApi getWebhook GET /webhooks/{webhookId} Get a webhook for an Inbox
OAIWebhookControllerApi getWebhooks GET /inboxes/{inboxId}/webhooks Get all Webhooks for an Inbox
OAIWebhookControllerApi sendTestData POST /webhooks/{webhookId}/test Send webhook test data

# Documentation For Models

# Documentation For Authorization

# API_KEY

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header