# Class: EmailControllerApi

EmailControllerApi - object-oriented interface

export

class EmailControllerApi

extends {BaseAPI}

# Hierarchy

# Constructors

# constructor

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

Inherited from BaseAPI.constructor

Defined in src/generated/api.ts:57

Parameters:

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

Returns: EmailControllerApi

# Properties

# Protected basePath

basePath: string

Inherited from BaseAPI.basePath

Defined in src/generated/api.ts:61


# Protected configuration

configuration: Configuration

Inherited from BaseAPI.configuration

Defined in src/generated/api.ts:57


# Protected fetch

fetch: FetchAPI

Inherited from BaseAPI.fetch

Defined in src/generated/api.ts:62

# Methods

# deleteAllEmails

deleteAllEmails(options?: any): Promise‹Response›

Defined in src/generated/api.ts:7237

Deletes all emails in your account. Be careful as emails cannot be recovered

summary Delete all emails

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type
options? any

Returns: Promise‹Response›


# deleteEmail

deleteEmail(emailId: string, options?: any): Promise‹Response›

Defined in src/generated/api.ts:7251

Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.

summary Delete an email

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
emailId string emailId
options? any -

Returns: Promise‹Response›


# downloadAttachment

downloadAttachment(attachmentId: string, emailId: string, apiKey?: string, options?: any): Promise‹string›

Defined in src/generated/api.ts:7268

Returns the specified attachment for a given email as a byte stream (file download). You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.

summary Get email attachment bytes

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
attachmentId string attachmentId
emailId string emailId
apiKey? string -
options? any -

Returns: Promise‹string›


# forwardEmail

forwardEmail(emailId: string, forwardEmailOptions: ForwardEmailOptions, options?: any): Promise‹Response›

Defined in src/generated/api.ts:7291

Forward an existing email to new recipients.

summary Forward email

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
emailId string emailId
forwardEmailOptions ForwardEmailOptions forwardEmailOptions
options? any -

Returns: Promise‹Response›


# getAttachmentMetaData

getAttachmentMetaData(attachmentId: string, emailId: string, options?: any): Promise‹AttachmentMetaData

Defined in src/generated/api.ts:7312

Returns the metadata such as name and content-type for a given attachment and email.

summary Get email attachment metadata

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
attachmentId string attachmentId
emailId string emailId
options? any -

Returns: Promise‹AttachmentMetaData


# getAttachments

getAttachments(emailId: string, options?: any): Promise‹AttachmentMetaData[]›

Defined in src/generated/api.ts:7332

Returns an array of attachment metadata such as name and content-type for a given email if present.

summary Get all email attachment metadata

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
emailId string emailId
options? any -

Returns: Promise‹AttachmentMetaData[]›


# getEmail

getEmail(emailId: string, decode?: boolean, options?: any): Promise‹Email

Defined in src/generated/api.ts:7348

Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints

summary Get email content

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
emailId string emailId
decode? boolean -
options? any -

Returns: Promise‹Email


# getEmailHTML

getEmailHTML(emailId: string, decode?: boolean, options?: any): Promise‹string›

Defined in src/generated/api.ts:7365

Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: ?apiKey=xxx

summary Get email content as HTML

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
emailId string emailId
decode? boolean -
options? any -

Returns: Promise‹string›


# getEmailsPaginated

getEmailsPaginated(inboxId?: Array‹string›, page?: number, size?: number, sort?: "ASC" | "DESC", unreadOnly?: boolean, options?: any): Promise‹PageEmailProjection

Defined in src/generated/api.ts:7385

By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages

summary Get all emails

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type
inboxId? Array‹string›
page? number
size? number
sort? "ASC" | "DESC"
unreadOnly? boolean
options? any

Returns: Promise‹PageEmailProjection


# getRawEmailContents

getRawEmailContents(emailId: string, options?: any): Promise‹string›

Defined in src/generated/api.ts:7411

Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint

summary Get raw email string

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
emailId string emailId
options? any -

Returns: Promise‹string›


# getRawEmailJson

getRawEmailJson(emailId: string, options?: any): Promise‹RawEmailJson

Defined in src/generated/api.ts:7426

Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response

summary Get raw email in JSON

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
emailId string emailId
options? any -

Returns: Promise‹RawEmailJson


# getUnreadEmailCount

getUnreadEmailCount(options?: any): Promise‹UnreadCount

Defined in src/generated/api.ts:7440

Get number of emails unread

summary Get unread email count

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type
options? any

Returns: Promise‹UnreadCount


# validateEmail

validateEmail(emailId: string, options?: any): Promise‹ValidationDto

Defined in src/generated/api.ts:7454

Validate the HTML content of email if HTML is found. Considered valid if no HTML.

summary Validate email

throws {RequiredError}

memberof EmailControllerApi

Parameters:

Name Type Description
emailId string emailId
options? any -

Returns: Promise‹ValidationDto