Reference

Guide

/api/pages/:id

Retrieve a page

GET: /api/pages/:id

Query parameters

Parameter Example Description
pretty ?pretty=true Pretty prints the result. Only useful for debugging.
select ?select=filename,niceSize Defines the fields that will be returned for the page.

Page fields

The following fields are available in the page model and can be fetched with the select parameter:

  • blueprint
  • blueprints
  • children
  • content
  • drafts
  • errors
  • files
  • hasChildren
  • hasDrafts
  • id
  • isSortable
  • next
  • num
  • options
  • panelIcon
  • panelImage
  • parent
  • parents
  • prev
  • previewUrl
  • siblings
  • slug
  • status
  • template
  • title
  • url

Example response

GET: /api/pages/projects+trees-and-stars-and-stuff
{
    "code": 200,
    "data": {
        "content": {
            "title": "Trees and stars and stuff",
            "year": 2018,
            "text": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. …",
            "headline": null,
            "tags": [
                {
                    "value": "nature",
                    "text": "nature"
                },
                {
                    "value": "sky",
                    "text": "sky"
                },
                {
                    "value": "tree",
                    "text": "tree"
                }
            ],
            "intro": "Isn't that a beautiful tree? The sky doesn't look bad either."
        },
        "id": "projects/trees-and-stars-and-stuff",
        "num": 1,
        "options": {
            "changeSlug": true,
            "changeStatus": true,
            "changeTemplate": false,
            "changeTitle": true,
            "create": true,
            "delete": true,
            "read": true,
            "preview": true,
            "sort": true,
            "update": true
        },
        "parent": {
            "id": "projects",
            "num": 1,
            "title": "Projects",
            "url": "http://kir.by/projects"
        },
        "slug": "trees-and-stars-and-stuff",
        "status": "listed",
        "template": "project",
        "title": "Trees and stars and stuff",
        "url": "http://kir.by/projects/trees-and-stars-and-stuff"
    },
    "status": "ok",
    "type": "model"
}