List Posts (REST)
GET|POST <baseurl>/api/v1/collections/<collname>/posts?<params>
This is the API equivalent of disp = posts (List of Posts / Items).
This is similar to List Items (REST) but restricted to Items with Usage Type "Post".
Parameters
Name |
Type |
Description |
Default |
---|---|---|---|
paged |
integer |
Page number |
1 |
page |
integer |
Page number, when |
1 |
per_page |
integer |
Number of items/posts or days (depending on "unit") to display on the page |
10 |
details |
string |
Determines what post properties should be in the Post List (see table below). |
id,title |
See disp = posts (List of Posts / Items) for a list of additional supported params. Note: This API call doesn’t support param types
, because it keeps only content post types, and excludes pages, intros, sidebar links and advertisements.
Response
Response is an array of the following properties:
Name |
Type |
Description |
---|---|---|
found |
integer |
Number of found items/posts |
page |
integer |
Current page |
page_size |
integer |
Number items/posts per page |
pages_total |
integer |
Number of total pages |
items |
array |
Array of items/posts list, see the properties in the table below |
Name |
Type |
Description |
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
integer |
Post ID |
||||||||||||||||||||||||||||||
datestart |
datetime |
Date of start publishing |
||||||||||||||||||||||||||||||
urltitle |
string |
Slug |
||||||||||||||||||||||||||||||
type |
string |
Post type name |
||||||||||||||||||||||||||||||
title |
string |
Title of the post |
||||||||||||||||||||||||||||||
content |
string |
Pre-rendered content |
||||||||||||||||||||||||||||||
excerpt |
string |
Excerpt |
||||||||||||||||||||||||||||||
URL |
string |
Permanent URL |
||||||||||||||||||||||||||||||
attachments |
array |
Array of item attachments:
|
Errors
Error code |
HTTP response |
Message |
---|---|---|
access_requires_login |
403 |
You need to log in before you can access this section. |
access_denied |
403 |
You are not a member of this section, therefore you are not allowed to access it. |
wrong_route |
404 |
Collection name is not defined |
unknown_collection |
404 |
No collection found in DB by requested url name "<requested_url_name>" |
wrong_route |
404 |
Collection controller is not defined |
no_posts |
404 |
No posts found for requested collection |