REST API or RESTful API
b2evolution’s REST API will allow to query, add, modify and delete Posts, Comments, Users and other objects of a b2evolution installation through the HTTP protocol (notably the GET / PUT / POST / DELETE methods).
Responses are returned in JSON format.
Authentication
The first version supports:
General Error Codes
Error code |
HTTP response |
Message |
---|---|---|
wrong_route |
404 |
Module is not defined |
unknown_module |
404 |
Unknown module "<requested_module_name>" |
Note: some of the common error messages are translated to the user locale.
Micro Troubleshooting FAQ
100% of users who said "It doesn’t work, I have a 404 error." have not properly set up or updated their .htaccess File.
Next?
If you have an urgent need for additional end-points or methods, please let us know in the comments below or in the forums: http://forums.b2evolution.net/b2evolution-rest-api
-
List Collections (REST)
GET /api/v1/collections This lists the collections depending on their Show in Front-office list setting. Response is an array of Collections having each the following properties: Collection properties Name Type Description id integer Collection…More » -
List Posts (REST)
GET|POST /api/v1/collections//posts? This is the API equivalent of disp = posts. See: URL Parameters. Note: It doesn’t support param types, because it keeps only content post types, and excludes pages, intros, sidebar…More » -
List Items (REST)
GET|POST /api/v1/collections//items? See: URL Parameters.More » -
Retrieve a Post (REST)
GET /api/v1/collections//posts/ This is the API equivalent of disp = single. Post properties in the Response Name Type Description id integer Post ID datestart datetime Date of start publishing urltitle string Slug type string…More » -
Retrieve any item (REST)
GET /api/v1/collections//items/ This is the equivalent of API end-point "Retrieve a Post" to get an item with any type.More » -
Search (REST)
GET /api/v1/collections//search/ This is the API equivalent of disp = search. Possible request params Name Type Description Default page integer Page number 1 per_page integer Count pages per page 10 kind string…More » -
List Users (REST)
GET /api/v1/users This lists the users as API equivalent of disp = users. Response is an array of the following properties: Name Type Description found integer Number of found users page integer Current page page_size integer Number users per…More » -
Retrieve a User (REST)
GET /api/v1/users/ This is the API equivalent of disp = user.More » -
Create a User (REST)
POST /api/v1/users This is API end-point to create a user like admins/moderators can do this from back-office Creating a New UserMore » -
Update a User (REST)
POST /api/v1/users/ This is API end-point to update a user like admins/moderators can do this from back-office Editing an User Account.More » -
Delete a User (REST)
DELETE /api/v1/users/ This is API end-point to delete a user like admins/moderators can do this from back-office Users.More » -
Cookie Authentication (REST)
If you are already logged in to b2evolution in a web browser, you will have a session cookie and you can use this cookie to obtain privileges when calling the REST API. This is particularly useful when you use the REST API in a browser, for example in a…More » -
Basic HTTP Authentication (REST)
When you make a REST API call from one webserver to another, you may add HTTP username (or email address) and passwords to your RESTful HTTP requests. b2evolution will check the provided username (or email address) and password to allow privileges on…More »