dotmailer
A 3rd party dotMailer v2 REST API implementation
Last updated a year ago by confuser .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dotmailer 
SYNC missed versions from official npm registry.

dotMailer

build status Known Vulnerabilities

A 3rd party dotMailer v2 REST API implementation

Installation

npm install dotmailer --save

Usage

dotMailer({endpoint, tokens, config, callback})

  • (Required) endpoint (String) - Function name, e.g. 'PostAddressBooks'
  • (Optional) tokens (Array) - Query parameters that are passed as additional function arguments, can be String or Number, e.g. 123456
  • (Required) config (Object) - Request type & options.
  Example:

  {
    type: 'json',
    options: {
      Name: 'Test Address Book', 
      Visibility: 'Private'
    }
  }
  • (Required) callback (Function) - (error, response) Executed on completion

Tokens may be required depending on the endpoint. Required tokens that are not used will throw an error.

Some requests return 204 meaning response within the callback will be undefined if successful.

Documentation

Full documentation for the dotMailer API can be found at http://api.dotmailer.com/v2/help/wadl

Example

var config =
  { auth:
    { user: '', pass: '' }
    baseUrl: 'https://r1-api.dotmailer.com/v2/' // Account region endpoint
    // Any other 'request' options here
  }
  , dotmailer = require('dotmailer')(config)
  , addressBookId = 123456

dotmailer({
  endpoint: 'DeleteAddressBookContacts',
  tokens: [addressBookId],
  config: {
    type: 'json',
    options: {}
  }
  callback: (error, res) => {
    console.log(error, res)
  })

Tests

An integration test is provided which is not a part of npm test

This test will create, update & delete an address book named 'Test Address Book'

To run:

USER=username@apiconnector.com 
PASS=pass 

$ mocha test/integration/dotmailer.integration.test.js

Credits

Current Tags

  • 3.0.1                                ...           latest (a year ago)

7 Versions

  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.0.0                                ...           3 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (1)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |