Skip to content

Blog Posts API

This API provides an endpoint to list all blog posts, ordered by the most recently updated. It supports pagination and filtering by blog post ID.


1. List Blog Posts

Note

Blog post will be created by super admin from the django admin.

Endpoint

  • URL: /api/v1/testimonials/blog/list/
  • Method: GET
  • Permission Required: AllowAny

Description

Retrieve all blog posts with pagination. Blog posts are ordered by the most recently updated.

Query Parameters

  • id (Optional): Filter by blog post ID.

Request Payload

This endpoint does not require any request payload.

Response Examples

Success

{
  "count": 50,
  "next": "http://api.example.com/api/v1/blog-posts/?page=2",
  "previous": null,
  "results": [
    {
      "id": 1,
      "title": "First Blog Post",
      "content": "This is the content of the first blog post.",
      "updated_at": "2024-12-01T12:00:00Z"
    },
    {
      "id": 2,
      "title": "Second Blog Post",
      "content": "This is the content of the second blog post.",
      "updated_at": "2024-11-30T15:45:00Z"
    }
  ]
}