Stories

Get a list of stories

Endpoint

GET /v1/cdn/stories

Parameters

Name Description
token required Public token for published or private token for draft version
with_tag Is tagged by
starts_with Starts with slug
version Published or draft version
sort_by Sort by parameter. Example: 'name:asc'
filter_by Filter by
per_page Per page
page Page

Request

Query Parameters

token=4fSrTsik2rFUuabLYLrx5Att

version=published
sort_by=name:asc

cURL

curl "http://localhost:3001/v1/cdn/stories?token=4fSrTsik2rFUuabLYLrx5Att&version=published&sort_by=name%3Aasc" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Body

{
  "stories": [
    {
      "name": "Home",
      "created_at": "2017-10-12T08:40:29.027Z",
      "published_at": "2017-10-12T00:00:00.000Z",
      "alternates": [

      ],
      "id": 279,
      "uuid": "c6b4d6fc-6e93-4c31-8bb7-04b04eeac0b7",
      "content": null,
      "slug": "home",
      "full_slug": "home",
      "sort_by_date": null,
      "tag_list": [
        "spicy",
        "red"
      ],
      "is_startpage": false,
      "parent_id": 0,
      "meta_data": null,
      "group_id": "66524f10-1393-4e88-a5ce-39646ac31e66"
    },
    {
      "name": "Home2",
      "created_at": "2017-10-12T08:40:29.042Z",
      "published_at": "2017-10-12T00:00:00.000Z",
      "alternates": [

      ],
      "id": 280,
      "uuid": "c1c30ca5-b277-4928-9879-eae781af3743",
      "content": null,
      "slug": "home",
      "full_slug": "home/",
      "sort_by_date": null,
      "tag_list": [
        "spicy",
        "red"
      ],
      "is_startpage": true,
      "parent_id": 279,
      "meta_data": null,
      "group_id": "2d97ba4c-5523-438f-b462-40dbaaeb67b1"
    },
    {
      "name": "Home3",
      "created_at": "2017-10-12T08:40:29.055Z",
      "published_at": "2017-10-12T00:00:00.000Z",
      "alternates": [

      ],
      "id": 281,
      "uuid": "4a63947f-42d8-4c46-a864-0258cf7b4c40",
      "content": null,
      "slug": "home3",
      "full_slug": "home3",
      "sort_by_date": null,
      "tag_list": [
        "blue",
        "white"
      ],
      "is_startpage": false,
      "parent_id": 0,
      "meta_data": null,
      "group_id": "70434536-d1f8-4a1e-b2d2-1b2b89012a86"
    }
  ]
}

Get a list of stories with the component news

Endpoint

GET /v1/cdn/stories

Parameters

Name Description
token required Public token for published or private token for draft version
filter_by Filter by

Request

Query Parameters

token=GV3f169LMSdNf5F4wJI8bAtt

filter_by[component]=news

cURL

curl "http://localhost:3001/v1/cdn/stories?token=GV3f169LMSdNf5F4wJI8bAtt&filter_by[component]=news" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Body

{
  "stories": [
    {
      "name": "Home3",
      "created_at": "2017-10-12T08:40:29.727Z",
      "published_at": "2017-10-12T00:00:00.000Z",
      "alternates": [

      ],
      "id": 301,
      "uuid": "c2a3a1e6-a12b-4cd3-a584-164693af7529",
      "content": null,
      "slug": "home3",
      "full_slug": "home3",
      "sort_by_date": null,
      "tag_list": [
        "blue",
        "white"
      ],
      "is_startpage": false,
      "parent_id": 0,
      "meta_data": null,
      "group_id": "d612dce6-7af1-4a7b-8164-9136f96209af"
    }
  ]
}

Get a list of stories with the option red

Endpoint

GET /v1/cdn/stories

Parameters

Name Description
token required Public token for published or private token for draft version
filter_by Filter by array

Request

Query Parameters

token=bvkJ4nXy1PSZZdIfGOzpQgtt

filter_by[options][]=red

cURL

curl "http://localhost:3001/v1/cdn/stories?token=bvkJ4nXy1PSZZdIfGOzpQgtt&filter_by[options][]=red" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Body

