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 project:

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

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in “Publishing npm packages”.

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 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. 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'];
API_KEY.apiKey = "YOUR 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) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.createAlias(createOwnedAliasOptions, callback);

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
MailslurpJavascriptApollo.AliasControllerApicreateAliasPOST /aliasesCreate an email alias
MailslurpJavascriptApollo.AliasControllerApicreateAnonymousAliasPOST /aliases/anonymousCreate an anonymous email alias
MailslurpJavascriptApollo.AliasControllerApideleteAliasDELETE /aliases/{aliasId}Delete an owned alias
MailslurpJavascriptApollo.AliasControllerApigetAliasGET /aliases/{aliasId}Get an email alias
MailslurpJavascriptApollo.AliasControllerApigetAliasesGET /aliasesGet all email aliases
MailslurpJavascriptApollo.AliasControllerApiupdateAliasPUT /aliases/{aliasId}Update an owned alias
MailslurpJavascriptApollo.AttachmentControllerApiuploadAttachmentPOST /attachmentsUpload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
MailslurpJavascriptApollo.AttachmentControllerApiuploadAttachmentBytesPOST /attachments/bytesUpload 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.AttachmentControllerApiuploadMultipartFormPOST /attachments/multipartUpload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
MailslurpJavascriptApollo.BulkActionsControllerApibulkCreateInboxesPOST /bulk/inboxesBulk create Inboxes (email addresses)
MailslurpJavascriptApollo.BulkActionsControllerApibulkDeleteInboxesDELETE /bulk/inboxesBulk Delete Inboxes
MailslurpJavascriptApollo.BulkActionsControllerApibulkSendEmailsPOST /bulk/sendBulk Send Emails
MailslurpJavascriptApollo.CommonActionsControllerApicreateNewEmailAddressPOST /createInboxCreate new random inbox
MailslurpJavascriptApollo.CommonActionsControllerApicreateNewEmailAddress1POST /newEmailAddressCreate new random inbox
MailslurpJavascriptApollo.CommonActionsControllerApiemptyInboxDELETE /emptyInboxDelete all emails in an inbox
MailslurpJavascriptApollo.CommonActionsControllerApisendEmailSimplePOST /sendEmailSend an email
MailslurpJavascriptApollo.ContactControllerApicreateContactPOST /contactsCreate a contact
MailslurpJavascriptApollo.ContactControllerApideleteContactDELETE /contacts/{contactId}Delete contact
MailslurpJavascriptApollo.ContactControllerApigetAllContactsGET /contacts/paginatedGet all contacts
MailslurpJavascriptApollo.ContactControllerApigetContactGET /contacts/{contactId}Get contact
MailslurpJavascriptApollo.ContactControllerApigetContactsGET /contactsGet all contacts
MailslurpJavascriptApollo.DomainControllerApicreateDomainPOST /domainsCreate Domain
MailslurpJavascriptApollo.DomainControllerApideleteDomainDELETE /domains/{id}Delete a domain
MailslurpJavascriptApollo.DomainControllerApigetDomainGET /domains/{id}Get a domain
MailslurpJavascriptApollo.DomainControllerApigetDomainsGET /domainsGet domains
MailslurpJavascriptApollo.EmailControllerApideleteAllEmailsDELETE /emailsDelete all emails
MailslurpJavascriptApollo.EmailControllerApideleteEmailDELETE /emails/{emailId}Delete an email
MailslurpJavascriptApollo.EmailControllerApidownloadAttachmentGET /emails/{emailId}/attachments/{attachmentId}Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
MailslurpJavascriptApollo.EmailControllerApidownloadAttachmentBase64GET /emails/{emailId}/attachments/{attachmentId}/base64Get email attachment as base64 encoded string (alternative to binary responses)
MailslurpJavascriptApollo.EmailControllerApiforwardEmailPOST /emails/{emailId}/forwardForward email
MailslurpJavascriptApollo.EmailControllerApigetAttachmentMetaDataGET /emails/{emailId}/attachments/{attachmentId}/metadataGet email attachment metadata
MailslurpJavascriptApollo.EmailControllerApigetAttachmentsGET /emails/{emailId}/attachmentsGet all email attachment metadata
MailslurpJavascriptApollo.EmailControllerApigetEmailGET /emails/{emailId}Get email content
MailslurpJavascriptApollo.EmailControllerApigetEmailContentMatchPOST /emails/{emailId}/contentMatchGet email content regex pattern match results. Runs regex against email body and returns match groups.
MailslurpJavascriptApollo.EmailControllerApigetEmailHTMLGET /emails/{emailId}/htmlGet email content as HTML
MailslurpJavascriptApollo.EmailControllerApigetEmailsPaginatedGET /emailsGet all emails
MailslurpJavascriptApollo.EmailControllerApigetRawEmailContentsGET /emails/{emailId}/rawGet raw email string
MailslurpJavascriptApollo.EmailControllerApigetRawEmailJsonGET /emails/{emailId}/raw/jsonGet raw email in JSON
MailslurpJavascriptApollo.EmailControllerApigetUnreadEmailCountGET /emails/unreadCountGet unread email count
MailslurpJavascriptApollo.EmailControllerApivalidateEmailPOST /emails/{emailId}/validateValidate email
MailslurpJavascriptApollo.FormControllerApisubmitFormPOST /formsSubmit a form to be parsed and sent as an email to an address determined by the form fields
MailslurpJavascriptApollo.GroupControllerApiaddContactsToGroupPUT /groups/{groupId}/contactsAdd contacts to a group
MailslurpJavascriptApollo.GroupControllerApicreateGroupPOST /groupsCreate a group
MailslurpJavascriptApollo.GroupControllerApideleteGroupDELETE /groups/{groupId}Delete group
MailslurpJavascriptApollo.GroupControllerApigetAllGroupsGET /groups/paginatedGet all Contact Groups in paginated format
MailslurpJavascriptApollo.GroupControllerApigetGroupGET /groups/{groupId}Get group
MailslurpJavascriptApollo.GroupControllerApigetGroupWithContactsGET /groups/{groupId}/contactsGet group and contacts belonging to it
MailslurpJavascriptApollo.GroupControllerApigetGroupWithContactsPaginatedGET /groups/{groupId}/contacts-paginatedGet group and paginated contacts belonging to it
MailslurpJavascriptApollo.GroupControllerApigetGroupsGET /groupsGet all groups
MailslurpJavascriptApollo.GroupControllerApiremoveContactsFromGroupDELETE /groups/{groupId}/contactsRemove contacts from a group
MailslurpJavascriptApollo.InboxControllerApicreateInboxPOST /inboxesCreate an Inbox (email address)
MailslurpJavascriptApollo.InboxControllerApideleteAllInboxesDELETE /inboxesDelete all inboxes
MailslurpJavascriptApollo.InboxControllerApideleteInboxDELETE /inboxes/{inboxId}Delete inbox
MailslurpJavascriptApollo.InboxControllerApigetAllInboxesGET /inboxes/paginatedList Inboxes Paginated
MailslurpJavascriptApollo.InboxControllerApigetEmailsGET /inboxes/{inboxId}/emailsGet emails in an Inbox
MailslurpJavascriptApollo.InboxControllerApigetInboxGET /inboxes/{inboxId}Get Inbox
MailslurpJavascriptApollo.InboxControllerApigetInboxEmailsPaginatedGET /inboxes/{inboxId}/emails/paginatedGet inbox emails paginated
MailslurpJavascriptApollo.InboxControllerApigetInboxSentEmailsGET /inboxes/{inboxId}/sentGet Inbox Sent Emails
MailslurpJavascriptApollo.InboxControllerApigetInboxTagsGET /inboxes/tagsGet inbox tags
MailslurpJavascriptApollo.InboxControllerApigetInboxesGET /inboxesList Inboxes / Email Addresses
MailslurpJavascriptApollo.InboxControllerApisendEmailPOST /inboxes/{inboxId}Send Email
MailslurpJavascriptApollo.InboxControllerApisendEmailAndConfirmPOST /inboxes/{inboxId}/confirmSend email and return sent confirmation
MailslurpJavascriptApollo.InboxControllerApisetInboxFavouritedPUT /inboxes/{inboxId}/favouriteSet inbox favourited state
MailslurpJavascriptApollo.InboxControllerApiupdateInboxPATCH /inboxes/{inboxId}Update Inbox
MailslurpJavascriptApollo.MailServerControllerApidescribeMailServerDomainPOST /mail-server/describe/domainGet DNS Mail Server records for a domain
MailslurpJavascriptApollo.MailServerControllerApiverifyEmailAddressPOST /mail-server/verify/email-addressVerify the existence of an email address at a given mail server.
MailslurpJavascriptApollo.SentEmailsControllerApigetSentEmailGET /sent/{id}Get sent email receipt
MailslurpJavascriptApollo.SentEmailsControllerApigetSentEmailsGET /sentGet all sent emails in paginated form
MailslurpJavascriptApollo.TemplateControllerApicreateTemplatePOST /templatesCreate a Template
MailslurpJavascriptApollo.TemplateControllerApideleteTemplateDELETE /templates/{TemplateId}Delete Template
MailslurpJavascriptApollo.TemplateControllerApigetAllTemplatesGET /templates/paginatedGet all Templates in paginated format
MailslurpJavascriptApollo.TemplateControllerApigetTemplateGET /templates/{TemplateId}Get Template
MailslurpJavascriptApollo.TemplateControllerApigetTemplatesGET /templatesGet all Templates
MailslurpJavascriptApollo.WaitForControllerApiwaitForPOST /waitForWait for conditions to be met
MailslurpJavascriptApollo.WaitForControllerApiwaitForEmailCountGET /waitForEmailCountWait for and return count number of emails
MailslurpJavascriptApollo.WaitForControllerApiwaitForLatestEmailGET /waitForLatestEmailFetch inbox's latest email or if empty wait for an email to arrive
MailslurpJavascriptApollo.WaitForControllerApiwaitForMatchingEmailPOST /waitForMatchingEmailsWait or return list of emails that match simple matching patterns
MailslurpJavascriptApollo.WaitForControllerApiwaitForNthEmailGET /waitForNthEmailWait for or fetch the email with a given index in the inbox specified
MailslurpJavascriptApollo.WebhookControllerApicreateWebhookPOST /inboxes/{inboxId}/webhooksAttach a WebHook URL to an inbox
MailslurpJavascriptApollo.WebhookControllerApideleteWebhookDELETE /inboxes/{inboxId}/webhooks/{webhookId}Delete and disable a Webhook for an Inbox
MailslurpJavascriptApollo.WebhookControllerApigetAllWebhooksGET /webhooks/paginatedList Webhooks Paginated
MailslurpJavascriptApollo.WebhookControllerApigetWebhookGET /webhooks/{webhookId}Get a webhook for an Inbox
MailslurpJavascriptApollo.WebhookControllerApigetWebhooksGET /inboxes/{inboxId}/webhooksGet all Webhooks for an Inbox
MailslurpJavascriptApollo.WebhookControllerApisendTestDataPOST /webhooks/{webhookId}/testSend webhook test data

Documentation for Models

Documentation for Authorization

API_KEY

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