> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List a blog post's views

> Retrieve a paginated list of recorded views for a single blog post. Requires the READ_BLOGS scope.

Returns recorded views for one blog post newest first, with the viewing user populated when available; returns 404 if the post is not in this store. The store is bound to your app token server-side — never send a shop id.


## OpenAPI

````yaml GET /blogs/{id}/views
openapi: 3.1.0
info:
  title: Salesive Apps API — Discounts & Blogs
  version: 1.0.0
  description: >-
    Read and manage the store's discount coupons and blog posts from an
    installed third-party app. Every endpoint authenticates with an
    installed-app access token (prefix `app_`) and requires a specific OAuth
    scope. The target store is bound to the token server-side from the
    installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /blogs/{id}/views:
    get:
      tags:
        - Blogs
      summary: List a blog post's views
      description: >-
        Returns a paginated list of recorded views for a single blog post,
        newest first, with the viewing user populated when available. Returns
        404 if the post is not found in this store. The store is bound to the
        app token server-side from the installation — never send a shop id.
        Requires the `READ_BLOGS` scope.
      operationId: listBlogViews
      parameters:
        - $ref: '#/components/parameters/BlogId'
        - name: page
          in: query
          required: false
          description: 1-based page number.
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: limit
          in: query
          required: false
          description: Views per page. Defaults to 10.
          schema:
            type: integer
            default: 10
            minimum: 1
      responses:
        '200':
          description: Paginated list of the post's recorded views.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          blog:
                            $ref: '#/components/schemas/BlogSummary'
                          views:
                            type: array
                            items:
                              $ref: '#/components/schemas/BlogView'
                          pagination:
                            $ref: '#/components/schemas/Pagination'
              example:
                status: 200
                success: true
                message: Blog views retrieved
                data:
                  blog:
                    _id: 66c2a1b2c3d4e5f6a7b8c9d0
                    title: Summer Sale Tips
                    slug: summer-sale-tips
                    views: 342
                  views:
                    - _id: 66d3b1c2d3e4f5a6b7c8d9e0
                      blog:
                        _id: 66c2a1b2c3d4e5f6a7b8c9d0
                        title: Summer Sale Tips
                        slug: summer-sale-tips
                      shop: 66a0d1c2b3a4958677564738
                      ip: 203.0.113.42
                      userAgent: Mozilla/5.0
                      user:
                        _id: 66a0e1b2c3d4e5f6a7b8c9d0
                        name: Sam Shopper
                        email: sam@example.com
                        avatar: ''
                      createdAt: '2026-06-25T14:22:00.000Z'
                      updatedAt: '2026-06-25T14:22:00.000Z'
                  pagination:
                    total: 342
                    page: 1
                    limit: 10
                    pages: 35
                    hasNext: true
                    hasPrev: false
                    nextPage: 2
                    prevPage: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/BlogNotFound'
components:
  parameters:
    BlogId:
      name: id
      in: path
      required: true
      description: The blog post's unique id.
      schema:
        type: string
  schemas:
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    BlogSummary:
      type: object
      description: A lightweight summary of the blog post the views belong to.
      properties:
        _id:
          type: string
        title:
          type: string
        slug:
          type: string
        views:
          type: integer
          description: Total recorded view count.
    BlogView:
      type: object
      description: A single recorded view of a blog post.
      properties:
        _id:
          type: string
        blog:
          type: object
          description: Lightweight reference to the viewed post.
          properties:
            _id:
              type: string
            title:
              type: string
            slug:
              type: string
        shop:
          type: string
          description: The store id (bound server-side).
        ip:
          type:
            - string
            - 'null'
          description: Source IP address of the view.
        userAgent:
          type:
            - string
            - 'null'
          description: User agent string of the viewer.
        user:
          oneOf:
            - $ref: '#/components/schemas/Author'
            - type: 'null'
          description: The viewing user when available; null for anonymous views.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Pagination:
      type: object
      description: >-
        Nested pagination metadata returned in the `pagination` object of the
        blog-views response.
      properties:
        total:
          type: integer
          description: Total number of matching items.
        page:
          type: integer
          description: Current page (1-based).
        limit:
          type: integer
          description: Items per page.
        pages:
          type: integer
          description: Total number of pages.
        hasNext:
          type: boolean
          description: Whether a next page exists.
        hasPrev:
          type: boolean
          description: Whether a previous page exists.
        nextPage:
          type:
            - integer
            - 'null'
          description: Next page number, or null.
        prevPage:
          type:
            - integer
            - 'null'
          description: Previous page number, or null.
    Author:
      type: object
      description: Populated profile of the blog post's author (a platform user).
      properties:
        _id:
          type: string
        name:
          type: string
        email:
          type: string
        avatar:
          type:
            - string
            - 'null'
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
    BlogNotFound:
      description: >-
        The blog post does not exist, is soft-deleted, or is not in the
        installation's store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 404
            success: false
            message: Blog not found
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````