Load the API package

import 'package:mailslurp/api.dart';

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

MethodHTTP requestDescription
waitForPOST /waitForWait for an email to match the provided filter conditions such as subject contains keyword.
waitForEmailCountGET /waitForEmailCountWait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs
waitForLatestEmailGET /waitForLatestEmailFetch inbox’s latest email or if empty wait for an email to arrive
waitForMatchingEmailsPOST /waitForMatchingEmailsWait or return list of emails that match simple matching patterns
waitForMatchingFirstEmailPOST /waitForMatchingFirstEmailWait for or return the first email that matches provided MatchOptions array
waitForNthEmailGET /waitForNthEmailWait for or fetch the email with a given in the inbox specified. If doesn’t exist waits for it to exist or timeout to occur.

List waitFor(waitForConditions)

Wait for an email to match the provided filter conditions such as subject contains keyword.

Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = WaitForControllerApi();
final waitForConditions = WaitForConditions(); // WaitForConditions | 

try { 
    final result = api_instance.waitFor(waitForConditions);
    print(result);
} catch (e) {
    print('Exception when calling WaitForControllerApi->waitFor: $en');
}

Parameters

NameTypeDescriptionNotes
waitForConditionsWaitForConditions

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

List waitForEmailCount(inboxId, count, timeout, unreadOnly, before, since, sort, delay)

Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs

If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded.

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = WaitForControllerApi();
final inboxId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Id of the inbox we are fetching emails from
final count = 56; // int | Number of emails to wait for. Must be greater that 1
final timeout = 789; // int | Max milliseconds to wait
final unreadOnly = true; // bool | Optional filter for unread only
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received before the given timestamp
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received after the given timestamp
final sort = sort_example; // String | Sort direction
final delay = 789; // int | Max milliseconds delay between calls

try { 
    final result = api_instance.waitForEmailCount(inboxId, count, timeout, unreadOnly, before, since, sort, delay);
    print(result);
} catch (e) {
    print('Exception when calling WaitForControllerApi->waitForEmailCount: $en');
}

Parameters

NameTypeDescriptionNotes
inboxIdStringId of the inbox we are fetching emails from
countintNumber of emails to wait for. Must be greater that 1
timeoutintMax milliseconds to wait[optional]
unreadOnlyboolOptional filter for unread only[optional] [default to false]
beforeDateTimeFilter for emails that were received before the given timestamp[optional]
sinceDateTimeFilter for emails that were received after the given timestamp[optional]
sortStringSort direction[optional]
delayintMax milliseconds delay between calls[optional]

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

Email waitForLatestEmail(inboxId, timeout, unreadOnly, before, since, sort, delay)

Fetch inbox’s latest email or if empty wait for an 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 set unreadOnly=true or see the other receive methods such as waitForNthEmail or waitForEmailCount.

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = WaitForControllerApi();
final inboxId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Id of the inbox we are fetching emails from
final timeout = 789; // int | Max milliseconds to wait
final unreadOnly = true; // bool | Optional filter for unread only.
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were before after the given timestamp
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received after the given timestamp
final sort = sort_example; // String | Sort direction
final delay = 789; // int | Max milliseconds delay between calls

try { 
    final result = api_instance.waitForLatestEmail(inboxId, timeout, unreadOnly, before, since, sort, delay);
    print(result);
} catch (e) {
    print('Exception when calling WaitForControllerApi->waitForLatestEmail: $en');
}

Parameters

NameTypeDescriptionNotes
inboxIdStringId of the inbox we are fetching emails from[optional]
timeoutintMax milliseconds to wait[optional]
unreadOnlyboolOptional filter for unread only.[optional] [default to false]
beforeDateTimeFilter for emails that were before after the given timestamp[optional]
sinceDateTimeFilter for emails that were received after the given timestamp[optional]
sortStringSort direction[optional]
delayintMax milliseconds delay between calls[optional]

Return type

Email

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

List waitForMatchingEmails(inboxId, count, matchOptions, before, since, sort, delay, timeout, unreadOnly)

