Getting Started
- What is Flextype?
- Requirements
- Installation
- Configuration
- Folder Structure
- API Reference
- Code of Conduct
- Getting Help
- License
Core Concepts
Console
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 | Route name | Description |
---|---|---|---|
GET | /api/v1/entries | entries.fetch | Fetch entry . |
POST | /api/v1/entries | entries.create | Create entry. |
PATCH | /api/v1/entries | entries.update | Update entry. |
PUT | /api/v1/entries | entries.move | Move entry . |
PUT | /api/v1/entries/copy | entries.copy | Copy entry . |
DELETE | /api/v1/entries | entries.delete | Delete entry . |
GET /api/v1/entries
Fetch entry or entries collection.
Fetch single entry
GET /api/v1/entries?id=YOUR_ENTRY_ID&[options]&token=YOUR_ENTRIES_TOKEN
Query
Name | Description | |
---|---|---|
id | REQUIRED | Valid Entry ID |
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
GET /api/v1/entries?id=movies&token=6f047babd1894064fbf7662080a9a2f0
Fetch entries collection
GET /api/v1/entries?id=YOUR_ENTRY_ID&options[collection]=true&token=YOUR_ENTRIES_TOKEN
Query
Name | Description | |
---|---|---|
id | REQUIRED | Valid Entry ID |
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
GET /api/v1/entries?id=movies&options[collection]=true&token=6f047babd1894064fbf7662080a9a2f0
Fetch Movies Collection where director is equal to Cathy Yan
GET /api/v1/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
GET /api/v1/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
You 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.
POST /api/v1/entries
Create entry.
POST /api/v1/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
POST /api/v1/entries
{
"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."
}
}
{
"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"
}
}
PATCH /api/v1/entries
Update entry.
PATCH /api/v1/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
PATCH /api/v1/entries
{
"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."
}
}
{
"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"
}
}
PUT /api/v1/entries
Move entry.
PUT /api/v1/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
PUT /api/v1/entries
{
"id": "movies/platform",
"new_id": "movies/the-platform",
"token": "f3acf199a9ac120d3bfd604e1e382456",
"access_token": "bbc4417d171e38099bd129aeca279018"
}
{
"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
PUT /api/v1/entries
{
"id": "movies/the-platform",
"new_id": "movies/2019/the-platform",
"token": "f3acf199a9ac120d3bfd604e1e382456",
"access_token": "bbc4417d171e38099bd129aeca279018"
}
{
"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"
}
}
PUT /api/v1/entries/copy
Copy entry .
PUT /api/v1/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
PUT /api/v1/entries/copy
{
"id": "movies/2019/the-platform",
"new_id": "movies/horror/the-platform",
"token": "f3acf199a9ac120d3bfd604e1e382456",
"access_token": "bbc4417d171e38099bd129aeca279018"
}
{
"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 /api/v1/entries
Delete entry.
DELETE /api/v1/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 status 204
Examples
Delete entry movies/horror/the-platform
DELETE /api/v1/entries
{
"id": "movies/horror/the-platform",
"token": "f3acf199a9ac120d3bfd604e1e382456",
"access_token": "bbc4417d171e38099bd129aeca279018"
}