iOS Documentation

Send and receive emails from iOS applications. Create test email accounts with ObjectiveC email SDK.

OAIExtraOperationsApi

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

Method HTTP request Description
bulkCreateInboxes POST /bulk/inboxes Bulk create Inboxes (email addresses)
bulkDeleteInboxes DELETE /bulk/inboxes Bulk Delete Inboxes
bulkSendEmails POST /bulk/send Bulk Send Emails
createDomain POST /domains Create Domain
createInbox POST /inboxes Create an Inbox (email address)
createWebhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
deleteDomain DELETE /domains/{id} Delete a domain
deleteEmail1 DELETE /emails/{emailId} Delete Email
deleteInbox DELETE /inboxes/{inboxId} Delete Inbox / Email Address
deleteWebhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a WebHook for an Inbox
downloadAttachment GET /emails/{emailId}/attachments/{attachmentId} Get email attachment
forwardEmail POST /emails/{emailId}/forward Forward Email
getDomain GET /domains/{id} Get a domain
getDomains GET /domains Get domains
getEmail GET /emails/{emailId} Get Email Content
getEmails GET /inboxes/{inboxId}/emails List Emails in an Inbox / EmailAddress
getEmailsPaginated GET /emails Get all emails
getInbox GET /inboxes/{inboxId} Get Inbox / EmailAddress
getInboxes GET /inboxes List Inboxes / Email Addresses
getRawEmailContents GET /emails/{emailId}/raw Get Raw Email Content
getWebhooks GET /inboxes/{inboxId}/webhooks Get all WebHooks for an Inbox
sendEmail POST /inboxes/{inboxId} Send Email
uploadAttachment POST /attachments Upload an attachment for sending
uploadMultipartForm POST /attachments/multipart Upload an attachment for sending using Multipart Form

bulkCreateInboxes

-(NSURLSessionTask*) bulkCreateInboxesWithCount: (NSNumber*) count
        completionHandler: (void (^)(NSArray* output, NSError* error)) handler;

Bulk create Inboxes (email addresses)

Enterprise Plan Required

Example

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"];


NSNumber* count = @56; // Number of inboxes to be created in bulk

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Bulk create Inboxes (email addresses)
[apiInstance bulkCreateInboxesWithCount:count
          completionHandler: ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->bulkCreateInboxes: %@", error);
                        }
                    }];

Parameters

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

Return type

NSArray*

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]

bulkDeleteInboxes

-(NSURLSessionTask*) bulkDeleteInboxesWithRequestBody: (NSArray*) requestBody
        completionHandler: (void (^)(NSError* error)) handler;

Bulk Delete Inboxes

Enterprise Plan Required

Example

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"];


NSArray* requestBody = @[[[NSArray alloc] init]]; // ids

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Bulk Delete Inboxes
[apiInstance bulkDeleteInboxesWithRequestBody:requestBody
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->bulkDeleteInboxes: %@", error);
                        }
                    }];

Parameters

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

bulkSendEmails

-(NSURLSessionTask*) bulkSendEmailsWithBulkSendEmailOptions: (OAIBulkSendEmailOptions*) bulkSendEmailOptions
        completionHandler: (void (^)(NSError* error)) handler;

Bulk Send Emails

Enterprise Plan Required

Example

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"];


OAIBulkSendEmailOptions* bulkSendEmailOptions = [[OAIBulkSendEmailOptions alloc] init]; // bulkSendEmailOptions

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Bulk Send Emails
[apiInstance bulkSendEmailsWithBulkSendEmailOptions:bulkSendEmailOptions
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->bulkSendEmails: %@", error);
                        }
                    }];

Parameters

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

createDomain

-(NSURLSessionTask*) createDomainWithCreateDomainOptions: (OAICreateDomainOptions*) createDomainOptions
        completionHandler: (void (^)(OAIDomainPlusVerificationRecordsAndStatus* output, NSError* error)) handler;

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

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"];


