Entries | Flextype

Entries

Rest API

The Flextype Entries API organized around Representational State Transfer (REST) for delivering entries from Flextype to apps, websites and other. Entries is delivered as JSON data.

Endpoints

Method Endpoint Description
GET /api/entries Fetch entry(entries)
POST /api/entries Create entry
PATCH /api/entries Update entry
PUT /api/entries Rename entry
PUT /api/entries/copy Copy entry(entries)
DELETE /api/entries Delete entry

Fetch single entry

Request
GET /api/entries?id=YOUR_ENTRY_ID&token=YOUR_ENTRIES_TOKEN
Query
Name Description
id REQUIRED Valid Entry ID (slug)
filter OPTIONAL A set of valid arguments to search and sort specific needed entries.
token REQUIRED Valid Entries Token.
Result

Returns the item object for the given unique identifier.

Examples

Fetch Movies Entry

Request
GET /api/entries?id=movies&token=6f047babd1894064fbf7662080a9a2f0

Fetch entries collection

Request
GET /api/entries?id=YOUR_ENTRY_ID&filter[]&token=YOUR_ENTRIES_TOKEN
Query
Name Description
id REQUIRED Valid Entry ID (slug)
filter REQUIRED A set of valid arguments to search and sort specific needed entries.
token REQUIRED Valid Entries Token.
Result

Returns an array of item objects.

Examples

Fetch Movies Collection

Request
GET /api/entries?id=movies&filter[]&token=6f047babd1894064fbf7662080a9a2f0

Fetch Movies Collection where director is equal to Cathy Yan

Request
GET /api/entries?id=movies&filter[where][key]=director&filter[where][expr]=eq&filter[where][value]=Cathy+Yan&token=6f047babd1894064fbf7662080a9a2f0

Fetch Movies Collection where director is equal to Cathy Yan and where year is equal to 2020 and where genre is contains action

Request
GET /api/entries?id=movies&filter[where][key]=director&filter[where][expr]=eq&filter[where][value]=Cathy+Yan&filter[and_where][0][key]=year&filter[and_where][0][expr]=eq&filter[and_where][0][value]=2020&filter[and_where][1][key]=genre&filter[and_where][1][expr]=contains&filter[and_where][1][value]=drama&token=6f047babd1894064fbf7662080a9a2f0

Filtering

With the filter query you're able to search items in a collection that matches the filter's conditions.

filter is an array of valid values for collect_filter() and find_filter() functions.

Create entry

Request
POST /api/entries
Body
Name Description
id REQUIRED Unique identifier of the entry.
token REQUIRED Valid Entries token.
access_token REQUIRED Valid Access token.
data REQUIRED Data to store for the entry.
Result

Returns the entry item object for the entry item that was just created.

Examples

Create new entry platform

Request
POST /api/entries
Body
{
    "id": "movies/platform",
    "token": "f3acf199a9ac120d3bfd604e1e382456",
    "access_token": "bbc4417d171e38099bd129aeca279018",
    "data": {
        "title": "Platform",
        "content": "The Platform (Spanish: El hoyo, transl. The Hole) is a Spanish science fiction horror-thriller film, directed by Galder Gaztelu-Urrutia and released in 2019."
    }
}
Response
200 OK
{
    "data": {
        "title": "Platform",
        "uuid": "7e724722-da2f-410f-abd2-f44fbea1f6f0",
        "published_at": 1587118620,
        "created_at": 1587118620,
        "published_by": "",
        "created_by": "",
        "routable": true,
        "visibility": "visible",
        "content": "The Platform (Spanish: El hoyo, transl. The Hole) is a Spanish science fiction horror-thriller film, directed by Galder Gaztelu-Urrutia and released in 2019.",
        "modified_at": 1587118658,
        "slug": "movies/platform"
    }
}

Update entry

Request
PATCH /api/entries
Body
Name Description
id REQUIRED Unique identifier of the entry.
token REQUIRED Valid Entries token.
access_token REQUIRED Valid Access token.
data REQUIRED Data to store for the entry.
Result

Returns the entry item object for the entry item that was just updated.

Examples

Update content for entry platform

