- b2evolution CMS User Manual
- Advanced Topics
- Using the APIs
- REST API or RESTful API
- Retrieve a Post (REST)
Retrieve a Post (REST)
GET <baseurl>/api/v1/collections/<collname>/posts/<id>
GET <baseurl>/api/v1/collections/<collname>/posts/<url-slug>
This is the API equivalent of disp = single.
Parameters
|
Name |
Type |
Description |
Default |
|---|---|---|---|
|
details |
string |
Determines what post properties should be in the Response (see table below). |
* |
Response
|
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 |
|
wrong_route |
404 |
Collection controller is not defined |
|
post_invalid_id |
404 |
Invalid post ID |