OAICreateDomainOptions* createDomainOptions = [[OAICreateDomainOptions alloc] init]; // domainOptions

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Create Domain
[apiInstance createDomainWithCreateDomainOptions:createDomainOptions
          completionHandler: ^(OAIDomainPlusVerificationRecordsAndStatus* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->createDomain: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
createDomainOptions OAICreateDomainOptions* domainOptions

Return type

OAIDomainPlusVerificationRecordsAndStatus*

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]

createInbox

-(NSURLSessionTask*) createInboxWithEmailAddress: (NSString*) emailAddress
        completionHandler: (void (^)(OAIInbox* output, NSError* error)) handler;

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

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"];


NSString* emailAddress = @"emailAddress_example"; // 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)

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Create an Inbox (email address)
[apiInstance createInboxWithEmailAddress:emailAddress
          completionHandler: ^(OAIInbox* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->createInbox: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
emailAddress NSString* 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

OAIInbox*

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]

createWebhook

-(NSURLSessionTask*) createWebhookWithInboxId: (NSString*) inboxId
    createWebhookOptions: (OAICreateWebhookOptions*) createWebhookOptions
        completionHandler: (void (^)(OAIWebhook* output, NSError* error)) handler;

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

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"];


NSString* inboxId = @"inboxId_example"; // inboxId
OAICreateWebhookOptions* createWebhookOptions = [[OAICreateWebhookOptions alloc] init]; // webhookOptions

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Attach a WebHook URL to an inbox
[apiInstance createWebhookWithInboxId:inboxId
              createWebhookOptions:createWebhookOptions
          completionHandler: ^(OAIWebhook* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->createWebhook: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
inboxId NSString* inboxId
createWebhookOptions OAICreateWebhookOptions* webhookOptions

Return type

OAIWebhook*

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]

deleteDomain

-(NSURLSessionTask*) deleteDomainWithId: (NSString*) _id
        completionHandler: (void (^)(NSError* error)) handler;

Delete a domain

Example

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"];


NSString* _id = @"_id_example"; // id

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Delete a domain
[apiInstance deleteDomainWithId:_id
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->deleteDomain: %@", error);
                        }
                    }];

Parameters

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

deleteEmail1

-(NSURLSessionTask*) deleteEmail1WithEmailId: (NSString*) emailId
        completionHandler: (void (^)(NSError* error)) handler;

Delete Email

Deletes an email and removes it from the inbox

Example

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"];


NSString* emailId = @"emailId_example"; // emailId

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Delete Email
[apiInstance deleteEmail1WithEmailId:emailId
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->deleteEmail1: %@", error);
                        }
                    }];

Parameters

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

deleteInbox

-(NSURLSessionTask*) deleteInboxWithInboxId: (NSString*) inboxId
        completionHandler: (void (^)(NSError* error)) handler;

Delete Inbox / Email Address

Permanently delete an inbox and associated email address

Example

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"];


NSString* inboxId = @"inboxId_example"; // inboxId

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Delete Inbox / Email Address
[apiInstance deleteInboxWithInboxId:inboxId
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->deleteInbox: %@", error);
                        }
                    }];

Parameters

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

deleteWebhook

-(NSURLSessionTask*) deleteWebhookWithInboxId: (NSString*) inboxId
    webhookId: (NSString*) webhookId
        completionHandler: (void (^)(NSError* error)) handler;

Delete and disable a WebHook for an Inbox

Example

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"];


NSString* inboxId = @"inboxId_example"; // inboxId
NSString* webhookId = @"webhookId_example"; // webhookId

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Delete and disable a WebHook for an Inbox
[apiInstance deleteWebhookWithInboxId:inboxId
              webhookId:webhookId
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->deleteWebhook: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
inboxId NSString* inboxId
webhookId NSString* 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]

downloadAttachment

-(NSURLSessionTask*) downloadAttachmentWithAttachmentId: (NSString*) attachmentId
    emailId: (NSString*) emailId
    apiKey: (NSString*) apiKey
        completionHandler: (void (^)(NSError* error)) handler;

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

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"];


NSString* attachmentId = @"attachmentId_example"; // attachmentId
NSString* emailId = @"emailId_example"; // emailId
NSString* apiKey = @"apiKey_example"; // Can pass apiKey in url for this request if you wish to download the file in a browser (optional)

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Get email attachment
[apiInstance downloadAttachmentWithAttachmentId:attachmentId
              emailId:emailId
              apiKey:apiKey
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->downloadAttachment: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
attachmentId NSString* attachmentId
emailId NSString* emailId
apiKey NSString* 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]

forwardEmail

