blog-posts

blog-posts.find

Returns all the blog posts.

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

request

{
  "language" : "en", // language ( ISO code ) of the texts to return - string(2)
  "fields" : [ "id", "author", "title", … ], // fields to return - string
  "order" : [ "title" ], // sort order of returned blog posts, can contain "id", "-id", "title", "-title", "creationTime" and "-creationTime", "updateTime", "-updateTime", "publicationTime", "-publicationTime" - string
  "limit" : 10, // maximum number of blog posts to return - int(1…100)
  "first" : 30 // index of the first page to return - int(0…)
}

response

{
  "status" : "ok",
  "posts" : [ {
    "id" : 71, // identifier - int(1…)
    "author" : "Mark", // author - string(0…50)
    "title" : { // title - string(0…120)
      "en" : "",
      "it" : ""
    },
    "summary" : { // summary as HTML - string(2) -> string(0…65535)
      "en" : "Our company...",
      "it" : "La nostra azienda..."
    },
    "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" : "…"
    },
    "originalImage" : { // original image (can be null)
      "url" : "http://…", // url - string
      "width" : 350, // width in pixels - int(1…)
      "height" : 200 // height in pixels - int(1…)
    },
    "smallImage" : { // small image (can be null)
      "url" : {
        "single" : http://…", // image url - string(10…)
        "double" : http://…" //  double resolution image url (can be null) - string(10…)
      },
      "width" : 500, // width in pixels - int(1…)
      "height" : 400, // height in pixels - int(1…)
    },
    "largeImage" : { // large image (can be null)
      "url" : {
        "single" : http://…", // image url - string(10…)
        "double" : http://…" //  double resolution image url (can be null) - string(10…)
      },
      "width" : 1000, // width in pixels - int(1…)
      "height" : 800, // height in pixels - int(1…)
    },
    "imageCaption" : { // image caption - string(0…60)
      "en" : "…",
      "it" : "…"
    },
    "isPublished" : true, // indicates if the post is published - bool
    "creationTime" : "2016-03-12 09:12:36", // creation time -- datetime
    "updateTime" : "2016-03-15 12:23:05", // creation time -- datetime
    "publicationTime" : "2016-03-13 18:12:44" // publication time -- datetime
  }, … ]
}

blog-posts.get

Returns a blog post given its identifier.

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

request

{
  "id" : 71, // identifier of the blog post (required) - int(1…)
  "language" : "en", // language ( ISO code ) of the texts to return - string(2)
  "fields" : [ "id", "author", "title", … ] // fields to return - string
}

response

{
  "status" : "ok",
  "post" : { // (can be null)
    "id" : 71, // identifier - int(1…)
    "author" : "Mark", // author - string(0…50)
    "title" : { // title - string(0…120)
      "en" : "",
      "it" : ""
    },
    "summary" : { // summary as HTML - string(2) -> string(0…65535)
      "en" : "Our company...",
      "it" : "La nostra azienda..."
    },
    "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" : "…"
    },
    "originalImage" : { // original image (can be null)
      "url" : "http://…", // url - string
      "width" : 350, // width in pixels - int(1…)
      "height" : 200 // height in pixels - int(1…)
    },
    "smallImage" : { // small image (can be null)
      "url" : {
        "single" : http://…", // image url - string(10…)
        "double" : http://…" //  double resolution image url (can be null) - string(10…)
      },
      "width" : 500, // width in pixels - int(1…)
      "height" : 400, // height in pixels - int(1…)
    },
    "largeImage" : { // large image (can be null)
      "url" : {
        "single" : http://…", // image url - string(10…)
        "double" : http://…" //  double resolution image url (can be null) - string(10…)
      },
      "width" : 1000, // width in pixels - int(1…)
      "height" : 800, // height in pixels - int(1…)
    },
    "imageCaption" : { // image caption - string(0…60)
      "en" : "…",
      "it" : "…"
    },
    "isPublished" : true, // indicates if the post is published - bool
    "creationTime" : "2016-03-12 09:12:36", // creation time -- datetime
    "updateTime" : "2016-03-15 12:23:05", // creation time -- datetime
    "publicationTime" : "2016-03-13 18:12:44" // publication time -- datetime
  }
}

blog-posts.count

Total number of blog posts.

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

response

{
  "status" : "ok",
  "count" : 83 // number of blog posts - int(0…)
}

blog-posts.create

Creates a new blog post.

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

request

{
  "post" : { // blog post to create (required) 
    "author" : "Mark", // author - string(0…50)
    "title" : { // title - string(0…120)
      "en" : "",
      "it" : ""
    },
    "summary" : { // summary as HTML - string(2) -> string(0…65535)
      "en" : "Our company...",
      "it" : "La nostra azienda..."
    },
    "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" : "…"
    },
    "image" : { // image (can be null)
      "name" : "page.jpg", // file name - string(1…255)
      "content" : "N3R…zaA==" // content encoded in base64 - string
    },
    "imageCaption" : { // image caption - string(0…60)
      "en" : "…",
      "it" : "…"
    },
    "publicationTime" : "2016-03-13 18:12:44" // publication time -- datetime
}

response

{
  "status" : "ok",
  "id" : 71 // identifier of the blog post - int(1…)
}

blog-posts.update

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

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

request

{
  "id" : 71, // identifier of the blog post to update (required) - int(1…)
  "post" : { // blog post to update (required) 
    "author" : "Mark", // author - string(0…50)
    "title" : { // title - string(0…120)
      "en" : "",
      "it" : ""
    },
    "summary" : { // summary as HTML - string(2) -> string(0…65535)
      "en" : "Our company...",
      "it" : "La nostra azienda..."
    },
    "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" : "…"
    },
    "image" : { // image (can be null)
      "name" : "page.jpg", // file name - string(1…255)
      "content" : "N3R…zaA==" // content encoded in base64 - string
    },
    "imageCaption" : { // image caption - string(0…60)
      "en" : "…",
      "it" : "…"
    },
    "publicationTime" : "2016-03-13 18:12:44" // publication time -- datetime
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
id NotFound Blog post <id> does not exist

blog-posts.delete

Deletes one o more blog posts.

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

request

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

response

{
  "status" : "ok"
}