pages

pages.find

Returns all the pages.

JS
CR.api('site.pages.find', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.pages.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 pages, can contain "id", "-id", "name", "-name", "templatePage" and "-templatePage" - string
  "limit" : 10, // maximum number of pages to return - int(1…100)
  "first" : 30 // index of the first page to return - int(0…)
}

response

{
  "status" : "ok",
  "pages" : [ {
    "id" : 12, // identifier - int(1…)
    "name" : "contacts", // name - string(1…120)
    "title" : { // title - string(0…80)
      "en" : "About Us",
      "it" : "Chi Siamo"
    },
    "content" : { // content as HTML - string(2) -> string(0…65535)
      "en" : "Our company...",
      "it" : "La nostra azienda..."
    },
    "seoTitle" : { // title for SEO - string(2) ->string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "seoKeywords" : { // keywords for SEO - string(2) ->string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "seoDescription" : { // description for SEO - string(2) ->string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "templatePage" : "about-us.html", // template page used for the site - string(0…100)
    "isSystemPage" : false, // indicates if it is a system page - bool
    "image" : { // image (can be null)
      "url" : "http://…", // url - string(53…255)
      "width" : 350, // width in pixels - int(1…1000)
      "height" : 200, // height in pixels - int(1…1000)
      "align" : "Left", // alignment, can be "Left", "Center" or "Right"
      "caption" : "" // caption - string(0…80)
    },
    "productsLayout" : { // layout of the products on the page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    },
    "isAlwaysVisible" : true // indicates if it is always visible - bool
  }, … ]
}

pages.get

Returns a page given its identifier.

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

request

{
  "id" : 12, // identifier of the page (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",
  "page" : { // (can be null)
    "id" : 12, // identifier - int(1…)
    "name" : "contacts", // name - string(1…120)
    "title" : { // title - string(0…80)
      "en" : "About Us",
      "it" : "Chi Siamo"
    },
    "content" : { // content as HTML - string(2) -> string(0…65535)
      "en" : "Our company...",
      "it" : "La nostra azienda..."
    },
    "seoTitle" : { // title for SEO - string(2) ->string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "seoKeywords" : { // keywords for SEO - string(2) ->string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "seoDescription" : { // description for SEO - string(2) ->string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "templatePage" : "about-us.html", // template page used for the site - string(0…100)
    "isSystemPage" : false, // indicates if it is a system page - bool
    "image" : { // image (can be null)
      "url" : "http://…", // url - string(53…255)
      "width" : 350, // width in pixels - int(1…1000)
      "height" : 200, // height in pixels - int(1…1000)
      "align" : "Left", // alignment, can be "Left", "Center" or "Right"
      "caption" : "" // caption - string(0…80)
    },
    "productsLayout" : { // layout of the products on the page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    },
    "isAlwaysVisible" : true // indicates if it is always visible - bool
  }
}

pages.count

Total number of pages.

JS
CR.api('site.pages.count', null, function(response) { … });
HTTP
POST /open2b/api/v3/site.pages.count

response

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

pages.create

Creates a new page.

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

request

{
  "page" : { // page to create (required) 
    "name" : "contacts", // name - string(1…120)
    "title" : { // title - string(2) -> string(0…80)
      "en" : "About Us",
      "it" : "Chi Siamo"
    },
    "content" : { // content as HTML - string(2) -> string(0…65535)
      "en" : "Our company…",
      "it" : "La nostra azienda…"
    },
    "seoTitle" : { // title for SEO - string(2) -> string(0…255)
      "en" : "",
      "it" : ""
    },
    "seoKeywords" : { // keywords for SEO - string(2) -> string(0…255)
      "en" : "",
      "it" : ""
    },
    "seoDescription" : { // description for SEO - string(2) -> string(0…255)
      "en" : "",
      "it" : ""
    },
    "templatePage" : "shirts.html", // template page used for the site - string(0…100)
    "image" : { // image (can be null)
      "name" : "page.jpg", // file name - string(1…255)
      "content" : "N3R…zaA==" // content encoded in base64 - string
    },
    "imageAlign" : "Center", // alignment of the image, can be "Left", "Center" or "Right" -- "Left"
    "imageCaption" : "", // image caption - string(0..80)
    "productsLayout" : { // layout of the products on the page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    },
    "isAlwaysVisible" : true // indicates if it is always visible - bool
  }
}

response

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

Errors

Field Type Description
image Malformed Image width and height must be less than 2500 pixels
image Malformed File format is not a valid or supported format
templatePage InvalidValue '<templatePage>' is not a valid template page

pages.update

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

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

request

{
  "id" : 12, // identifier of the page to update (required) - int(1…)
  "page" : { // pages's fields to update (required)
    "name" : "contacts", // name - string(1…120)
    "title" : { // title - string(2) -> string(0…80)
      "en" : "About Us",
      "it" : "Chi Siamo"
    },
    "content" : { // content as HTML - string(2) -> string(0…65535)
      "en" : "Our company…",
      "it" : "La nostra azienda…"
    },
    "seoTitle" : { // title for SEO - string(2) -> string(0…255)
      "en" : "",
      "it" : ""
    },
    "seoKeywords" : { // keywords for SEO - string(2) -> string(0…255)
      "en" : "",
      "it" : ""
    },
    "seoDescription" : { // description for SEO - string(2) -> string(0…255)
      "en" : "",
      "it" : ""
    },
    "templatePage" : "about-us.html", // template page used for the site - string(0…100)
    "image" : { // image (can be null)
      "name" : "page.jpg", // file name - string(1…255)
      "content" : "N3R…zaA==" // content encoded in base64 - string
    },
    "imageAlign" : "Center", // alignment of the image, can be "Left", "Center" or "Right" -- "Left"
    "imageCaption" : "", // image caption - string(0..80)
    "productsLayout" : { // layout of the products on the page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    },
    "isAlwaysVisible" : true // indicates if it is always visible - bool
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
id NotFound Page <id> does not exist
image Malformed Image width and height must be less than 2500 pixels
image Malformed File format is not a valid or supported format
templatePage InvalidValue '<templatePage>' is not a valid template page

pages.delete

Deletes one o more pages.

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

request

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

response

{
  "status" : "ok"
}