Wait or return list of emails that match simple matching patterns

Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the MatchOptions object for options. An example payload is { matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController getEmailContentMatch method.

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = WaitForControllerApi();
final inboxId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Id of the inbox we are fetching emails from
final count = 56; // int | Number of emails to wait for. Must be greater or equal to 1
final matchOptions = MatchOptions(); // MatchOptions | 
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received before the given timestamp
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received after the given timestamp
final sort = sort_example; // String | Sort direction
final delay = 789; // int | Max milliseconds delay between calls
final timeout = 789; // int | Max milliseconds to wait
final unreadOnly = true; // bool | Optional filter for unread only

try { 
    final result = api_instance.waitForMatchingEmails(inboxId, count, matchOptions, before, since, sort, delay, timeout, unreadOnly);
    print(result);
} catch (e) {
    print('Exception when calling WaitForControllerApi->waitForMatchingEmails: $en');
}

Parameters

NameTypeDescriptionNotes
inboxIdStringId of the inbox we are fetching emails from
countintNumber of emails to wait for. Must be greater or equal to 1
matchOptionsMatchOptions
beforeDateTimeFilter for emails that were received before the given timestamp[optional]
sinceDateTimeFilter for emails that were received after the given timestamp[optional]
sortStringSort direction[optional]
delayintMax milliseconds delay between calls[optional]
timeoutintMax milliseconds to wait[optional]
unreadOnlyboolOptional filter for unread only[optional] [default to false]

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

Email waitForMatchingFirstEmail(inboxId, matchOptions, timeout, unreadOnly, since, before, sort, delay)

Wait for or return the first email that matches provided MatchOptions array

Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the MatchOptions object for options. An example payload is { matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController getEmailContentMatch method.

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = WaitForControllerApi();
final inboxId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Id of the inbox we are matching an email for
final matchOptions = MatchOptions(); // MatchOptions | 
final timeout = 789; // int | Max milliseconds to wait
final unreadOnly = true; // bool | Optional filter for unread only
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received after the given timestamp
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received before the given timestamp
final sort = sort_example; // String | Sort direction
final delay = 789; // int | Max milliseconds delay between calls

try { 
    final result = api_instance.waitForMatchingFirstEmail(inboxId, matchOptions, timeout, unreadOnly, since, before, sort, delay);
    print(result);
} catch (e) {
    print('Exception when calling WaitForControllerApi->waitForMatchingFirstEmail: $en');
}

Parameters

NameTypeDescriptionNotes
inboxIdStringId of the inbox we are matching an email for
matchOptionsMatchOptions
timeoutintMax milliseconds to wait[optional]
unreadOnlyboolOptional filter for unread only[optional] [default to false]
sinceDateTimeFilter for emails that were received after the given timestamp[optional]
beforeDateTimeFilter for emails that were received before the given timestamp[optional]
sortStringSort direction[optional]
delayintMax milliseconds delay between calls[optional]

Return type

Email

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

Email waitForNthEmail(inboxId, , timeout, unreadOnly, since, before, sort, delay)

Wait for or fetch the email with a given in the inbox specified. If doesn’t exist waits for it to exist or timeout to occur.

If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = WaitForControllerApi();
final inboxId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Id of the inbox you are fetching emails from
final  = 56; // int | Zero based  of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass =1
final timeout = 789; // int | Max milliseconds to wait for the nth email if not already present
final unreadOnly = true; // bool | Optional filter for unread only
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received after the given timestamp
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter for emails that were received before the given timestamp
final sort = sort_example; // String | Sort direction
final delay = 789; // int | Max milliseconds delay between calls

try { 
    final result = api_instance.waitForNthEmail(inboxId, , timeout, unreadOnly, since, before, sort, delay);
    print(result);
} catch (e) {
    print('Exception when calling WaitForControllerApi->waitForNthEmail: $en');
}

Parameters

NameTypeDescriptionNotes
inboxIdStringId of the inbox you are fetching emails from[optional]
****intZero based of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass =1[optional] [default to 0]
timeoutintMax milliseconds to wait for the nth email if not already present[optional]
unreadOnlyboolOptional filter for unread only[optional] [default to false]
sinceDateTimeFilter for emails that were received after the given timestamp[optional]
beforeDateTimeFilter for emails that were received before the given timestamp[optional]
sortStringSort direction[optional]
delayintMax milliseconds delay between calls[optional]

Return type

Email

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]