No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swagger-codegen
docs
src
test
.swagger-codegen-ignore
.travis.yml
README.md
git_push.sh
mocha.opts
package.json

README.md

mailslurp-swagger-sdk

MailslurpSwaggerSdk - JavaScript client for mailslurp-swagger-sdk Documentation for MailSlurp's public REST API. ### About MailSlurp is a SAAS API for sending and receiving emails from ephemeral email inboxes. These inboxes can be created on the fly and each has a unique email address. ### Why MailSlurp was built for testing software or processes that interact with email in some way. For more information see the homepage. ### Links - Get API Key - API Documentation - Official SDK Libraries - Support / Issues - Swagger JSON ### Use You can call the MailSlurp API from any HTTP client in any language. Or you use one of the official generated SDK Libraries. - Official Typescript SDK - Official Python SDK - Official C# SDK - Official Java SDK - Official Swift SDK - Official Golang SDK - Official Javascript SDK - Official PHP SDK - Official Ruby SDK You can also compile your own library with SwaggerCodegen and the Swagger Spec. Lastly, there is an interactive GUI available at demo.mailslurp.com for testing requests. ### Auth An API Key must be passed as a header in all requests. To get an API Key sign up and log in to the MailSlurp Dashboard web app. ### Terms - Inbox - A unique email address - Unlimited in number - Can send and receive emails - Email - Belongs to an inbox - Contains summary and body - Raw content stored on S3 ### Issues If you encounter issues please contact the developers or open a ticket in GitHub. This SDK is automatically generated by the Swagger Codegen project:

  • API version: 0.0.1-alpha
  • Package version: 0.0.1-alpha
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen For more information, please visit https://www.mailslurp.com

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-swagger-sdk --save
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

Finally, switch to the directory you want to use your mailslurp-swagger-sdk from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('mailslurp-swagger-sdk') in javascript files from the directory you ran the last command above from.

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, that's to say your javascript file where you actually use this library):

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 MailslurpSwaggerSdk = require('mailslurp-swagger-sdk');

var defaultClient = MailslurpSwaggerSdk.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 MailslurpSwaggerSdk.EmailControllerApi()

var id = "id_example"; // {String} id

api.deleteMessageUsingDELETE(id).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

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

Class Method HTTP request Description
MailslurpSwaggerSdk.EmailControllerApi deleteMessageUsingDELETE DELETE /emails/{id} Delete Email
MailslurpSwaggerSdk.EmailControllerApi getMessageAnalyticsUsingGET GET /emails/{id}/analytics Get Email Analytics
MailslurpSwaggerSdk.EmailControllerApi getMessageUsingGET GET /emails/{id} Get Email Content
MailslurpSwaggerSdk.InboxControllerApi createInboxUsingPOST POST /inboxes Create Inbox
MailslurpSwaggerSdk.InboxControllerApi deleteInboxUsingDELETE DELETE /inboxes/{id} Delete Inbox
MailslurpSwaggerSdk.InboxControllerApi getInboxUsingGET GET /inboxes/{id} Get Inbox
MailslurpSwaggerSdk.InboxControllerApi getInboxesUsingGET GET /inboxes List Inboxes
MailslurpSwaggerSdk.InboxControllerApi getMessagesUsingGET GET /inboxes/{id}/messages List Inbox's Emails
MailslurpSwaggerSdk.InboxControllerApi sendMessageUsingPOST POST /inboxes/{id} Send Email
MailslurpSwaggerSdk.ManageEntitiesApi deleteInboxUsingDELETE DELETE /inboxes/{id} Delete Inbox
MailslurpSwaggerSdk.ManageEntitiesApi deleteMessageUsingDELETE DELETE /emails/{id} Delete Email
MailslurpSwaggerSdk.ManageEntitiesApi getInboxUsingGET GET /inboxes/{id} Get Inbox
MailslurpSwaggerSdk.ManageEntitiesApi getInboxesUsingGET GET /inboxes List Inboxes
MailslurpSwaggerSdk.ReceiveEmailsApi createInboxUsingPOST POST /inboxes Create Inbox
MailslurpSwaggerSdk.ReceiveEmailsApi getMessageAnalyticsUsingGET GET /emails/{id}/analytics Get Email Analytics
MailslurpSwaggerSdk.ReceiveEmailsApi getMessageUsingGET GET /emails/{id} Get Email Content
MailslurpSwaggerSdk.ReceiveEmailsApi getMessagesUsingGET GET /inboxes/{id}/messages List Inbox's Emails
MailslurpSwaggerSdk.SendEmailsApi createInboxUsingPOST POST /inboxes Create Inbox
MailslurpSwaggerSdk.SendEmailsApi sendMessageUsingPOST POST /inboxes/{id} Send Email

Documentation for Models

Documentation for Authorization

API_KEY

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