WaitForControllerApi

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.

waitFor

kotlin.collections.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 classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WaitForControllerApi()
val waitForConditions : WaitForConditions =  // WaitForConditions | Conditions to apply to emails that you are waiting for
try {
    val result : kotlin.collections.List<EmailPreview> = apiInstance.waitFor(waitForConditions)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WaitForControllerApi#waitFor")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WaitForControllerApi#waitFor")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
waitForConditionsWaitForConditionsConditions to apply to emails that you are waiting for[optional]

Return type

kotlin.collections.List

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

waitForEmailCount

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

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 classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WaitForControllerApi()
val before : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received before the given timestamp
val count : kotlin.Int = 56 // kotlin.Int | Number of emails to wait for. Must be greater that 1
val delay : kotlin.Long = 789 // kotlin.Long | Max milliseconds delay between calls
val inboxId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | Id of the inbox we are fetching emails from
val since : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received after the given timestamp
val sort : kotlin.String = sort_example // kotlin.String | Sort direction
val timeout : kotlin.Long = 789 // kotlin.Long | Max milliseconds to wait
val unreadOnly : kotlin.Boolean = true // kotlin.Boolean | Optional filter for unread only
try {
    val result : kotlin.collections.List<EmailPreview> = apiInstance.waitForEmailCount(before, count, delay, inboxId, since, sort, timeout, unreadOnly)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WaitForControllerApi#waitForEmailCount")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WaitForControllerApi#waitForEmailCount")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
beforejava.time.OffsetDateTimeFilter for emails that were received before the given timestamp[optional]
countkotlin.IntNumber of emails to wait for. Must be greater that 1[optional]
delaykotlin.LongMax milliseconds delay between calls[optional]
inboxIdjava.util.UUIDId of the inbox we are fetching emails from[optional]
sincejava.time.OffsetDateTimeFilter for emails that were received after the given timestamp[optional]
sortkotlin.StringSort direction[optional] [enum: ASC, DESC]
timeoutkotlin.LongMax milliseconds to wait[optional]
unreadOnlykotlin.BooleanOptional filter for unread only[optional] [default to false]

Return type

kotlin.collections.List

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

waitForLatestEmail

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

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 classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WaitForControllerApi()
val before : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were before after the given timestamp
val delay : kotlin.Long = 789 // kotlin.Long | Max milliseconds delay between calls
val inboxId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | Id of the inbox we are fetching emails from
val since : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received after the given timestamp
val sort : kotlin.String = sort_example // kotlin.String | Sort direction
val timeout : kotlin.Long = 789 // kotlin.Long | Max milliseconds to wait
val unreadOnly : kotlin.Boolean = true // kotlin.Boolean | Optional filter for unread only.
try {
    val result : Email = apiInstance.waitForLatestEmail(before, delay, inboxId, since, sort, timeout, unreadOnly)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WaitForControllerApi#waitForLatestEmail")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WaitForControllerApi#waitForLatestEmail")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
beforejava.time.OffsetDateTimeFilter for emails that were before after the given timestamp[optional]
delaykotlin.LongMax milliseconds delay between calls[optional]
inboxIdjava.util.UUIDId of the inbox we are fetching emails from[optional]
sincejava.time.OffsetDateTimeFilter for emails that were received after the given timestamp[optional]
sortkotlin.StringSort direction[optional] [enum: ASC, DESC]
timeoutkotlin.LongMax milliseconds to wait[optional]
unreadOnlykotlin.BooleanOptional filter for unread only.[optional] [default to false]

Return type

Email

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

waitForMatchingEmails

kotlin.collections.List waitForMatchingEmails(matchOptions, before, count, delay, inboxId, since, sort, 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 classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WaitForControllerApi()
val matchOptions : MatchOptions =  // MatchOptions | matchOptions
val before : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received before the given timestamp
val count : kotlin.Int = 56 // kotlin.Int | Number of emails to wait for. Must be greater or equal to 1
val delay : kotlin.Long = 789 // kotlin.Long | Max milliseconds delay between calls
val inboxId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | Id of the inbox we are fetching emails from
val since : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received after the given timestamp
val sort : kotlin.String = sort_example // kotlin.String | Sort direction
val timeout : kotlin.Long = 789 // kotlin.Long | Max milliseconds to wait
val unreadOnly : kotlin.Boolean = true // kotlin.Boolean | Optional filter for unread only
try {
    val result : kotlin.collections.List<EmailPreview> = apiInstance.waitForMatchingEmails(matchOptions, before, count, delay, inboxId, since, sort, timeout, unreadOnly)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WaitForControllerApi#waitForMatchingEmails")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WaitForControllerApi#waitForMatchingEmails")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
matchOptionsMatchOptionsmatchOptions
beforejava.time.OffsetDateTimeFilter for emails that were received before the given timestamp[optional]
countkotlin.IntNumber of emails to wait for. Must be greater or equal to 1[optional]
delaykotlin.LongMax milliseconds delay between calls[optional]
inboxIdjava.util.UUIDId of the inbox we are fetching emails from[optional]
sincejava.time.OffsetDateTimeFilter for emails that were received after the given timestamp[optional]
sortkotlin.StringSort direction[optional] [enum: ASC, DESC]
timeoutkotlin.LongMax milliseconds to wait[optional]
unreadOnlykotlin.BooleanOptional filter for unread only[optional] [default to false]

Return type

kotlin.collections.List

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

waitForMatchingFirstEmail

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

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 classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WaitForControllerApi()
val matchOptions : MatchOptions =  // MatchOptions | matchOptions
val before : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received before the given timestamp
val delay : kotlin.Long = 789 // kotlin.Long | Max milliseconds delay between calls
val inboxId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | Id of the inbox we are matching an email for
val since : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received after the given timestamp
val sort : kotlin.String = sort_example // kotlin.String | Sort direction
val timeout : kotlin.Long = 789 // kotlin.Long | Max milliseconds to wait
val unreadOnly : kotlin.Boolean = true // kotlin.Boolean | Optional filter for unread only
try {
    val result : Email = apiInstance.waitForMatchingFirstEmail(matchOptions, before, delay, inboxId, since, sort, timeout, unreadOnly)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WaitForControllerApi#waitForMatchingFirstEmail")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WaitForControllerApi#waitForMatchingFirstEmail")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
matchOptionsMatchOptionsmatchOptions
beforejava.time.OffsetDateTimeFilter for emails that were received before the given timestamp[optional]
delaykotlin.LongMax milliseconds delay between calls[optional]
inboxIdjava.util.UUIDId of the inbox we are matching an email for[optional]
sincejava.time.OffsetDateTimeFilter for emails that were received after the given timestamp[optional]
sortkotlin.StringSort direction[optional] [enum: ASC, DESC]
timeoutkotlin.LongMax milliseconds to wait[optional]
unreadOnlykotlin.BooleanOptional filter for unread only[optional] [default to false]

Return type

Email

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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

waitForNthEmail

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

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 classes:
//import com.mailslurp.infrastructure.*
//import com.mailslurp.models.*

val apiInstance = WaitForControllerApi()
val before : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received before the given timestamp
val delay : kotlin.Long = 789 // kotlin.Long | Max milliseconds delay between calls
val inboxId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID | Id of the inbox you are fetching emails from
val  : kotlin.Int = 56 // kotlin.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
val since : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Filter for emails that were received after the given timestamp
val sort : kotlin.String = sort_example // kotlin.String | Sort direction
val timeout : kotlin.Long = 789 // kotlin.Long | Max milliseconds to wait for the nth email if not already present
val unreadOnly : kotlin.Boolean = true // kotlin.Boolean | Optional filter for unread only
try {
    val result : Email = apiInstance.waitForNthEmail(before, delay, inboxId, , since, sort, timeout, unreadOnly)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WaitForControllerApi#waitForNthEmail")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WaitForControllerApi#waitForNthEmail")
    e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
beforejava.time.OffsetDateTimeFilter for emails that were received before the given timestamp[optional]
delaykotlin.LongMax milliseconds delay between calls[optional]
inboxIdjava.util.UUIDId of the inbox you are fetching emails from[optional]
****kotlin.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]
sincejava.time.OffsetDateTimeFilter for emails that were received after the given timestamp[optional]
sortkotlin.StringSort direction[optional] [enum: ASC, DESC]
timeoutkotlin.LongMax milliseconds to wait for the nth email if not already present[optional]
unreadOnlykotlin.BooleanOptional filter for unread only[optional] [default to false]

Return type

Email

Authorization

Configure API_KEY: ApiClient.apiKey[“x-api-key”] = "" ApiClient.apiKeyPrefix[“x-api-key”] = ""

HTTP request headers

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