CMS Export

POST /api/cms/search/

Export CMS pages matched by an ElasticSearch query.

GET /api/cms/page/(ObjectId: page_id)/
GET /api/cms/page/

Fetch the most recent CMS page version in a format ready for exports.

Example Requests:

GET /api/cms/page/570bab9d08b1991a3a102567/?breadcrumbs=0 HTTP/1.1
GET /api/cms/page/?host=example.com&url=/&lang=en HTTP/1.1

When not using page_id, both query parameters host and url are required. Language will fallback to the system default if not specified.

Example Response:

This sample API response contains all possible export fields for a page, excluding children.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "attributes": {
    "my_field": {
      "de": "Mein Attribut",
      "en": "My attribute"
    },
    "header_image": {
      "atime": "2016-03-23T09:39:04",
      "ctime": "2016-03-23T09:39:04",
      "filename": "lexus.jpg",
      "id": "56f2562808b199377dfcd985",
      "mtime": "2016-03-23T09:39:04",
      "path": "cars/lexus.jpg"
    }
  },
  "attributes_desc": {
    "my_field": {
      "datatype": "string",
      "multilingual": true
    },
    "header_image": {
      "datatype": "media",
      "multilingual": false
    }
  },
  "blocks": {
    "header": [
      {
        "attributes": {
          "color": "#ff40ff"
        },
        "attributes_desc": {
          "color": {
            "datatype": "color",
            "multilingual": false
          }
        },
        "id": "57e0e26908b199ec3f47a120",
        "is_active": true,
        "is_hidden": false,
        "restriction": "",
        "type": {
          "key": "block_bool_color"
        },
        "valid_from": null,
        "valid_until": null
      }
    ]
  },
  "breadcrumbs": [
    {
      "id": "57b41c5508b199775c1815d1",
      "pagetype": {
        "key": "index"
      },
      "title": {
        "de": "Home"
      },
      "url": {
        "de": "/",
        "en": "/"
      }
    }
  ],
  "children": null,
  "id": "570bab9d08b1991a3a102567",
  "inherited_attributes": null,
  "is_active": true,
  "is_hidden": false,
  "metatags": {
    "author": "John Doe",
    "created": "2016-08-17T10:12:05",
    "modified": "2016-09-20T09:07:04",
    "title": {
      "de": "Tolle Produkte",
      "en": "Great Products"
    },
    "valid": [
      "2016-09-20T00:00:00",
      "2016-09-30T00:00:00"
    ]
  },
  "restriction": "",
  "status": "published",
  "title": {
    "de": "Tolle Produkte",
    "en": "Great Products",
  },
  "type": {
    "key": "productpage"
  },
  "url": {
    "de": "/tolle-produkte/",
    "en": "/great-products/",
  },
  "valid_from": "2016-09-20T00:00:00",
  "valid_until": "2016-09-30T00:00:00",
  "version": 2
}
Parameters
  • page_id (ObjectId) – Page ID to fetch. If omitted, the query params url and lang are required.

Query Parameters
  • host (str) – The requesting host for this page, should be a valid domain or IP. Required.

  • lang (str) – Language code (must be one of configured languages). Required.

  • url (str) – The URL path of the requested page. Defaults to system default.

  • inactive (bool) – Return the page even if it is currently inactive.

  • deleted (bool) – Return the page even if it was deleted.

  • version (int) – Request a specific version. Will fallback to latest if a future version is requested. Set to draft to get unpublished pages. Defaults to latest.

  • get_parent (bool) – Export the parent page instead of the matched one.

  • attributes (bool|list) – Include attributes or only these specific attributes. Defaults to 1 (all attributes).

  • langs (list) – Restrict multilingual attributes to only these specific languages.

  • attributes_desc (bool) – Add attribute descriptions (datatype, i18n, …).

  • inherited_attributes (bool) – Include inherited attributes.

  • append_slash (bool) – Append a trailing slash to all URLs. Defaults to 1.

  • absolute_urls (bool) – Generate absolute URLs instead of relative.

  • breadcrumbs (bool) – Include a breadcrumb navigation up to this page. Defaults to 1.

  • blocks (bool) – Include content blocks.

  • children (int) – Levels of children to include.

  • references (bool) – List linked models on this page.

Note

references are currently not implemented.