Request
PATCH /api/entries
Body
{
    "id": "movies/platform",
    "token": "f3acf199a9ac120d3bfd604e1e382456",
    "access_token": "bbc4417d171e38099bd129aeca279018",
    "data": {
        "content": "A vertical prison with one cell per level. Two people per cell. One only food platform and two minutes per day to feed from up to down. An endless nightmare trapped in The Hole."
    }
}
Response
200 OK
{
    "data": {
        "title": "Platform",
        "uuid": "7e724722-da2f-410f-abd2-f44fbea1f6f0",
        "published_at": 1587118620,
        "created_at": 1587118620,
        "published_by": "",
        "created_by": "",
        "routable": true,
        "visibility": "visible",
        "content": "A vertical prison with one cell per level. Two people per cell. One only food platform and two minutes per day to feed from up to down. An endless nightmare trapped in The Hole.",
        "modified_at": 1587119140,
        "slug": "movies/platform"
    }
}

Rename entry

Request
PUT /api/entries
Body
Name Description
id REQUIRED Unique identifier of the entry.
new_id REQUIRED New Unique identifier of the entry.
token REQUIRED Valid Entries token.
access_token REQUIRED Valid Access token.
Result

Returns the entry item object for the entry item that was just renamed.

Examples

Rename entry platform to the the-platform

Request
PUT /api/entries
Body
{
    "id": "movies/platform",
    "new_id": "movies/the-platform",
    "token": "f3acf199a9ac120d3bfd604e1e382456",
    "access_token": "bbc4417d171e38099bd129aeca279018"
}
Response
200 OK
{
    "data": {
        "title": "Platform",
        "uuid": "7e724722-da2f-410f-abd2-f44fbea1f6f0",
        "published_at": 1587118620,
        "created_at": 1587118620,
        "published_by": "",
        "created_by": "",
        "routable": true,
        "visibility": "visible",
        "content": "A vertical prison with one cell per level. Two people per cell. One only food platform and two minutes per day to feed from up to down. An endless nightmare trapped in The Hole.",
        "modified_at": 1587119140,
        "slug": "movies/the-platform"
    }
}

Move entry movies/the-platform to the movies/2019/the-platform

Request
PUT /api/entries
Body
{
    "id": "movies/the-platform",
    "new_id": "movies/2019/the-platform",
    "token": "f3acf199a9ac120d3bfd604e1e382456",
    "access_token": "bbc4417d171e38099bd129aeca279018"
}
Response
200 OK
{
    "data": {
        "title": "Platform",
        "uuid": "7e724722-da2f-410f-abd2-f44fbea1f6f0",
        "published_at": 1587118620,
        "created_at": 1587118620,
        "published_by": "",
        "created_by": "",
        "routable": true,
        "visibility": "visible",
        "content": "A vertical prison with one cell per level. Two people per cell. One only food platform and two minutes per day to feed from up to down. An endless nightmare trapped in The Hole.",
        "modified_at": 1587119140,
        "slug": "movies/2019/the-platform"
    }
}

Copy entry

Request
PUT /api/entries/copy
Body
Name Description
id REQUIRED Unique identifier of the entry.
new_id REQUIRED New Unique identifier of the entry.
token REQUIRED Valid Entries token.
access_token REQUIRED Valid Access token.
Result

Returns the entry item object for the entry item that was just copied.

Examples

Copy for entry movies/2019/the-platform to movies/horror/the-platform

Request
PUT /api/entries/copy
Body
{
    "id": "movies/2019/the-platform",
    "new_id": "movies/horror/the-platform",
    "token": "f3acf199a9ac120d3bfd604e1e382456",
    "access_token": "bbc4417d171e38099bd129aeca279018"
}
Response
200 OK
{
    "data": {
        "title": "Platform",
        "uuid": "7e724722-da2f-410f-abd2-f44fbea1f6f0",
        "published_at": 1587118620,
        "created_at": 1587118620,
        "published_by": "",
        "created_by": "",
        "routable": true,
        "visibility": "visible",
        "content": "A vertical prison with one cell per level. Two people per cell. One only food platform and two minutes per day to feed from up to down. An endless nightmare trapped in The Hole.",
        "modified_at": 1587139514,
        "slug": "movies/horror/the-platform"
    }
}

Delete entry

Request
DELETE /api/entries
Body
Name Description
id REQUIRED Unique identifier of the entry.
token REQUIRED Valid Entries token.
access_token REQUIRED Valid Access token.
Result

Returns an empty body with HTTP status 204

Examples

Delete entry movies/horror/the-platform

Request
DELETE /api/entries
Body
{
    "id": "movies/horror/the-platform",
    "token": "f3acf199a9ac120d3bfd604e1e382456",
    "access_token": "bbc4417d171e38099bd129aeca279018"
}
Language: en, ru