{
  "stories": [
    {
      "name": "Home3",
      "created_at": "2017-10-12T08:40:29.904Z",
      "published_at": "2017-10-12T00:00:00.000Z",
      "alternates": [

      ],
      "id": 305,
      "uuid": "d592d642-df69-4464-b89d-dd10e75f4c16",
      "content": null,
      "slug": "home3",
      "full_slug": "home3",
      "sort_by_date": null,
      "tag_list": [
        "blue",
        "white"
      ],
      "is_startpage": false,
      "parent_id": 0,
      "meta_data": null,
      "group_id": "36b080bc-d06d-41de-96e1-f8a7bd60361c"
    }
  ]
}

Get a story by slug

Endpoint

GET /v1/cdn/stories/:story_slug

Parameters

Name Description
token required Public token for published or private token for draft version
version Published or draft version

Request

Query Parameters

token=OrrOgrUITSMRjnrhtLGXzgtt

cURL

curl "http://localhost:3001/v1/cdn/stories/home?token=OrrOgrUITSMRjnrhtLGXzgtt" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Body

{
  "story": {
    "name": "Home2",
    "created_at": "2017-10-12T08:40:30.262Z",
    "published_at": "2017-10-12T00:00:00.000Z",
    "alternates": [

    ],
    "id": 316,
    "uuid": "2473e7ab-c8c5-47e1-b365-fccfd6f03f9a",
    "content": null,
    "slug": "home",
    "full_slug": "home/",
    "sort_by_date": null,
    "tag_list": [
      "spicy",
      "red"
    ],
    "is_startpage": true,
    "parent_id": 315,
    "meta_data": null,
    "group_id": "df86c561-e490-4b46-9f8e-cf5fae7acb1d"
  }
}

Get a list of stories sorted by content key

If you want to sort by a parameter on a parameter of your root component you can do that providing a dot after the content keyword (Example: content.component).

Endpoint

GET /v1/cdn/stories

Parameters

Name Description
token required Public token for published or private token for draft version
sort_by Sort by parameter

Request

Query Parameters

token=41dRhuh0ra0LtshvyOvJxAtt

sort_by=content.component:asc

cURL

curl "http://localhost:3001/v1/cdn/stories?token=41dRhuh0ra0LtshvyOvJxAtt&sort_by=content.component%3Aasc" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Body

{
  "stories": [
    {
      "name": "Home3",
      "created_at": "2017-10-12T08:40:29.348Z",
      "published_at": "2017-10-12T00:00:00.000Z",
      "alternates": [

      ],
      "id": 289,
      "uuid": "dc68d595-c98a-468c-9411-6d8fd963e5a7",
      "content": null,
      "slug": "home3",
      "full_slug": "home3",
      "sort_by_date": null,
      "tag_list": [
        "blue",
        "white"
      ],
      "is_startpage": false,
      "parent_id": 0,
      "meta_data": null,
      "group_id": "2e361a45-d2c1-4e4c-82f1-a86fef28809b"
    },
    {
      "name": "Home2",
      "created_at": "2017-10-12T08:40:29.331Z",
      "published_at": "2017-10-12T00:00:00.000Z",
      "alternates": [

      ],
      "id": 288,
      "uuid": "29befefa-a1f5-4c6b-9f57-34c086d801b4",
      "content": null,
      "slug": "home",
      "full_slug": "home/",
      "sort_by_date": null,
      "tag_list": [
        "spicy",
        "red"
      ],
      "is_startpage": true,
      "parent_id": 287,
      "meta_data": null,
      "group_id": "d04d780e-ccc9-4e25-aa13-fdf0cb4345c0"
    },
    {
      "name": "Home",
      "created_at": "2017-10-12T08:40:29.316Z",
      "published_at": "2017-10-12T00:00:00.000Z",
      "alternates": [

      ],
      "id": 287,
      "uuid": "1e013a26-1b4d-41f0-8fb9-ef3ab5c018e0",
      "content": null,
      "slug": "home",
      "full_slug": "home",
      "sort_by_date": null,
      "tag_list": [
        "spicy",
        "red"
      ],
      "is_startpage": false,
      "parent_id": 0,
      "meta_data": null,
      "group_id": "2c898f4d-b5f0-4d15-9161-173d670c9c46"
    }
  ]
}

Documentation