suppressionlist

0.1.2 • Public • Published

SuppressionList API Client

This is a Node.js module for calling the SuppressionList API.

Build Status

Client

To use SuppressionList, require this module and create a new Client instance using your API key.

const Client = require('suppressionlist-api-client');

const apiKey = '123456';

const client = new Client(apiKey);

// now you can use the client
client.getLists((err, lists) => {
  if (err) throw err;
  console.log(lists);
});

Client Functions

All functions take a callback that is invoked with two parameters:

  • err — the error, if one occured, or null if one did not
  • results — the results of the call. For calls that return multiple records, this is an Array. When fetching a single record, this is a plain old Object, as returned by the SuppressionList API.
getLists(callback)

The getLists() function returns all the lists in your account. There is not currently a way to filter. SuppressionList will always return all lists.

createList(name, ttl, callback)

The createList() function creates a new list in your account. The name is the human-readable name for the list. The ttl is the "time to live" for records in that list, in seconds.

ensureList(name, ttl, callback)

The ensureList() function ensures that a list with the given name exists. If it does, it'll be returned without modification. If it does not, then it'll be created and returned.

/suppressionlist/

    Package Sidebar

    Install

    npm i suppressionlist

    Weekly Downloads

    84

    Version

    0.1.2

    License

    ISC

    Unpacked Size

    6.62 kB

    Total Files

    5

    Last publish

    Collaborators

    • dusan.pantelic.ap
    • greenasgrassap
    • jevensen
    • daniel.gershin
    • celolb
    • rafael.uchoa
    • jarrodbmiller
    • terbepetra
    • matteo.pandolfi
    • ericyd_ap
    • ivisilva
    • henriquelaki
    • carlo.anselmi
    • stefano.santonocito
    • carlhannusch
    • robdll
    • jorgemarrufo
    • apshoebkhan
    • samullen-ap
    • dpjones09
    • josevsp
    • johnb2
    • rickymcmurtrey
    • jgrayson03
    • apadmin
    • alexkwolfe
    • kellym
    • cgrayson
    • steveodom
    • ap_luisferreira
    • alisimbanegavi
    • benjmartin
    • sammarten
    • gabriel.roldan.ap
    • stwf-ap