List blog posts
Returns a list of blog posts which the current user may access
Pagination
Use page[number] and page[size] parameters to paginate results:
Get first page of 10 items
- GET /v1/blog_posts[number]=1&page[size]=10
Get second page of 25 items
- GET /v1/blog_posts[number]=2&page[size]=25
Sparse Fields
Use the fields[blog_posts] parameter to request only specific attributes:
Only return title attribute
- GET /v1/blog_posts?fields[blog_posts]=title
Sorting
Use the sort parameter to sort the results:
Sort by published_at in descending order
- GET /v1/blog_posts?sort=-published_at&fields[blog_posts]=title
Filters
Use the filter[site_id] parameter to get blog posts for a specific site:
Get blog posts for site with ID 123
- GET /v1/blog_posts?filter[site_id]=123
List of attributes that may be used to filter: title, content, slug, page_title, page_description, published_at, created_at, updated_at, image_url, image_alt_text, tags
The filter param uses the following syntax: filter[attribute_name_suffix] with suffix for comparison:
- eq for equals
- cont for contains
- not_eq for not equals
- not_cont for not contains
- start for starts with
- end for ends with
For example:
- GET /v1/blog_posts?filter[title_start]=Announcing
- GET /v1/blog_posts?filter[title_cont]=Announcing
Query parameters
Sort order, use: title for descending order use '-' e.g. &sort=-title
Number of documents
Partial attributes as specified, e.g. fields[blog_posts]=title
Filter by title contains, for example ?filter[title_cont]=hello
Response
Success, list of blog posts which the current user may access