# mailslurp-javascript-apollo

MailslurpJavascriptApollo - JavaScript client for mailslurp-javascript-apollo MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more.

# Resources

This SDK is automatically generated by the OpenAPI Generator (opens new window) project:

  • API version: 6.5.2
  • Package version: 8.2.15
  • Build package: org.openapitools.codegen.languages.JavascriptApolloClientCodegen

# Installation

# For Node.js (opens new window)

# npm

To publish the library as a npm (opens new window), please follow the procedure in "Publishing npm packages" (opens new window).

Then install it via:

npm install mailslurp-javascript-apollo --save

Finally, you need to build the module:

npm run build
# Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link (opens new window) it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your mailslurp-javascript-apollo from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

# git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

# For browser

The library also works in the browser environment via npm and browserify (opens new window). After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

# Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
      parser: {
        amd: false

# Getting Started

Please follow the installation instruction and execute the following JS code:

var MailslurpJavascriptApollo = require('mailslurp-javascript-apollo');
var defaultClient = MailslurpJavascriptApollo.ApiClient.instance;
// Configure API key authorization: API_KEY
var API_KEY = defaultClient.authentications['API_KEY'];
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//API_KEY.apiKeyPrefix['x-api-key'] = "Token"
var api = new MailslurpJavascriptApollo.AliasControllerApi()
var createOwnedAliasOptions = new MailslurpJavascriptApollo.CreateOwnedAliasOptions(); // {CreateOwnedAliasOptions} createOwnedAliasOptions
var callback = function(error, data, response) {
  if (error) {
  } else {
    console.log('API called successfully.');
api.createAlias(createOwnedAliasOptions, callback);

# Documentation for API Endpoints

All URIs are relative to https://api.mailslurp.com

Class Method HTTP request Description
MailslurpJavascriptApollo.AliasControllerApi createAlias POST /aliases Create an email alias
MailslurpJavascriptApollo.AliasControllerApi createAnonymousAlias POST /aliases/anonymous Create an anonymous email alias
MailslurpJavascriptApollo.AliasControllerApi deleteAlias DELETE /aliases/{aliasId} Delete an owned alias
MailslurpJavascriptApollo.AliasControllerApi getAlias GET /aliases/{aliasId} Get an email alias
MailslurpJavascriptApollo.AliasControllerApi getAliases GET /aliases Get all email aliases
MailslurpJavascriptApollo.AliasControllerApi updateAlias PUT /aliases/{aliasId} Update an owned alias
MailslurpJavascriptApollo.AttachmentControllerApi uploadAttachment POST /attachments Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
MailslurpJavascriptApollo.AttachmentControllerApi uploadAttachmentBytes POST /attachments/bytes Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
MailslurpJavascriptApollo.AttachmentControllerApi uploadMultipartForm POST /attachments/multipart Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
MailslurpJavascriptApollo.BulkActionsControllerApi bulkCreateInboxes POST /bulk/inboxes Bulk create Inboxes (email addresses)
MailslurpJavascriptApollo.BulkActionsControllerApi bulkDeleteInboxes DELETE /bulk/inboxes Bulk Delete Inboxes
MailslurpJavascriptApollo.BulkActionsControllerApi bulkSendEmails POST /bulk/send Bulk Send Emails
MailslurpJavascriptApollo.CommonActionsControllerApi createNewEmailAddress POST /createInbox Create new random inbox
MailslurpJavascriptApollo.CommonActionsControllerApi createNewEmailAddress1 POST /newEmailAddress Create new random inbox
MailslurpJavascriptApollo.CommonActionsControllerApi emptyInbox DELETE /emptyInbox Delete all emails in an inbox
MailslurpJavascriptApollo.CommonActionsControllerApi sendEmailSimple POST /sendEmail Send an email
MailslurpJavascriptApollo.ContactControllerApi createContact POST /contacts Create a contact
MailslurpJavascriptApollo.ContactControllerApi deleteContact DELETE /contacts/{contactId} Delete contact
MailslurpJavascriptApollo.ContactControllerApi getAllContacts GET /contacts/paginated Get all contacts
MailslurpJavascriptApollo.ContactControllerApi getContact GET /contacts/{contactId} Get contact
MailslurpJavascriptApollo.ContactControllerApi getContacts GET /contacts Get all contacts
MailslurpJavascriptApollo.DomainControllerApi createDomain POST /domains Create Domain
MailslurpJavascriptApollo.DomainControllerApi deleteDomain DELETE /domains/{id} Delete a domain
MailslurpJavascriptApollo.DomainControllerApi getDomain GET /domains/{id} Get a domain
MailslurpJavascriptApollo.DomainControllerApi getDomains GET /domains Get domains
MailslurpJavascriptApollo.EmailControllerApi deleteAllEmails DELETE /emails Delete all emails
MailslurpJavascriptApollo.EmailControllerApi deleteEmail DELETE /emails/{emailId} Delete an email
MailslurpJavascriptApollo.EmailControllerApi downloadAttachment GET /emails/{emailId}/attachments/{attachmentId} Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
MailslurpJavascriptApollo.EmailControllerApi downloadAttachmentBase64 GET /emails/{emailId}/attachments/{attachmentId}/base64 Get email attachment as base64 encoded string (alternative to binary responses)
MailslurpJavascriptApollo.EmailControllerApi forwardEmail POST /emails/{emailId}/forward Forward email
MailslurpJavascriptApollo.EmailControllerApi getAttachmentMetaData GET /emails/{emailId}/attachments/{attachmentId}/metadata Get email attachment metadata
MailslurpJavascriptApollo.EmailControllerApi getAttachments GET /emails/{emailId}/attachments Get all email attachment metadata
MailslurpJavascriptApollo.EmailControllerApi getEmail GET /emails/{emailId} Get email content
MailslurpJavascriptApollo.EmailControllerApi getEmailContentMatch POST /emails/{emailId}/contentMatch Get email content regex pattern match results. Runs regex against email body and returns match groups.
MailslurpJavascriptApollo.EmailControllerApi getEmailHTML GET /emails/{emailId}/html Get email content as HTML
MailslurpJavascriptApollo.EmailControllerApi getEmailsPaginated GET /emails Get all emails
MailslurpJavascriptApollo.EmailControllerApi getRawEmailContents GET /emails/{emailId}/raw Get raw email string
MailslurpJavascriptApollo.EmailControllerApi getRawEmailJson GET /emails/{emailId}/raw/json Get raw email in JSON
MailslurpJavascriptApollo.EmailControllerApi getUnreadEmailCount GET /emails/unreadCount Get unread email count
MailslurpJavascriptApollo.EmailControllerApi validateEmail POST /emails/{emailId}/validate Validate email
MailslurpJavascriptApollo.FormControllerApi submitForm POST /forms Submit a form to be parsed and sent as an email to an address determined by the form fields
MailslurpJavascriptApollo.GroupControllerApi addContactsToGroup PUT /groups/{groupId}/contacts Add contacts to a group
MailslurpJavascriptApollo.GroupControllerApi createGroup POST /groups Create a group
MailslurpJavascriptApollo.GroupControllerApi deleteGroup DELETE /groups/{groupId} Delete group
MailslurpJavascriptApollo.GroupControllerApi getAllGroups GET /groups/paginated Get all Contact Groups in paginated format
MailslurpJavascriptApollo.GroupControllerApi getGroup GET /groups/{groupId} Get group
MailslurpJavascriptApollo.GroupControllerApi getGroupWithContacts GET /groups/{groupId}/contacts Get group and contacts belonging to it
MailslurpJavascriptApollo.GroupControllerApi getGroupWithContactsPaginated GET /groups/{groupId}/contacts-paginated Get group and paginated contacts belonging to it
MailslurpJavascriptApollo.GroupControllerApi getGroups GET /groups Get all groups
MailslurpJavascriptApollo.GroupControllerApi removeContactsFromGroup DELETE /groups/{groupId}/contacts Remove contacts from a group
MailslurpJavascriptApollo.InboxControllerApi createInbox POST /inboxes Create an Inbox (email address)
MailslurpJavascriptApollo.InboxControllerApi deleteAllInboxes DELETE /inboxes Delete all inboxes
MailslurpJavascriptApollo.InboxControllerApi deleteInbox DELETE /inboxes/{inboxId} Delete inbox
MailslurpJavascriptApollo.InboxControllerApi getAllInboxes GET /inboxes/paginated List Inboxes Paginated
MailslurpJavascriptApollo.InboxControllerApi getEmails GET /inboxes/{inboxId}/emails Get emails in an Inbox
MailslurpJavascriptApollo.InboxControllerApi getInbox GET /inboxes/{inboxId} Get Inbox
MailslurpJavascriptApollo.InboxControllerApi getInboxEmailsPaginated GET /inboxes/{inboxId}/emails/paginated Get inbox emails paginated
MailslurpJavascriptApollo.InboxControllerApi getInboxSentEmails GET /inboxes/{inboxId}/sent Get Inbox Sent Emails
MailslurpJavascriptApollo.InboxControllerApi getInboxTags GET /inboxes/tags Get inbox tags
MailslurpJavascriptApollo.InboxControllerApi getInboxes GET /inboxes List Inboxes / Email Addresses
MailslurpJavascriptApollo.InboxControllerApi sendEmail POST /inboxes/{inboxId} Send Email
MailslurpJavascriptApollo.InboxControllerApi sendEmailAndConfirm POST /inboxes/{inboxId}/confirm Send email and return sent confirmation
MailslurpJavascriptApollo.InboxControllerApi setInboxFavourited PUT /inboxes/{inboxId}/favourite Set inbox favourited state
MailslurpJavascriptApollo.InboxControllerApi updateInbox PATCH /inboxes/{inboxId} Update Inbox
MailslurpJavascriptApollo.MailServerControllerApi describeMailServerDomain POST /mail-server/describe/domain Get DNS Mail Server records for a domain
MailslurpJavascriptApollo.MailServerControllerApi verifyEmailAddress POST /mail-server/verify/email-address Verify the existence of an email address at a given mail server.
MailslurpJavascriptApollo.SentEmailsControllerApi getSentEmail GET /sent/{id} Get sent email receipt
MailslurpJavascriptApollo.SentEmailsControllerApi getSentEmails GET /sent Get all sent emails in paginated form
MailslurpJavascriptApollo.TemplateControllerApi createTemplate POST /templates Create a Template
MailslurpJavascriptApollo.TemplateControllerApi deleteTemplate DELETE /templates/{TemplateId} Delete Template
MailslurpJavascriptApollo.TemplateControllerApi getAllTemplates GET /templates/paginated Get all Templates in paginated format
MailslurpJavascriptApollo.TemplateControllerApi getTemplate GET /templates/{TemplateId} Get Template
MailslurpJavascriptApollo.TemplateControllerApi getTemplates GET /templates Get all Templates
MailslurpJavascriptApollo.WaitForControllerApi waitFor POST /waitFor Wait for conditions to be met
MailslurpJavascriptApollo.WaitForControllerApi waitForEmailCount GET /waitForEmailCount Wait for and return count number of emails
MailslurpJavascriptApollo.WaitForControllerApi waitForLatestEmail GET /waitForLatestEmail Fetch inbox's latest email or if empty wait for an email to arrive
MailslurpJavascriptApollo.WaitForControllerApi waitForMatchingEmail POST /waitForMatchingEmails Wait or return list of emails that match simple matching patterns
MailslurpJavascriptApollo.WaitForControllerApi waitForNthEmail GET /waitForNthEmail Wait for or fetch the email with a given index in the inbox specified
MailslurpJavascriptApollo.WebhookControllerApi createWebhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
MailslurpJavascriptApollo.WebhookControllerApi deleteWebhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a Webhook for an Inbox
MailslurpJavascriptApollo.WebhookControllerApi getAllWebhooks GET /webhooks/paginated List Webhooks Paginated
MailslurpJavascriptApollo.WebhookControllerApi getWebhook GET /webhooks/{webhookId} Get a webhook for an Inbox
MailslurpJavascriptApollo.WebhookControllerApi getWebhooks GET /inboxes/{inboxId}/webhooks Get all Webhooks for an Inbox
MailslurpJavascriptApollo.WebhookControllerApi sendTestData POST /webhooks/{webhookId}/test Send webhook test data

# Documentation for Models

# Documentation for Authorization


  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header