ChatDevr

ChatDevr · GPT 작업

WordPress Recent Post API

API for fetching the most recent post from a WordPress site.

  • GET /wp-json/wp/v2/postsRetrieves the most recent WordPress post.
원본 API 스키마
openapi: 3.0.0
info:
  title: WordPress Recent Post API
  description: API for fetching the most recent post from a WordPress site.
  version: 1.0.0
servers:
  - url: https://vit.xwm.mybluehost.me/test
    description: Main WordPress API server
paths:
  /wp-json/wp/v2/posts:
    get:
      operationId: getRecentPost
      summary: Retrieves the most recent WordPress post.
      parameters:
        - name: per_page
          in: query
          required: true
          description: Number of posts to display per page.
          schema:
            type: integer
            default: 1
        - name: order
          in: query
          required: false
          description: Order of the posts.
          schema:
            type: string
            default: 'desc'
        - name: orderby
          in: query
          required: false
          description: Parameter to order the posts by.
          schema:
            type: string
            default: 'date'
      responses:
        '200':
          description: A JSON array containing the most recent post
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    title:
                      type: object
                      properties:
                        rendered:
                          type: string
                    date:
                      type: string
                      format: date-time
                    content:
                      type: object
                      properties:
                        rendered:
                          type: string