Skip to main content

Blog

The Blog API returns the store's blogs and the articles inside a blog. Both endpoints are open to anonymous visitors.

All Ajax API requests should use locale-aware URLs to give visitors a consistent experience.

List the blogs of the store

GET /{locale}/api/front/blogs

List the blogs of the store, with the article count and the storefront path of each blog. Takes no parameters.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/front/blogs')
.then((response) => response.json())
.then((data) => {
// do something...
});

Response

    countnumber

    Number of blogs returned.

    blogs object[]

    Blogs the article belongs to.

  • Array [
  • idstring

    ID of the blog.

    titlestring

    Title of the blog.

    descriptionstringnullable

    Description of the blog.

    seo_titlestring

    SEO title.

    seo_descriptionstring

    SEO description.

    seo_keywordsundefined[]

    SEO keywords.

    handlestring

    URL-friendly handle used in the resource URL.

    seo_urlstring

    Relative URL of the blog.

    article_countnumber

    Number of articles in the blog.

    created_atstring

    Creation time, in ISO-8601 format.

    updated_atstring

    Last update time, in ISO-8601 format.

  • ]

List the articles of a blog

GET /{locale}/api/front/blogs/{blog_slug}/articles

List the articles of one blog, where blog_slug is the handle of the blog.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/front/blogs/ajax-probe/articles?page=1&per_page=5')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    blog_slugstring

    The handle of the blog.

    pagenumber

    The page of articles to return.

    per_pagenumber

    The number of articles per page.

Response

    countnumber

    Number of articles returned.

    articles object[]

    List of articles.

  • Array [
  • idstring

    ID of the article.

    titlestring

    Title of the article.

    excerptstring

    Short summary of the article.

    authorstring

    Author of the article.

    imagestringnullable

    Image attached to the article.

    published_atstringnullable

    Publication time, in ISO-8601 format.

    handlestring

    URL-friendly handle used in the resource URL.

    urlstring

    Relative URL of the article.

    blogs object[]

    Blogs the article belongs to.

  • Array [
  • idstring

    ID of the blog.

    titlestring

    Title of the blog.

    urlstring

    Relative URL of the blog.

    handlestring

    URL-friendly handle used in the resource URL.

  • ]
  • ]