-(NSURLSessionTask*) forwardEmailWithEmailId: (NSString*) emailId
    forwardEmailOptions: (OAIForwardEmailOptions*) forwardEmailOptions
        completionHandler: (void (^)(NSError* error)) handler;

Forward Email

Forward email content to given recipients

Example

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"];


NSString* emailId = @"emailId_example"; // emailId
OAIForwardEmailOptions* forwardEmailOptions = [[OAIForwardEmailOptions alloc] init]; // forwardEmailOptions

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Forward Email
[apiInstance forwardEmailWithEmailId:emailId
              forwardEmailOptions:forwardEmailOptions
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->forwardEmail: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
emailId NSString* emailId
forwardEmailOptions OAIForwardEmailOptions* 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]

getDomain

-(NSURLSessionTask*) getDomainWithId: (NSString*) _id
        completionHandler: (void (^)(OAIDomainPlusVerificationRecordsAndStatus* output, NSError* error)) handler;

Get a domain

Returns domain verification status and tokens

Example

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"];


NSString* _id = @"_id_example"; // id

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Get a domain
[apiInstance getDomainWithId:_id
          completionHandler: ^(OAIDomainPlusVerificationRecordsAndStatus* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getDomain: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
_id NSString* id

Return type

OAIDomainPlusVerificationRecordsAndStatus*

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]

getDomains

-(NSURLSessionTask*) getDomainsWithCompletionHandler: 
        (void (^)(NSArray* output, NSError* error)) handler;

Get domains

Example

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"];



OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Get domains
[apiInstance getDomainsWithCompletionHandler: 
          ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getDomains: %@", error);
                        }
                    }];

Parameters

This endpoint does not need any parameter.

Return type

NSArray*

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]

getEmail

-(NSURLSessionTask*) getEmailWithEmailId: (NSString*) emailId
        completionHandler: (void (^)(OAIEmail* output, NSError* error)) handler;

Get Email Content

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

Example

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"];


NSString* emailId = @"emailId_example"; // emailId

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Get Email Content
[apiInstance getEmailWithEmailId:emailId
          completionHandler: ^(OAIEmail* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getEmail: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
emailId NSString* emailId

Return type

OAIEmail*

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]

getEmails

-(NSURLSessionTask*) getEmailsWithInboxId: (NSString*) inboxId
    limit: (NSNumber*) limit
    minCount: (NSNumber*) minCount
    retryTimeout: (NSNumber*) retryTimeout
    since: (NSDate*) since
        completionHandler: (void (^)(NSArray* output, NSError* error)) handler;

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

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"];


NSString* inboxId = @"inboxId_example"; // Id of inbox that emails belongs to
NSNumber* limit = @56; // Limit the result set, ordered by descending received date time (optional)
NSNumber* minCount = @56; // Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional)
NSNumber* retryTimeout = @56; // Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional)
NSDate* since = @"2013-10-20T19:20:30+01:00"; // Exclude emails received before this ISO 8601 date time (optional)

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// List Emails in an Inbox / EmailAddress
[apiInstance getEmailsWithInboxId:inboxId
              limit:limit
              minCount:minCount
              retryTimeout:retryTimeout
              since:since
          completionHandler: ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getEmails: %@", error);
                        }
                    }];

Parameters

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

Return type

NSArray*

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]

getEmailsPaginated

-(NSURLSessionTask*) getEmailsPaginatedWithPage: (NSNumber*) page
    size: (NSNumber*) size
        completionHandler: (void (^)(OAIPageEmailProjection* output, NSError* error)) handler;

Get all emails

Responses are paginated

Example

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"];


NSNumber* page = @0; // Optional page index in email list pagination (optional) (default to @0)
NSNumber* size = @20; // Optional page size in email list pagination (optional) (default to @20)

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Get all emails
[apiInstance getEmailsPaginatedWithPage:page
              size:size
          completionHandler: ^(OAIPageEmailProjection* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getEmailsPaginated: %@", error);
                        }
                    }];

Parameters

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

Return type

OAIPageEmailProjection*

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]

getInbox

-(NSURLSessionTask*) getInboxWithInboxId: (NSString*) inboxId
        completionHandler: (void (^)(OAIInbox* output, NSError* error)) handler;

Get Inbox / EmailAddress

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

