Change theme:   

Pages

Pages resource is located at /admin/api/pages.

Summary of page endpoints

Get data for a single page

GET - /admin/api/pages/1

Example request:

GET - http://helloworld.edicy.co/admin/api/pages/2

Example response:

Status: 200 OK
{
  "id": 2,
  "title": "Products",
  "slug": "products",
  "path": "products",
  "content_type": "page",
  "keywords": null,
  "description": null,
  "data": {
    "my_key_1": "Value 1",
    "my_key_2": 2
  },
  "root": false,
  "hidden": false,
  "publishing": true,
  "isprivate": false,
  "created_at": "2013-12-13T09:19:04.000Z",
  "updated_at": "2014-01-03T12:14:34.000Z",
  "published_at": "2013-12-13T09:19:04.000Z",
  "url": "http://helloworld.edicy.co/admin/api/pages/2",
  "public_url": "http://helloworld.edicy.co/products",
  "language": {
    "id": 1,
    "code": "en",
    "title": "ENG",
    "created_at": "2013-04-05T13:54:32.000Z",
    "updated_at": "2013-04-11T10:09:51.000Z"
  },
  "layout": {
    "id": 2,
    "title": "Common page",
    "layout_name": "page_default",
    "content_type": "page",
    "created_at": "2013-04-05T13:54:32.000Z",
    "updated_at": "2013-04-11T10:09:51.000Z"
  },
  "node": {
    "id": 2,
    "parent_id": 1,
    "title": "Products",
    "position": 2,
    "created_at": "2013-12-13T09:19:04.000Z",
    "updated_at": "2014-01-03T12:14:34.000Z"
  }
}

Update attributes of a page

PUT - /admin/api/pages/1

This request updates the article with provided attributes. NB! Currently only attribute data is allowed to update.

Example request:

PUT - http://helloworld.edicy.co/admin/api/pages/3

Example data):

{
  "page": {
    "title": "About",
    "slug": "about",
    "description": "We are a small crew of designers and developers passionate about usability.",
    "data": {
      "key_1": "value_1",
      "key_2": "value_2"
    }
  }
}

Example response:

Status: 200 OK
{
  "id": 3,
  "title": "About",
  "slug": "about",
  "path": "about",
  "content_type": "page",
  "keywords": null,
  "description": "We are a small crew of designers and developers passionate about usability.",
  "data" : {
    "key_1": "value_1",
    "key_2": "value_2"
  },
  "root": false,
  "hidden": false,
  "publishing": true,
  "isprivate": false,
  "created_at": "2014-01-10T09:19:04.000Z",
  "updated_at": "2014-01-10T10:10:10.000Z",
  "published_at": "2014-01-10T10:10:10.000Z",
  "url": "http://helloworld.edicy.co/admin/api/pages/3",
  "public_url": "http://helloworld.edicy.co/contacts",
  "language": {
    "id": 1,
    "code": "en",
    "title": "ENG",
    "created_at": "2013-04-05T13:54:32.000Z",
    "updated_at": "2013-04-11T10:09:51.000Z",
    "url": "http://helloworld.edicy.co/admin/api/languages/1"
  },
  "layout": {
    "id": 2,
    "title": "Common page",
    "layout_name": "page_default",
    "content_type": "page",
    "created_at": "2013-04-05T13:54:32.000Z",
    "updated_at": "2013-04-11T10:09:51.000Z"
  },
  "node": {
    "id": 3,
    "parent_id": 1,
    "title": "Contacts",
    "position": 3,
    "created_at": "2014-01-10T09:19:04.000Z",
    "updated_at": "2014-01-10T09:19:04.000Z"
  }
}

Parameters

Optional parameters:

  • data - key/value based custom hash store. (NB! Keys with prefix edicy_ is protected and read only.)

Update custom data field of a page

PUT - /admin/api/pages/1/data/key

Updates or adds a new key to page data keyset.

Example request:

PUT - http://helloworld.edicy.co/admin/api/pages/2/data/my_key_1

Example data:

{
  "value": "new value"
}

Example response:

Status: 200 OK
{
  "id": 2,
  "title": "Products",
  "slug": "products",
  "path": "products",
  "content_type": "page",
  "keywords": null,
  "description": null,
  "data": {
    "my_key_1": "new value",
    "my_key_2": "value_2"
  },
  "root": false,
  "hidden": false,
  "publishing": true,
  "isprivate": false,
  "created_at": "2013-12-13T09:19:04.000Z",
  "updated_at": "2014-01-10T12:14:34.000Z",
  "published_at": "2014-01-10T09:19:04.000Z",
  "url": "http://helloworld.edicy.co/admin/api/pages/2",
  "public_url": "http://helloworld.edicy.co/products",
  "language": {
    "id": 1,
    "code": "en",
    "title": "ENG",
    "created_at": "2013-04-05T13:54:32.000Z",
    "updated_at": "2013-04-11T10:09:51.000Z"
  },
  "layout": {
    "id": 2,
    "title": "Common page",
    "layout_name": "page_default",
    "content_type": "page",
    "created_at": "2013-04-05T13:54:32.000Z",
    "updated_at": "2013-04-11T10:09:51.000Z"
  },
  "node": {
    "id": 2,
    "parent_id": 1,
    "title": "Products",
    "position": 2,
    "created_at": "2013-12-13T09:19:04.000Z",
    "updated_at": "2014-01-03T12:14:34.000Z"
  }
}

Remove custom field of a page

DELETE - /admin/api/pages/1/data/key

Example request:

DELETE - http://helloworld.edicy.co/admin/api/pages/2/data/my_key_1

Example response:

Status: 204 No Content