OAICommonOperationsApi

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

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

createNewEmailAddress

-(NSURLSessionTask*) createNewEmailAddressWithCompletionHandler: 
        (void (^)(OAIInbox* output, NSError* error)) handler;

Create new email address

Returns an Inbox with an id and an emailAddress

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



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

// Create new email address
[apiInstance createNewEmailAddressWithCompletionHandler: 
          ^(OAIInbox* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->createNewEmailAddress: %@", error);
                        }
                    }];

Parameters

This endpoint does not need any parameter.

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]

deleteEmail

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

Delete an email

Deletes an 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

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

// Delete an email
[apiInstance deleteEmailWithEmailId:emailId
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->deleteEmail: %@", 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]

deleteEmailAddress

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

Delete email address and its emails

Deletes 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

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

// Delete email address and its emails
[apiInstance deleteEmailAddressWithInboxId:inboxId
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->deleteEmailAddress: %@", 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]

emptyInbox

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

Delete all emails in an inbox

Deletes all emails

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

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

// Delete all emails in an inbox
[apiInstance emptyInboxWithInboxId:inboxId
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->emptyInbox: %@", 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]

sendEmailSimple

-(NSURLSessionTask*) sendEmailSimpleWithSendEmailOptions: (OAISendEmailOptions*) sendEmailOptions
        completionHandler: (void (^)(NSError* error)) handler;

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

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


OAISendEmailOptions* sendEmailOptions = [[OAISendEmailOptions alloc] init]; // sendEmailOptions

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

// Send an email from a random email address
[apiInstance sendEmailSimpleWithSendEmailOptions:sendEmailOptions
          completionHandler: ^(NSError* error) {
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->sendEmailSimple: %@", error);
                        }
                    }];

Parameters

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

waitForEmailCount

-(NSURLSessionTask*) waitForEmailCountWithCount: (NSNumber*) count
    inboxId: (NSString*) inboxId
    timeout: (NSNumber*) timeout
        completionHandler: (void (^)(NSArray* output, NSError* error)) handler;

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

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 emails to wait for. Must be greater that 1 (optional)
NSString* inboxId = @"inboxId_example"; // Id of the inbox we are fetching emails from (optional)
NSNumber* timeout = @56; // Max milliseconds to wait (optional)

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

// Wait for and return count number of emails 
[apiInstance waitForEmailCountWithCount:count
              inboxId:inboxId
              timeout:timeout
          completionHandler: ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->waitForEmailCount: %@", error);
                        }
                    }];

Parameters

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

waitForLatestEmail

-(NSURLSessionTask*) waitForLatestEmailWithInboxId: (NSString*) inboxId
    timeout: (NSNumber*) timeout
        completionHandler: (void (^)(OAIEmail* output, NSError* error)) handler;

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

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 the inbox we are fetching emails from (optional)
NSNumber* timeout = @56; // Max milliseconds to wait (optional)

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

// Fetch inbox's latest email or if empty wait for email to arrive
[apiInstance waitForLatestEmailWithInboxId:inboxId
              timeout:timeout
          completionHandler: ^(OAIEmail* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->waitForLatestEmail: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
inboxId NSString* Id of the inbox we are fetching emails from [optional]
timeout NSNumber* Max milliseconds to wait [optional]

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]

waitForMatchingEmail

-(NSURLSessionTask*) waitForMatchingEmailWithMatchOptions: (OAIMatchOptions*) matchOptions
    count: (NSNumber*) count
    inboxId: (NSString*) inboxId
    timeout: (NSNumber*) timeout
        completionHandler: (void (^)(NSArray* output, NSError* error)) handler;

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

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


OAIMatchOptions* matchOptions = [[OAIMatchOptions alloc] init]; // matchOptions
NSNumber* count = @56; // Number of emails to wait for. Must be greater that 1 (optional)
NSString* inboxId = @"inboxId_example"; // Id of the inbox we are fetching emails from (optional)
NSNumber* timeout = @56; // Max milliseconds to wait (optional)

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

// Wait or return list of emails that match simple matching patterns
[apiInstance waitForMatchingEmailWithMatchOptions:matchOptions
              count:count
              inboxId:inboxId
              timeout:timeout
          completionHandler: ^(NSArray* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->waitForMatchingEmail: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
matchOptions OAIMatchOptions* matchOptions
count NSNumber* Number of emails to wait for. Must be greater that 1 [optional]
inboxId NSString* Id of the inbox we are fetching emails from [optional]
timeout NSNumber* Max milliseconds to wait [optional]

Return type

NSArray*

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]

waitForNthEmail

-(NSURLSessionTask*) waitForNthEmailWithInboxId: (NSString*) inboxId
    index: (NSNumber*) index
    timeout: (NSNumber*) timeout
        completionHandler: (void (^)(OAIEmail* output, NSError* error)) handler;

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

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 the inbox we are fetching emails from (optional)
NSNumber* index = @56; // Zero based index of the email to wait for (optional)
NSNumber* timeout = @56; // Max milliseconds to wait (optional)

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

// Wait for or fetch the email with a given index in the inbox specified
[apiInstance waitForNthEmailWithInboxId:inboxId
              index:index
              timeout:timeout
          completionHandler: ^(OAIEmail* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling OAICommonOperationsApi->waitForNthEmail: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
inboxId NSString* Id of the inbox we are fetching emails from [optional]
index NSNumber* Zero based index of the email to wait for [optional]
timeout NSNumber* Max milliseconds to wait [optional]

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]