4.0.0 • Published 4 years ago

@smtpcom/smtpcom v4.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Tests codecov

SMTP.com API

JavaScript client for SMTP.com API V4

Installation

npm install smtpcom 

Getting Started

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

var SmtpComApi = require('@smtpcom/smtpcom');

var defaultClient = SmtpComApi.ApiClient.instance;
// Configure API key authorization: apiID
var apiID = defaultClient.authentications['apiID'];
apiID.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiID.apiKeyPrefix['api_key'] = "Token"
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix['X-SMTPCOM-API'] = "Token"
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

var api = new SmtpComApi.APIKeysApi()
var apiKey = "apiKey_example"; // {String} API Key Identificator.
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAPIKey(apiKey, callback);

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
SmtpComApi.APIKeysApigetAPIKeyGET /v4/api_keys/{api_key}Get API Key Details
SmtpComApi.APIKeysApiv4ApiKeysApiKeyDeleteDELETE /v4/api_keys/{api_key}Delete an API Key
SmtpComApi.APIKeysApiv4ApiKeysApiKeyPatchPATCH /v4/api_keys/{api_key}Update API Key
SmtpComApi.APIKeysApiv4ApiKeysGetGET /v4/api_keys/List All API Keys
SmtpComApi.APIKeysApiv4ApiKeysPostPOST /v4/api_keys/Create a New API Key
SmtpComApi.AccountApiv4AccountContactPatchPATCH /v4/account/contactUpdate Account Details
SmtpComApi.AccountApiv4AccountGetGET /v4/account/Get Account Details
SmtpComApi.AlertsApiv4AlertsAlertIdDeleteDELETE /v4/alerts/{alert_id}Delete Alert
SmtpComApi.AlertsApiv4AlertsAlertIdGetGET /v4/alerts/{alert_id}Get Alert Details
SmtpComApi.AlertsApiv4AlertsAlertIdPatchPATCH /v4/alerts/{alert_id}Update Alert Details
SmtpComApi.AlertsApiv4AlertsGetGET /v4/alerts/List All Allerts
SmtpComApi.AlertsApiv4AlertsPostPOST /v4/alerts/Create New Alert
SmtpComApi.CallbacksApiv4CallbacksDeleteDELETE /v4/callbacks/Delete All Callbacks
SmtpComApi.CallbacksApiv4CallbacksEventDeleteDELETE /v4/callbacks/{event}Delete Callback
SmtpComApi.CallbacksApiv4CallbacksEventGetGET /v4/callbacks/{event}Get Callback Details
SmtpComApi.CallbacksApiv4CallbacksEventPatchPATCH /v4/callbacks/{event}Update Callback Details
SmtpComApi.CallbacksApiv4CallbacksEventPostPOST /v4/callbacks/{event}Create Callback
SmtpComApi.CallbacksApiv4CallbacksGetGET /v4/callbacks/List All Callbacks
SmtpComApi.CallbacksApiv4CallbacksLogGetGET /v4/callbacks/logView Callback Logs
SmtpComApi.ChannelsApigetSenderGET /v4/channels/{name}Get Channel Details
SmtpComApi.ChannelsApiv4ChannelsGetGET /v4/channels/Get All Channels
SmtpComApi.ChannelsApiv4ChannelsNameDeleteDELETE /v4/channels/{name}Delete a Channel
SmtpComApi.ChannelsApiv4ChannelsNamePatchPATCH /v4/channels/{name}Update Channel Details
SmtpComApi.ChannelsApiv4ChannelsPostPOST /v4/channels/Create a New Channel
SmtpComApi.DKIMsApiv4DomainsDomainNameDeleteDELETE /v4/domains/{domain_name}Delete Domain
SmtpComApi.DKIMsApiv4DomainsDomainNameDkimKeysDeleteDELETE /v4/domains/{domain_name}/dkim_keysDelete DKIM for Domain
SmtpComApi.DKIMsApiv4DomainsDomainNameDkimKeysGetGET /v4/domains/{domain_name}/dkim_keysGet DKIM for Domain
SmtpComApi.DKIMsApiv4DomainsDomainNameDkimKeysPatchPATCH /v4/domains/{domain_name}/dkim_keysUpdate DKIM Key Details
SmtpComApi.DKIMsApiv4DomainsDomainNameDkimKeysPostPOST /v4/domains/{domain_name}/dkim_keysAdd DKIM for Domain
SmtpComApi.DKIMsApiv4DomainsDomainNameGetGET /v4/domains/{domain_name}Get Domain Details
SmtpComApi.DKIMsApiv4DomainsDomainNamePatchPATCH /v4/domains/{domain_name}Update Domain Details
SmtpComApi.DKIMsApiv4DomainsGetGET /v4/domains/Get All Registered Domains
SmtpComApi.DKIMsApiv4DomainsPostPOST /v4/domains/Register a Domain
SmtpComApi.MessagesApiv4MessagesGetGET /v4/messagesGet Detailed Messages Info
SmtpComApi.MessagesApiv4MessagesMimePostPOST /v4/messages/mimeSend MIME Message
SmtpComApi.MessagesApiv4MessagesPostPOST /v4/messagesSend a Message
SmtpComApi.ReportsApiv4ReportsGetGET /v4/reports/Get All Reports
SmtpComApi.ReportsApiv4ReportsOndemandPostPOST /v4/reports/ondemandCreate On-Demand Report
SmtpComApi.ReportsApiv4ReportsPeriodicPostPOST /v4/reports/periodicCreate Periodic Report
SmtpComApi.ReportsApiv4ReportsPeriodicReportIdDeleteDELETE /v4/reports/periodic/{report_id}Delete a Periodic Report
SmtpComApi.ReportsApiv4ReportsPeriodicReportIdPatchPATCH /v4/reports/periodic/{report_id}Update Periodic Report
SmtpComApi.ReportsApiv4ReportsReportIdGetGET /v4/reports/{report_id}Get Report Details
SmtpComApi.StatisticsApiv4StatsDurationSliceSliceSpecifierGroupByGetGET /v4/stats/{duration}/{slice}/{slice_specifier}/{group_by}Return event aggregates for the specified slices and duration. Slices can be chained.

Documentation for Models

Documentation for Authorization

apiID

  • Type: API key
  • API key parameter name: api_key
  • Location: URL query string

apiKey

  • Type: API key
  • API key parameter name: X-SMTPCOM-API
  • Location: HTTP header

basicAuth

  • Type: HTTP basic authentication