Open2b versione 7.5

newsletter-members

newsletter-members.find

Returns the members that meet the given conditions.

Request

Admin SDK
Admin.api('site.newsletter-members.find', request, function(response) { … });
HTTP POST
/api/v10/site.newsletter-members.find

  {
  "conditions" : { // returns the members …
    "list" : 5, // … of this newsletter list (id) - int(1…)
    "email" : "info@acme.com", // … with this email - string(3…100)
    "domain" : "acme.com", // … with this domain name - string(1…98)
    "ip" : "172.16.254.1" // … with this IP address - string(7…15)
  },
  "fields" : [ "list", "email", … ], // fields to return - string
  "order" : [ "name" ], // sort order of returned newsletter members, can contain "list", "-list", "email", "-email", "ip", "-ip",
                        // "creationTime" and "-creationTime" - string
  "limit" : 10, // maximum number of newsletter members to return - int(1…)
  "first" : 30 // index of the first newsletter member to return - int(0…)
}

Response

{
  "status" : "ok",
  "members" : [ {
    "list" : 5, // newsletter list (id) - int(1…)
    "email" : "info@acme.com", // email address - string(3…100)
    "ip" : "172.16.254.1", // IP address (can be null) - string(7…15)
    "creationTime" : "2020-09-14 09:29:12" // creation time - datetime
  }, … ]
}

newsletter-members.count

Number of members that meet the given conditions.

Request

Admin SDK
Admin.api('site.newsletter-members.count', request, function(response) { … });
HTTP POST
/api/v10/site.newsletter-members.count
{
  "conditions" : { // counts the members …
    "list" : 5, // … of this newsletter list (id) - int(1…)
    "email" : "info@acme.com", // … with this email - string(3…100)
    "domain" : "acme.com", // … with this domain name - string(1…98)
    "ip" : "172.16.254.1" // … with this IP address - string(7…15)
  }
}

Response

{
  "status" : "ok",
  "count" : 349056 // number of members - int(0…)
}

Errors

Field Type Description
email InvalidValue '<email>' is not a well formed email address

newsletter-members.create

Creates one o more members in one or more lists.

Request

Admin SDK
Admin.api('site.newsletter-members.create', request, function(response) { … });
HTTP POST
/api/v10/site.newsletter-members.create
{
  "members" : [ { // members to create (required)
    "email" : "info@acme.com", // email address (required) - string(3…100)
    "ip" : "172.16.254.1" // IP address (can be null) - string(7…15)
  }, … ],
  "lists" : [ 5, 9, … ] // newsletter lists (id) in which to create the members (required) - int(1…)
}

Response

{
  "status" : "ok"
}

Errors

Field Type Description
email InvalidValue '<email>' is not a well formed email address
lists NotFound Newsletter list <list> does not exist

newsletter-members.delete

Deletes one o more members from one or more lists.

Request

Admin SDK
Admin.api('site.newsletter-members.delete', request, function(response) { … });
HTTP POST
/api/v10/site.newsletter-members.delete
{
  "emails" : [ "info@acme.com", … ], // emails of the members to delete (required) - string(3…100)
  "lists" : [ 5, 9, … ] // newsletter lists (id) from which to delete the members (required) - int(1…)
}

Response

{
  "status" : "ok"
}

Errors

Field Type Description
emails InvalidValue '<email>' is not a well formed email address
lists NotFound Newsletter list <list> does not exist