b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Advanced Topics
  3. Using the APIs
  4. REST API or RESTful API
  5. List Posts (REST)

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

Possible request params

Name

Type

Description

Default

paged

integer

Page number

1

page

integer

Page number, when page is defined then it is used instead of paged

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).
To get all possible post properties in response use a value *.
To get custom properties list them separated by comma like this id,datestart,urltitle,type,title,content,excerpt,teaser,URL,attachments.

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

Post properties in the Post List

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:

Name

Type

Description

link_ID

integer

Link ID

file_ID

integer

File ID

type

string

File type: dir, image, audio, other

position

string

Link position: teaser, teaserperm, teaserlink, aftermore, inline, fallback, cover

name

string

File name

url

string

File URL

title

string

File long title

alt

string

File alternative text

desc

string

File caption/description

Errors

Possible Error Codes

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

Created by yurabakhtin • Last edit by yurabakhtin on 2018-10-11 14:04 • •

No feedback yet

On this page

  • Parameters
  • Response
  • Errors

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
  • Operations Reference
  • Advanced Topics
    • Using Desktop Blogging Tools
    • Using Blogging Apps
    • Blogging by email
    • Using the APIs
      • REST API or RESTful API
        • List Collections (REST)
        • List Posts (REST)
        • List Items (REST)
        • Retrieve a Post (REST)
        • Retrieve any item (REST)
        • Search (REST)
        • List Users (REST)
        • Retrieve a User (REST)
        • Create a User (REST)
        • Update a User (REST)
        • Delete a User (REST)
        • Cookie Authentication (REST)
        • Basic HTTP Authentication (REST)
      • B2 API
      • API Error Codes
      • Blogger API
      • MetaWeblog API
      • MovableType API
    • Contributing
    • Translations (i18n/l10n)
    • Monetizing
    • How to...
    • Podcasting
  • Glossary
  • Archives
Secure CMS

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque