Mimepost - JavaScript client for mimepost
MimePost API for sending email. You can find out more about MimePost at https://mimepost.com. For this sample, you can use the api key special-key
to test the authorization filters.
This SDK is automatically generated by the Swagger Codegen project:
- API version: 0.1.0
- Package version: 0.1.0
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install mimepost --save
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 mimepost from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('mimepost')
in javascript files from the directory you ran the last
command above from.
If the library is hosted at a git repository, e.g. https://github.com/mimepost/mimepost-node then install it via:
npm install mimepost/mimepost-node --save
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.
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
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var Mimepost = require('mimepost');
var defaultClient = Mimepost.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-Auth-Token'] = "Token"
var api = new Mimepost.AccountsApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.accountProfileGet(callback);
var Mimepost = require('mimepost');
var defaultClient = Mimepost.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 = 'Token';
var apiInstance = new MimePost.EmailsApi();
var body = new MimePost.Email(); // Email | Single Email object
var to = new MimePost.EmailTo() // To Email | Single To Email object
to.email = "TO_EMAIL"
body.html = "<h1>Html Code OR Text</h1>"
body.from_email = "FROM_EMAIL"
body.from_name = "FROM_NAME"
body.subject = "SUBJECT"
body.to = [to]
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + response.text);
}
};
apiInstance.sendEmail(body, callback);
All URIs are relative to https://api.mimepost.com/v1/
Class | Method | HTTP request | Description |
---|---|---|---|
Mimepost.AccountsApi | accountProfileGet | GET /account/profile/ | Get account profile details |
Mimepost.AccountsApi | accountProfilePost | POST /account/profile/ | Update account profile details |
Mimepost.AccountsApi | settingsGet | GET /settings/ | Get all the settings |
Mimepost.AccountsApi | settingsPost | POST /settings/ | Set a setting |
Mimepost.DomainsApi | domainsGet | GET /domains/ | Get a list of all the domains |
Mimepost.DomainsApi | domainsIdApprovePost | POST /domains/{id}/approve/ | Submit request for the approval of a verified domain |
Mimepost.DomainsApi | domainsIdDelete | DELETE /domains/{id} | Remove a single domain |
Mimepost.DomainsApi | domainsIdGet | GET /domains/{id} | Get the details of a single domain |
Mimepost.DomainsApi | domainsIdVerifyDkimPost | POST /domains/{id}/verify_dkim/ | Request for the verification of DKIM record for a single domain |
Mimepost.DomainsApi | domainsIdVerifySpfPost | POST /domains/{id}/verify_spf/ | Request for the verification of SPF record for a single domain |
Mimepost.DomainsApi | domainsIdVerifyTrackingPost | POST /domains/{id}/verify_tracking/ | Request for the verification of tracking record for a single domain |
Mimepost.DomainsApi | domainsPost | POST /domains/ | Add single domain |
Mimepost.EmailsApi | sendEmail | POST /emails/ | Send email |
Mimepost.StatsApi | emaillogsGet | GET /emaillogs/ | Get the logs of a particular date |
Mimepost.StatsApi | statsGet | GET /stats/ | Get the summary of stats for a range of dates |
Mimepost.WebhooksApi | webhooksGet | GET /webhooks/ | Get the list of all the webhooks |
Mimepost.WebhooksApi | webhooksIdDelete | DELETE /webhooks/{id} | Remove a single webhook |
Mimepost.WebhooksApi | webhooksIdGet | GET /webhooks/{id} | Get the details of a single webhook |
Mimepost.WebhooksApi | webhooksIdPut | PUT /webhooks/{id} | Update the details of a single webhook |
Mimepost.WebhooksApi | webhooksPost | POST /webhooks/ | Add single webhook |
- Mimepost.AccountProfile
- Mimepost.AccountProfileResponse
- Mimepost.AccountSettings
- Mimepost.ApiResponse
- Mimepost.ApiResponseAllWebhooks
- Mimepost.ApiResponseAllWebhooksData
- Mimepost.ApiResponseDomainsList
- Mimepost.ApiResponseDomainsListData
- Mimepost.ApiResponseEmaillogs
- Mimepost.ApiResponseEmaillogsData
- Mimepost.ApiResponseSingleWebhooks
- Mimepost.ApiResponseStats
- Mimepost.ApiResponseStatsData
- Mimepost.ApiResponseStatsDataDatewiseSummary
- Mimepost.ApiResponseStatsDataGraphSummary
- Mimepost.ApiResponseStatsDataTotalSummary
- Mimepost.ApiResponseStatsDataTotalSummaryStatus
- Mimepost.ApiResponseWebhooks
- Mimepost.ApiResponseWebhooksData
- Mimepost.Domain
- Mimepost.Email
- Mimepost.EmailAttachments
- Mimepost.EmailGlobalMergeVars
- Mimepost.EmailMergeVars
- Mimepost.EmailTo
- Mimepost.Webhook
- Mimepost.Webhook1
- Type: API key
- API key parameter name: X-Auth-Token
- Location: HTTP header