CMS · blog
6 routes. Paths are relative to https://api.intersink.com/v1.
- GET/cms/channels/{channelId}/postsList the channel's blog posts (all statuses)
- POST/cms/channels/{channelId}/postsCreate a blog post (body is sanitized)
- GET/cms/channels/{channelId}/posts/{id}One blog post with its body
- PATCH/cms/channels/{channelId}/posts/{id}Update a blog post (incl. status / schedule)
- DELETE/cms/channels/{channelId}/posts/{id}Delete a blog post
- POST/cms/channels/{channelId}/posts/{id}/coverUpload the post's cover image (field: image)
List the channel's blog posts (all statuses)
GET/cms/channels/{channelId}/posts
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| page | number, query | Minimum 1. |
| limit | number, query | Minimum 1, maximum 100. |
| q | string, query | Search in the title/name |
| status | string, query | One of: "draft", "scheduled", "published", "archived". |
Response
200. The payload in data is not described in the spec yet.
Create a blog post (body is sanitized)
POST/cms/channels/{channelId}/posts
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| excerpt | string | At most 300 characters. |
| body_html | string | Rich text; sanitized on save At most 100000 characters. |
| cover | string | directus_files id of the cover image |
| category | string | At most 60 characters. Example: "News" |
| tags | string[] | At most 20 items. |
| featured | boolean | |
| publish_at | string | Required when status is scheduled |
| seo_title | string | At most 70 characters. |
| seo_description | string | At most 170 characters. |
| titlerequired | string | At most 200 characters. Example: "Our autumn collection is here" |
| slug | string | Lower-case kebab; made from the title when omitted At most 120 characters. Example: "autumn-collection" |
| status | string | One of: "draft", "scheduled", "published", "archived". |
Response
201. The payload in data is of type object.
One blog post with its body
GET/cms/channels/{channelId}/posts/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Response
200. The payload in data is of type object.
Update a blog post (incl. status / schedule)
PATCH/cms/channels/{channelId}/posts/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| excerpt | string | At most 300 characters. |
| body_html | string | Rich text; sanitized on save At most 100000 characters. |
| cover | string | directus_files id of the cover image |
| category | string | At most 60 characters. Example: "News" |
| tags | string[] | At most 20 items. |
| featured | boolean | |
| publish_at | string | Required when status is scheduled |
| seo_title | string | At most 70 characters. |
| seo_description | string | At most 170 characters. |
| title | string | At most 200 characters. |
| slug | string | At most 120 characters. |
| status | string | One of: "draft", "scheduled", "published", "archived". |
Response
200. The payload in data is of type object.
Delete a blog post
DELETE/cms/channels/{channelId}/posts/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Response
200. The payload in data is not described in the spec yet.
Upload the post's cover image (field: image)
POST/cms/channels/{channelId}/posts/{id}/cover
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Response
201. The payload in data is of type object.