HTTP API
HTTP API
Method | Path |
GET | /v1/contents |
GET | /v1/contents/:id |
GET | /v1/contents/slug/:slug |
Fields
To optimize network performance and reduce overhead, a fields
query parameter is required. For example, to retrieve only the title of the content, use the following URL format: https://api.writeflow.dev/v1/contents/:id?fields=title
.
fields?= | id | title | slug | properties | body |
Get a list of content
curl -L \
-H "X-Api-Key: <YOUR-API-KEY>" \
https://api.writeflow.dev/v1/contents?fields=id,title,slug
Example response
[
{
"id": "54b99278-b37e-4eb1-8a8b-e45ec2439456",
"title": "Example post 1",
"slug": "example-post-1"
},
{
"id": "9bb86f34-f242-4516-ad7a-1d6fbe0fc289",
"title": "Example post 2",
"slug": "example-post-2"
}
]
Get content by id
curl -L \
-H "X-Api-Key: <YOUR-API-KEY>" \
https://api.writeflow.dev/v1/contents/:id?fields=title
Example response
{
"title": "Example post 1"
}
Get content by slug
curl -L \
-H "X-Api-Key: <YOUR-API-KEY>" \
https://api.writeflow.dev/v1/contents/slug/:slug?fields=title
Example response
{
"title": "Example post 2"
}