Example

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"];


NSString* inboxId = @"inboxId_example"; // inboxId

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Get Inbox / EmailAddress
[apiInstance getInboxWithInboxId:inboxId
          completionHandler: ^(OAIInbox* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getInbox: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
inboxId NSString* inboxId

Return type

OAIInbox*

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]

getInboxes

-(NSURLSessionTask*) getInboxesWithCompletionHandler: 
        (void (^)(NSArray* output, NSError* error)) handler;

List Inboxes / Email Addresses

List the inboxes you have created

Example

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"];



OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// List Inboxes / Email Addresses
[apiInstance getInboxesWithCompletionHandler: 
          ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getInboxes: %@", error);
                        }
                    }];

Parameters

This endpoint does not need any parameter.

Return type

NSArray*

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]

getRawEmailContents

-(NSURLSessionTask*) getRawEmailContentsWithEmailId: (NSString*) emailId
        completionHandler: (void (^)(NSString* output, NSError* error)) handler;

Get Raw Email Content

Returns a raw, unparsed and unprocessed email

Example

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"];


NSString* emailId = @"emailId_example"; // emailId

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Get Raw Email Content
[apiInstance getRawEmailContentsWithEmailId:emailId
          completionHandler: ^(NSString* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getRawEmailContents: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
emailId NSString* emailId

Return type

NSString*

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]

getWebhooks

-(NSURLSessionTask*) getWebhooksWithInboxId: (NSString*) inboxId
        completionHandler: (void (^)(NSArray* output, NSError* error)) handler;

Get all WebHooks for an Inbox

Example

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"];


NSString* inboxId = @"inboxId_example"; // inboxId

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Get all WebHooks for an Inbox
[apiInstance getWebhooksWithInboxId:inboxId
          completionHandler: ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->getWebhooks: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
inboxId NSString* inboxId

Return type

NSArray*

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]

sendEmail

-(NSURLSessionTask*) sendEmailWithInboxId: (NSString*) inboxId
    sendEmailOptions: (OAISendEmailOptions*) sendEmailOptions
        completionHandler: (void (^)(NSError* error)) handler;

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

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"];


NSString* inboxId = @"inboxId_example"; // inboxId
OAISendEmailOptions* sendEmailOptions = [[OAISendEmailOptions alloc] init]; // sendEmailOptions

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Send Email
[apiInstance sendEmailWithInboxId:inboxId
              sendEmailOptions:sendEmailOptions
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->sendEmail: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
inboxId NSString* inboxId
sendEmailOptions OAISendEmailOptions* 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]

uploadAttachment

-(NSURLSessionTask*) uploadAttachmentWithUploadAttachmentOptions: (OAIUploadAttachmentOptions*) uploadAttachmentOptions
        completionHandler: (void (^)(NSArray* output, NSError* error)) handler;

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

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"];


OAIUploadAttachmentOptions* uploadAttachmentOptions = [[OAIUploadAttachmentOptions alloc] init]; // uploadOptions

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Upload an attachment for sending
[apiInstance uploadAttachmentWithUploadAttachmentOptions:uploadAttachmentOptions
          completionHandler: ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->uploadAttachment: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
uploadAttachmentOptions OAIUploadAttachmentOptions* uploadOptions

Return type

NSArray<NSString>

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]

uploadMultipartForm

-(NSURLSessionTask*) uploadMultipartFormWithFile: (NSURL*) file
    contentType: (NSString*) contentType
    filename: (NSString*) filename
        completionHandler: (void (^)(NSArray* output, NSError* error)) handler;

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

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"];


NSURL* file = [NSURL fileURLWithPath:@"/path/to/file"]; // file
NSString* contentType = @"contentType_example"; // contentType (optional)
NSString* filename = @"filename_example"; // filename (optional)

OAIExtraOperationsApi*apiInstance = [[OAIExtraOperationsApi alloc] init];

// Upload an attachment for sending using Multipart Form
[apiInstance uploadMultipartFormWithFile:file
              contentType:contentType
              filename:filename
          completionHandler: ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAIExtraOperationsApi->uploadMultipartForm: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
file NSURL***NSURL*** file
contentType NSString* contentType [optional]
filename NSString* filename [optional]

Return type

NSArray<NSString>

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]