Newsletter API

Newsletter core contains a set of API for coders which can be exposed as REST API with the free Newsletter REST API extension. 

Check the full documentation of the Newsletter API and the Newsletter REST API in our developers section.

The API key

The API key is a secret sequence of characters that must be passed on while calling the externally exposed API of the Newsletter plugin. If that field is left empty, the API are disabled. The API are implemented with the code located in the “api” sub-folder if you need to look at it.

The API key must be passed on each HTTP call using the parameter named “nk”.

The API key can be set on main configuration panel.

Legacy calls

Add a Subscriber

To add a subscriber call with a POST (actually even the GET works…)

http://www.yourdomain.com/wp-content/plugins/newsletter/api/add.php

A subscriber is always added in confirmed status.

Parameters

nk is the API key (required)
ne is the email address (required)
nn is the first name
ns is the last name
nl is a | separated list of lists numbers

Example 1

http://www.yourdomain.com/wp-content/plugins/newsletter/api/add.php?nk=yoursecretkey
ne=stefano@thenewsletterplugin.com
nn=Stefano
ns=Lissa
nl=1|3

Delete a Subscriber

Subscribers are delete by email address with the call:

http://www.yourdomain.com/wp-content/plugins/newsletter/api/delete.php?nk=yoursecretkey

Parameters

ne is the email address (required)