newsletter-lists

newsletter-lists.find

Returns all the newsletter lists.

JS
CR.api('site.newsletter-lists.find', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.newsletter-lists.find

request

{
  "language" : "en", // language ( ISO code ) of the texts to return - string(2)
  "fields" : [ "id", "name", … ], // fields to return - string
  "order" : [ "name" ], // sort order of returned newsletter lists, can contain "id", "-id", "name" and "-name" - string
  "limit" : 10, // maximum number of newsletter lists to return - int(1…100)
  "first" : 30 // index of the first newsletter list to return - int(0…)
}

response

{
  "status" : "ok",
  "lists" : [ {
    "id" : 5, // identifier - int(1…)
    "name" : { // name - string(2) -> string(0…80)
      "en" : "Special offers",
      "it" : "Offerte speciali"
    },
    "description" : { // description - string(2) -> string(0…255)
      "en" : "All the special offers of the week",
      "it" : "Tutte le offerte speciali della settimana"
    }
  }, … ]
}

newsletter-lists.get

Returns a newsletter list given its identifier.

JS
CR.api('site.newsletter-lists.get', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.newsletter-lists.get

request

{
  "id" : 5, // identifier of the newsletter list (required) - int(1…)
  "language" : "en", // language ( ISO code ) of the texts to return - string(2)
  "fields" : [ "id", "name", … ] // fields to return - string
}

response

{
  "status" : "ok",
  "list" : { // (can be null)
    "id" : 5, // identifier - int(1…)
    "name" : { // name - string(2) -> string(0…80)
      "en" : "Special offers",
      "it" : "Offerte speciali"
    },
    "description" : { // description - string(2) -> string(0…255)
      "en" : "All the special offers of the week",
      "it" : "Tutte le offerte speciali della settimana"
    }
  }
}

newsletter-lists.count

Total number of newsletter lists.

JS
CR.api('site.newsletter-lists.count', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.newsletter-lists.count

request

response

{
  "status" : "ok",
  "count" : 7 // number of newsletter lists - int(0…)
}

newsletter-lists.create

Creates a new newsletter list.

JS
CR.api('site.newsletter-lists.create', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.newsletter-lists.create

request

{
  "list" : {
    "name" : { // name - string(2) -> string(0…80)
      "en" : "Special offers",
      "it" : "Offerte speciali"
    },
    "description" : { // description - string(2) -> string(0…255)
      "en" : "All the special offers of the week",
      "it" : "Tutte le offerte speciali della settimana"
    }
  }
}

response

{
  "status" : "ok",
  "id" : 12 // identifier of the new newsletter list - int(1…)
}

newsletter-lists.update

Updates a newsletter list. Any fields left out of the request will remain unchanged.

JS
CR.api('site.newsletter-lists.update', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.newsletter-lists.update

request

{
  "id" : 12, // identifier of the newsletter list to update
  "list" : {
    "name" : { // name - string(2) -> string(0…80)
      "en" : "Special offers",
      "it" : "Offerte speciali"
    },
    "description" : { // description - string(2) -> string(0…255)
      "en" : "All the special offers of the week",
      "it" : "Tutte le offerte speciali della settimana"
    }
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
id NotFound Newsletter list <id> does not exist

newsletter-lists.delete

Deletes one o more newsletter lists.

JS
CR.api('site.newsletter-lists.delete', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.newsletter-lists.delete

request

{
  "ids" : [ 12, 7, … ] // identifiers of the newsletter lists to delete (required) - int(1…)
}

response

{
  "status" : "ok"
}