Globals / EmailControllerApi
# Class: EmailControllerApi
EmailControllerApi - object-oriented interface
export
# Hierarchy
-
↳ EmailControllerApi
# Index
# Constructors
# Properties
# Methods
- deleteAllEmails
- deleteEmail
- downloadAttachment
- downloadAttachmentBase64
- forwardEmail
- getAttachmentMetaData
- getAttachments
- getEmail
- getEmailContentMatch
- getEmailHTML
- getEmailHTMLQuery
- getEmailTextLines
- getEmailsPaginated
- getRawEmailContents
- getRawEmailJson
- getUnreadEmailCount
- replyToEmail
- validateEmail
# Constructors
# constructor
+ new EmailControllerApi(configuration?
: Configuration, basePath?
: string, fetch?
: FetchAPI): EmailControllerApi
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: EmailControllerApi
# 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
# deleteAllEmails
▸ deleteAllEmails(options?
: any): Promise<Response>
Defined in src/generated/api.ts:10185 (opens new window)
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:10199 (opens new window)
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 | ID of email to delete |
options? | any | - |
Returns: Promise<Response>
# downloadAttachment
▸ downloadAttachment(attachmentId
: string, emailId
: string, apiKey?
: string, options?
: any): Promise<string>
Defined in src/generated/api.ts:10216 (opens new window)
Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
summary
Get email attachment bytes. If you have trouble with byte responses try the downloadAttachmentBase64
response endpoints.
throws
{RequiredError}
memberof
EmailControllerApi
# Parameters:
Name | Type | Description |
---|---|---|
attachmentId | string | ID of attachment |
emailId | string | ID of email |
apiKey? | string | - |
options? | any | - |
Returns: Promise<string>
# downloadAttachmentBase64
▸ downloadAttachmentBase64(attachmentId
: string, emailId
: string, options?
: any): Promise<DownloadAttachmentDto>
Defined in src/generated/api.ts:10239 (opens new window)
Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the downloadAttachment
method but allows some clients to get around issues with binary responses.
summary
Get email attachment as base64 encoded string (alternative to binary responses)
throws
{RequiredError}
memberof
EmailControllerApi
# Parameters:
Name | Type | Description |
---|---|---|
attachmentId | string | ID of attachment |
emailId | string | ID of email |
options? | any | - |
Returns: Promise<DownloadAttachmentDto>
# forwardEmail
▸ forwardEmail(emailId
: string, forwardEmailOptions
: ForwardEmailOptions, options?
: any): Promise<Response>
Defined in src/generated/api.ts:10261 (opens new window)
Forward an existing email to new recipients.
summary
Forward email
throws
{RequiredError}
memberof
EmailControllerApi
# Parameters:
Name | Type | Description |
---|---|---|
emailId | string | ID of email |
forwardEmailOptions | ForwardEmailOptions | forwardEmailOptions |
options? | any | - |
Returns: Promise<Response>
# getAttachmentMetaData
▸ getAttachmentMetaData(attachmentId
: string, emailId
: string, options?
: any): Promise<AttachmentMetaData>
Defined in src/generated/api.ts:10282 (opens new window)
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 | ID of attachment |
emailId | string | ID of email |
options? | any | - |
Returns: Promise<AttachmentMetaData>
# getAttachments
▸ getAttachments(emailId
: string, options?
: any): Promise<AttachmentMetaData[]>
Defined in src/generated/api.ts:10302 (opens new window)
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 | ID of email |
options? | any | - |
Returns: Promise<AttachmentMetaData[]>
# getEmail
▸ getEmail(emailId
: string, decode?
: boolean, options?
: any): Promise<Email>
Defined in src/generated/api.ts:10318 (opens new window)
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>
# getEmailContentMatch
▸ getEmailContentMatch(contentMatchOptions
: ContentMatchOptions, emailId
: string, options?
: any): Promise<EmailContentMatchResult>
Defined in src/generated/api.ts:10335 (opens new window)
Return the matches for a given Java style regex pattern. Do not include the typical /
at start or end of regex in some languages. Given an example your code is: 12345
the pattern to extract match looks like code is: (\\d{6})
. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: ['code is: 123456', '123456']
See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
summary
Get email content regex pattern match results. Runs regex against email body and returns match groups.
throws
{RequiredError}
memberof
EmailControllerApi
# Parameters:
Name | Type | Description |
---|---|---|
contentMatchOptions | ContentMatchOptions | contentMatchOptions |
emailId | string | ID of email to match against |
options? | any | - |
Returns: Promise<EmailContentMatchResult>
# getEmailHTML
▸ getEmailHTML(emailId
: string, decode?
: boolean, options?
: any): Promise<string>
Defined in src/generated/api.ts:10356 (opens new window)
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>
# getEmailHTMLQuery
▸ getEmailHTMLQuery(emailId
: string, htmlSelector?
: string, options?
: any): Promise<EmailTextLinesResult>
Defined in src/generated/api.ts:10373 (opens new window)
Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors
summary
Parse and return text from an email, stripping HTML and decoding encoded characters
throws
{RequiredError}
memberof
EmailControllerApi
# Parameters:
Name | Type | Description |
---|---|---|
emailId | string | ID of email to perform HTML query on |
htmlSelector? | string | - |
options? | any | - |
Returns: Promise<EmailTextLinesResult>
# getEmailTextLines
▸ getEmailTextLines(emailId
: string, decodeHtmlEntities?
: boolean, lineSeparator?
: string, options?
: any): Promise<EmailTextLinesResult>
Defined in src/generated/api.ts:10395 (opens new window)
Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.
summary
Parse and return text from an email, stripping HTML and decoding encoded characters
throws
{RequiredError}
memberof
EmailControllerApi
# Parameters:
Name | Type | Description |
---|---|---|
emailId | string | ID of email to fetch text for |
decodeHtmlEntities? | boolean | - |
lineSeparator? | string | - |
options? | any | - |
Returns: Promise<EmailTextLinesResult>
# getEmailsPaginated
▸ getEmailsPaginated(inboxId?
: Array<string>, page?
: number, size?
: number, sort?
: "ASC" | "DESC", unreadOnly?
: boolean, options?
: any): Promise<PageEmailProjection>
Defined in src/generated/api.ts:10421 (opens new window)
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:10447 (opens new window)
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 | ID of email |
options? | any | - |
Returns: Promise<string>
# getRawEmailJson
▸ getRawEmailJson(emailId
: string, options?
: any): Promise<RawEmailJson>
Defined in src/generated/api.ts:10462 (opens new window)
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 | ID of email |
options? | any | - |
Returns: Promise<RawEmailJson>
# getUnreadEmailCount
▸ getUnreadEmailCount(options?
: any): Promise<UnreadCount>
Defined in src/generated/api.ts:10476 (opens new window)
Get number of emails unread
summary
Get unread email count
throws
{RequiredError}
memberof
EmailControllerApi
# Parameters:
Name | Type |
---|---|
options? | any |
Returns: Promise<UnreadCount>
# replyToEmail
▸ replyToEmail(emailId
: string, replyToEmailOptions
: ReplyToEmailOptions, options?
: any): Promise<SentEmailDto>
Defined in src/generated/api.ts:10491 (opens new window)
Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails to
, cc
, and bcc
.
summary
Reply to an email
throws
{RequiredError}
memberof
EmailControllerApi
# Parameters:
Name | Type | Description |
---|---|---|
emailId | string | ID of the email that should be replied to |
replyToEmailOptions | ReplyToEmailOptions | replyToEmailOptions |
options? | any | - |
Returns: Promise<SentEmailDto>
# validateEmail
▸ validateEmail(emailId
: string, options?
: any): Promise<ValidationDto>
Defined in src/generated/api.ts:10511 (opens new window)
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 | ID of email |
options? | any | - |
Returns: Promise<ValidationDto>