This library provides easy access to the Suppression List Resource.
- search(parameters, callback)
Perform a filtered search for entries in your suppression list.
parameters
- Object of search parameterscallback
- executed after task is completed. required- standard
callback(err, data)
err
- any error that occurreddata
- full response from request client
- standard
- checkStatus(email, callback)
email
-String
email address to check requiredcallback
- see search function
- removeStatus(email, callback)
email
-String
email address to remove requiredcallback
- see search function
- upsert(recipient, callback)
recipient
- Recipient Object orArray
of Recipient Objectscallback
- see search function
var SparkPost = require('sparkpost');
var client = new SparkPost('YOUR_API_KEY');
var parameters = {
from: '2015-05-07T00:00:00+0000'
, to: '2015-05-07T23:59:59+0000'
, limit: 5
};
client.suppressionList.search(parameters, function(err, data) {
if(err) {
console.log(err);
return;
}
console.log(data.body);
});
Check out all the examples provided here.