MailSlurp JS

Globals / InboxControllerApi

# Class: InboxControllerApi

InboxControllerApi - object-oriented interface

export

# Hierarchy

# Index

# Constructors

# Properties

# Methods

# Constructors

# constructor

+ new InboxControllerApi(configuration?: Configuration, basePath?: string, fetch?: FetchAPI): InboxControllerApi

Inherited from BaseAPI.constructor

Defined in src/generated/api.ts:57 (opens new window)

# Parameters:

Name Type Default value
configuration? Configuration -
basePath string BASE_PATH
fetch FetchAPI portableFetch

Returns: InboxControllerApi

# Properties

# basePath

Protected basePath: string

Inherited from BaseAPI.basePath

Defined in src/generated/api.ts:61 (opens new window)


# configuration

Protected configuration: Configuration

Inherited from BaseAPI.configuration

Defined in src/generated/api.ts:57 (opens new window)


# fetch

Protected fetch: FetchAPI

Inherited from BaseAPI.fetch

Defined in src/generated/api.ts:62 (opens new window)

# Methods

# createInbox

createInbox(description?: string, emailAddress?: string, expiresAt?: Date, favourite?: boolean, name?: string, tags?: Array&lt;string>, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:11631 (opens new window)

Create a new inbox and with a randomized 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.

summary Create an Inbox (email address)

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type
description? string
emailAddress? string
expiresAt? Date
favourite? boolean
name? string
tags? Array&lt;string>
options? any

Returns: Promise<Inbox>


# deleteAllInboxes

deleteAllInboxes(options?: any): Promise<Response>

Defined in src/generated/api.ts:11658 (opens new window)

Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.

summary Delete all inboxes

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type
options? any

Returns: Promise<Response>


# deleteInbox

deleteInbox(inboxId: string, options?: any): Promise<Response>

Defined in src/generated/api.ts:11672 (opens new window)

Permanently delete an inbox and associated email address aswell as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request.

summary Delete inbox

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string inboxId
options? any -

Returns: Promise<Response>


# getAllInboxes

getAllInboxes(favourite?: boolean, page?: number, search?: string, size?: number, sort?: "ASC" | "DESC", tag?: string, options?: any): Promise<PageInboxProjection>

Defined in src/generated/api.ts:11692 (opens new window)

List inboxes in paginated form. Allows for page index, page size, and sort direction. Can also filter by favourited or email address like pattern.

summary List Inboxes Paginated

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type
favourite? boolean
page? number
search? string
size? number
sort? "ASC"
tag? string
options? any

Returns: Promise<PageInboxProjection>


# getEmails

getEmails(inboxId: string, limit?: number, minCount?: number, retryTimeout?: number, since?: Date, sort?: "ASC" | "DESC", options?: any): Promise<EmailPreview[]>

Defined in src/generated/api.ts:11725 (opens new window)

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

summary Get emails in an Inbox

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string Id of inbox that emails belongs to
limit? number -
minCount? number -
retryTimeout? number -
since? Date -
sort? "ASC" "DESC"
options? any -

Returns: Promise<EmailPreview[]>


# getInbox

getInbox(inboxId: string, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:11753 (opens new window)

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

summary Get Inbox

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string inboxId
options? any -

Returns: Promise<Inbox>


# getInboxEmailsPaginated

getInboxEmailsPaginated(inboxId: string, page?: number, size?: number, sort?: "ASC" | "DESC", options?: any): Promise<PageEmailPreview>

Defined in src/generated/api.ts:11771 (opens new window)

Get a paginated list of emails in an inbox. Does not hold connections open.

summary Get inbox emails paginated

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string Id of inbox that emails belongs to
page? number -
size? number -
sort? "ASC" "DESC"
options? any -

Returns: Promise<PageEmailPreview>


# getInboxSentEmails

getInboxSentEmails(inboxId: string, page?: number, size?: number, sort?: "ASC" | "DESC", options?: any): Promise<PageSentEmailProjection>

Defined in src/generated/api.ts:11798 (opens new window)

Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead.

summary Get Inbox Sent Emails

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string inboxId
page? number -
size? number -
sort? "ASC" "DESC"
options? any -

Returns: Promise<PageSentEmailProjection>


# getInboxTags

getInboxTags(options?: any): Promise<string[]>

Defined in src/generated/api.ts:11821 (opens new window)

Get all inbox tags

summary Get inbox tags

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type
options? any

Returns: Promise<string[]>


# getInboxes

getInboxes(options?: any): Promise<Inbox[]>

Defined in src/generated/api.ts:11835 (opens new window)

List the inboxes you have created

summary List Inboxes / Email Addresses

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type
options? any

Returns: Promise<Inbox[]>


# sendEmail

sendEmail(inboxId: string, sendEmailOptions?: SendEmailOptions, options?: any): Promise<Response>

Defined in src/generated/api.ts:11851 (opens new window)

Send an email from an inbox's email address. The request body should contain the SendEmailOptions that include recipients, attachments, body etc. See SendEmailOptions for all available properties. Note the inboxId refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method sendEmailAndConfirm.

summary Send Email

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string ID of the inbox you want to send the email from
sendEmailOptions? SendEmailOptions -
options? any -

Returns: Promise<Response>


# sendEmailAndConfirm

sendEmailAndConfirm(inboxId: string, sendEmailOptions?: SendEmailOptions, options?: any): Promise<SentEmailDto>

Defined in src/generated/api.ts:11872 (opens new window)

Sister method for standard sendEmail method with the benefit of returning a SentEmail entity confirming the successful sending of the email with link the the sent object created for it.

summary Send email and return sent confirmation

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string ID of the inbox you want to send the email from
sendEmailOptions? SendEmailOptions -
options? any -

Returns: Promise<SentEmailDto>


# setInboxFavourited

setInboxFavourited(inboxId: string, setInboxFavouritedOptions: SetInboxFavouritedOptions, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:11893 (opens new window)

Set and return new favourite state for an inbox

summary Set inbox favourited state

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string inboxId
setInboxFavouritedOptions SetInboxFavouritedOptions setInboxFavouritedOptions
options? any -

Returns: Promise<Inbox>


# updateInbox

updateInbox(inboxId: string, updateInboxOptions: UpdateInboxOptions, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:11914 (opens new window)

Update editable fields on an inbox

summary Update Inbox

throws {RequiredError}

memberof InboxControllerApi

# Parameters:

Name Type Description
inboxId string inboxId
updateInboxOptions UpdateInboxOptions updateInboxOptions
options? any -

Returns: Promise<Inbox>