Content Press

Content Press · Actions GPT

WordPress REST API

REST API for interacting with WordPress posts.

  • GET /wp/v2/postsRetrieves a list of posts
  • POST /wp/v2/postsCreates a new post
Schéma original API
{
  "openapi": "3.1.0",
  "info": {
    "title": "WordPress REST API",
    "description": "REST API for interacting with WordPress posts.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://blog.xload.ai/wp-json",
      "description": "WordPress API server"
    }
  ],
  "paths": {
    "/wp/v2/posts": {
      "get": {
        "summary": "Retrieves a list of posts",
        "operationId": "getPosts",
        "responses": {
          "200": {
            "description": "A list of posts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Post"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Creates a new post",
        "operationId": "createPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new post created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Post": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier for the post",
            "readOnly": true
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "The date the post was published",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "description": "The title of the post"
          },
          "content": {
            "type": "string",
            "description": "The content of the post"
          },
          "status": {
            "type": "string",
            "description": "The status of the post"
          },
          "author": {
            "type": "integer",
            "description": "The ID of the user who authored the post"
          },
          "excerpt": {
            "type": "string",
            "description": "The excerpt of the post"
          }
        },
        "required": [
          "title",
          "content"
        ]
      }
    }
  }
}

WordPress REST API

REST API for interacting with WordPress posts.

  • GET /wp/v2/postsRetrieves a list of posts
  • POST /wp/v2/postsCreates a new post
Schéma original API
{
  "openapi": "3.1.0",
  "info": {
    "title": "WordPress REST API",
    "description": "REST API for interacting with WordPress posts.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://blog.xload.ai/wp-json",
      "description": "WordPress API server"
    }
  ],
  "paths": {
    "/wp/v2/posts": {
      "get": {
        "summary": "Retrieves a list of posts",
        "operationId": "getPosts",
        "responses": {
          "200": {
            "description": "A list of posts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Post"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Creates a new post",
        "operationId": "createPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new post created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Post": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier for the post",
            "readOnly": true
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "The date the post was published",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "description": "The title of the post"
          },
          "content": {
            "type": "string",
            "description": "The content of the post"
          },
          "status": {
            "type": "string",
            "description": "The status of the post"
          },
          "author": {
            "type": "integer",
            "description": "The ID of the user who authored the post"
          },
          "excerpt": {
            "type": "string",
            "description": "The excerpt of the post"
          }
        },
        "required": [
          "title",
          "content"
        ]
      }
    }
  }
}