Globals / InboxControllerApi
# Class: InboxControllerApi
InboxControllerApi - object-oriented interface
export
# Hierarchy
-
↳ InboxControllerApi
# Index
# Constructors
# Properties
# Methods
- createInbox
- createInboxWithOptions
- deleteAllInboxes
- deleteInbox
- getAllInboxes
- getEmails
- getInbox
- getInboxEmailsPaginated
- getInboxSentEmails
- getInboxTags
- getInboxes
- sendEmail
- sendEmailAndConfirm
- setInboxFavourited
- updateInbox
# 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
Defined in src/generated/api.ts:62 (opens new window)
# Methods
# createInbox
▸ createInbox(description?
: string, emailAddress?
: string, expiresAt?
: Date, expiresIn?
: number, favourite?
: boolean, name?
: string, tags?
: Array<string>, useDomainPool?
: boolean, options?
: any): Promise<Inbox>
Defined in src/generated/api.ts:14351 (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 |
expiresIn? | number |
favourite? | boolean |
name? | string |
tags? | Array<string> |
useDomainPool? | boolean |
options? | any |
Returns: Promise<Inbox>
# createInboxWithOptions
▸ createInboxWithOptions(createInboxDto
: CreateInboxDto, options?
: any): Promise<Inbox>
Defined in src/generated/api.ts:14383 (opens new window)
Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.
summary
Create an inbox with additional options
throws
{RequiredError}
memberof
InboxControllerApi
# Parameters:
Name | Type | Description |
---|---|---|
createInboxDto | CreateInboxDto | createInboxDto |
options? | any | - |
Returns: Promise<Inbox>
# deleteAllInboxes
▸ deleteAllInboxes(options?
: any): Promise<Response>
Defined in src/generated/api.ts:14400 (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:14414 (opens new window)
Permanently delete an inbox and associated email address as well 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:14434 (opens new window)
List inboxes in paginated form. The results are available on the content
property of the returned object. This method allows for page index (zero based), page size (how many results to return(, and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative getInboxes
method returns a full list of inboxes but is limited to 100 results.
summary
List All 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, size?
: number, sort?
: "ASC" | "DESC", options?
: any): Promise<EmailPreview[]>
Defined in src/generated/api.ts:14468 (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. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.
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 | - |
size? | number | - |
sort? | "ASC" | "DESC" |
options? | any | - |
Returns: Promise<EmailPreview[]>
# getInbox
▸ getInbox(inboxId
: string, options?
: any): Promise<Inbox>
Defined in src/generated/api.ts:14498 (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:14516 (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:14543 (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:14566 (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(size?
: number, sort?
: "ASC" | "DESC", options?
: any): Promise<Inbox[]>
Defined in src/generated/api.ts:14582 (opens new window)
List the inboxes you have created. Note use of the more advanced getAllEmails
is recommended. You can provide a limit and sort parameter.
summary
List Inboxes / Email Addresses
throws
{RequiredError}
memberof
InboxControllerApi
# Parameters:
Name | Type |
---|---|
size? | number |
sort? | "ASC" |
options? | any |
Returns: Promise<Inbox[]>
# sendEmail
▸ sendEmail(inboxId
: string, sendEmailOptions?
: SendEmailOptions, options?
: any): Promise<Response>
Defined in src/generated/api.ts:14599 (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:14620 (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:14641 (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:14662 (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>