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 or entries collection.
POST /api/entries Create entry.
PATCH /api/entries Update entry.
PUT /api/entries Move entry.
PUT /api/entries/copy Copy entry or entries collection.
DELETE /api/entries Delete entry.

Fetch entry

Fetch single entry
Request
GET /api/entries?id=YOUR_ENTRY_ID&[options]&token=YOUR_ENTRIES_TOKEN
Query
Name Description
id REQUIRED Valid Entry ID (slug)
options 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&options[collection]=true&token=YOUR_ENTRIES_TOKEN
Query
Name Description
id REQUIRED Valid Entry ID (slug)
options OPTIONAL 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&options[collection]=true&token=6f047babd1894064fbf7662080a9a2f0

Fetch Movies Collection where director is equal to Cathy Yan

Request
GET /api/entries?id=movies&options[collection]=true&options[filter][where][0][key]=director&options[filter][where][9][operator]=eq&options[filter][where][0][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&options[collection]=true&options[filter][where][0][key]=director&options[filter][where][0][operator]=eq&options[filter][where][0][value]=Cathy+Yan&options[filter][where][1][key]=year&options[filter][where][1][operator]=eq&options[filter][where][1][value]=2020&options[filter][where][2][key]=genre&options[filter][where][1][operator]=contains&options[filter][where][1][value]=drama&token=6f047babd1894064fbf7662080a9a2f0
Options

We can send options for the query to search items in a collection that matches the specific filter's conditions.

options is an array of valid values for filter() and find() helpers.

Extending

We can you use any custom macroabe function assigned to Entries API in the fetch query with help off &options[method]=

Examples
GET /api/entries?id=movies&options[method]=fetchFromOtherDB&token=6f047babd1894064fbf7662080a9a2f0

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"
    }
}

Move 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 moved.

Examples

Move 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"
}