Page Resource

Page Resource

Get Pages

GET /api/pages.json

  • GET /api/pages.json will return all pages. See the Filter Pages endpoint for more info.

Example:

$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X GET \
http://shop_subdomain.versacommerce.de/api/pages.json

Status: 200 OK

[
  {
    "page": {
      "active": true,
      "content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit...",
      "content_meta_description": null,
      "content_meta_keywords": null,
      "content_title_tag": null,
      "created_on": "2013-10-08",
      "custom_url": null,
      "custom_url_routing": "standard_url_is_canonical",
      "format": "tinymce",
      "handle": "about-us",
      "height": null,
      "id": 100,
      "mall_id": null,
      "option_01": "",
      "option_02": "",
      "option_03": "",
      "properties_count": 0,
      "shop_id": 953,
      "title": "About us",
      "updated_on": "2013-10-08",
      "width": null
    }
  },
  {
    "page": {
      "active": true,
      "content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit...",
      "content_meta_description": null,
      "content_meta_keywords": null,
      "content_title_tag": null,
      "created_on": "2013-10-08",
      "custom_url": null,
      "custom_url_routing": "standard_url_is_canonical",
      "format": "tinymce",
      "handle": "shipping",
      "height": null,
      "id": 101,
      "mall_id": null,
      "option_01": null,
      "option_02": null,
      "option_03": null,
      "properties_count": 0,
      "shop_id": 953,
      "title": "Shipping",
      "updated_on": "2013-10-08",
      "width": null
    }
  }
]


Get Page

GET /api/pages/100.json

  • GET /api/pages/100.json will return the specified page.
Example:
curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X GET \
http://shop_subdomain.versacommerce.de/api/pages/100.json

Status: 200 OK

{
  "page": {
    "active": true,
    "content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit...",
    "content_meta_description": null,
    "content_meta_keywords": null,
    "content_title_tag": null,
    "created_on": "2013-10-08",
    "custom_url": null,
    "custom_url_routing": "standard_url_is_canonical",
    "format": "tinymce",
    "handle": "about-us",
    "height": null,
    "id": 7629,
    "mall_id": null,
    "option_01": null,
    "option_02": null,
    "option_03": null,
    "properties_count": 0,
    "shop_id": 953,
    "title": "About us",
    "updated_on": "2013-10-08",
    "width": null
  }
}


Create Page

POST /api/pages.json

  • POST /api/pages.json will create a new page from the parameters passed.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X POST \
-d \
'{
"page": {
"title": "This is my new page!",
"content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit..."
}
}' \
http://shop_subdomain.versacommerce.de/api/pages.json

Status: 201 Created

{
  "page": {
    "title": "This is my new page!",
    "content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit..."
  }
}

This will return 201 Created, with the location of the new page in the Location header along with the current JSON representation of the page if the creation was a success. See the Get page endpoint for more info.



Update Page

PUT /api/pages/1.json

  • PUT /api/pages/1.json will update the page from the parameters passed.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X PUT \
-d \
'{
"page": {
"title": "This is my new page title!",
"content": "This is my new Lorem ipsum dolor sit amet, consectetur adipisicing elit..."
}
}' \
http://shop_subdomain.versacommerce.de/api/pages/1.json

Status: 200 OK

{
  "page": {
    "title": "This is my new page title!",
    "content": "This is my new Lorem ipsum dolor sit amet, consectetur adipisicing elit..."
  }
}

This will return 200 OK if the update was a success along with the current JSON representation of the page. See the Get page endpoint for more info.



Delete Page

DELETE /api/pages/1.json

  • DELETE /api/pages/1.json will delete the page specified and return 200 OK if that was successful.
Example:

curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X DELETE \
http://shop_subdomain.versacommerce.de/api/pages/1.json

Status: 200 OK


Get Pages Count

GET /api/pages/count.json

  • GET /api/pages/count.json will return the pages count.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X GET \
http://shop_subdomain.versacommerce.de/api/pages/count.json

Status: 200 OK

{
  "count": 8
}


Filter Pages

GET /api/pages.json?filter_name 1 = filter_value 1 & filter_name 2 = filter_value 2

  • GET /api/pages.json?filter_name_1=filter_value_1&filter_name_2=filter_value_2 will return a filtered list of pages. See the Get pages endpoint for more info about the output.

Available Filters and Options

Filter / Name option
Description
Type
Parameter
limit
The amount of results, defaults to 150, maximum are 250
Integer
limit=10
offset
The amount of results to omit
Integer
offset=10
include
Include one or more page associations (format: properties, links, shop, …)
String
include=propertie
title
Filter by title
String
title=title
handle
Filter by handle
String
handle=handle


  • GET /api/pages.json?include=links will return all pages with all links to each page (nested). See the Get pages endpoint for more info about the output.


Example:

Status: 200 OK

[
  {
    "page": {
      "active": true,
      "content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit...",
      "content_meta_description": null,
      "content_meta_keywords": null,
      "content_title_tag": null,
      "created_on": "2013-10-08",
      "custom_url": null,
      "custom_url_routing": "standard_url_is_canonical",
      "format": "tinymce",
      "handle": "shipping",
      "height": null,
      "id": 101,
      "mall_id": null,
      "option_01": null,
      "option_02": null,
      "option_03": null,
      "properties_count": 0,
      "shop_id": 953,
      "title": "Shipping",
      "updated_on": "2013-10-08",
      "width": null,
      "links": [{
          "active": true,
          "auto_open": false,
          "children_count": 0,
          "handle": "shipping",
          "id": 10001,
          "linkable_id": 101,
          "linkable_type": "Page",
          "linklist_id": 1001,
          "links_to": "/pages/shipping",
          "name": "Shipping",
          "parent_id": null,
          "position": 19,
          "title_text": null
        },
        {
          "active": true,
          "auto_open": false,
          "children_count": 0,
          "handle": "shipping",
          "id": 10002,
          "linkable_id": 101,
          "linkable_type": "Page",
          "linklist_id": 1002,
          "links_to": "/pages/shipping",
          "name": "Shipping",
          "parent_id": null,
          "position": 3,
          "title_text": null
        }
      ]
    }
  }
]


    • Related Articles

    • Page

      Eine komplette Informations-Seite kann z.B. im page.liquid-Template so ausgegeben werden: <h1>{{ page.title }}</h1> {{ page.content }} page.content_meta_description {{ page.content_meta_description }} page.content_meta_keywords {{ ...
    • Page_title

      Gibt den Titel der aktuell angezeigten Seite zurück. Template Entsprechung oder Wert index.html Name der Startseite page.html Seitentitel product.html Produktname collection.html Kollektionsname cart.html Warenkorb
    • Metafield Resource

      Metafield Resource Get Metafields Get Metafield Create Metafield Update Metafield Delete Metafield Get Metafield Count Filter Metafields Get Metfields GET /api/metafields.json GET /api/metafields.json will return all Metafields. See the Filter ...
    • Product Image Resource

      Product Image Resource Bulk Create Or Update Delete Product Images Bulk Create or Update PUT /api/products/1/.json PUT /api/products/1.json will create or update the product images from the parameters passed. Example: $ curl -s \ -H 'Accept: ...
    • Product Resource

      Product Associations Product Properties Product Recommendations Create Product POST /api/products.json POST /api/products.json will create a new product from the parameters passed. Example: $ curl -s \ -H 'Accept: application/json' \ -H ...