All Known Implementing Classes:
PageApiClientModule

public interface PageAPIs
Defines operations for managing WordPress pages through the WordPress REST API.

This interface provides methods for creating, retrieving, updating, listing, trashing, and deleting WpPage resources.

Operations support standard WordPress REST API features such as pagination, filtering, retrieval contexts, password-protected content, and partial querying.

Implementations are expected to communicate with the /wp-json/wp/v2/pages endpoint or compatible APIs.

  • Method Details

    • create

      WpPage create(WpPageCreateUpdateRequest creationRequest)
      Creates a new page.

      Creates a page in WordPress using the provided request payload.

      Parameters:
      creationRequest - the page creation request; must not be null
      Returns:
      the created WpPage
    • create

      WpPage create(WpPageCreateUpdateRequest creationRequest, Map<String,String> extraQueryParams)
      /**

      Creates a new page.

      Parameters:
      creationRequest - the page creation request; must not be null
      extraQueryParams - additional query parameters to include in the request.
      Returns:
      the created WpPage
    • delete

      WpPageDeletionResponse delete(long id)
      Permanently deletes a page by its unique identifier.
      Parameters:
      id - the ID of the page to delete
      Returns:
      the page deletion response
    • get

      WpPage get(long id, WpContext context)
      Retrieves a page by its unique identifier using the given context.

      The context determines which fields are included in the response, for example WpContext.VIEW, WpContext.EDIT, or WpContext.EMBED.

      Parameters:
      id - the ID of the page to retrieve
      context - the retrieval context; may be null, in which case WpContext.VIEW is used
      Returns:
      the matching WpPage
    • get

      WpPage get(long id, WpContext context, String password)
      Retrieves a page by its unique identifier using the given context and optional password.

      The context determines which fields are included in the response, for example WpContext.VIEW, WpContext.EDIT, or WpContext.EMBED.

      If the page is password protected, the provided password is used to access protected content. If the password is missing or incorrect, protected fields such as content or excerpt may be omitted or flagged as protected in the response.

      Parameters:
      id - the ID of the page to retrieve
      context - the retrieval context; may be null, in which case WpContext.VIEW is used
      password - the password for protected content; may be null when not required
      Returns:
      the matching WpPage
    • list

      WpPagedResponse<WpPage> list(WpPaginationQuery paginationQuery, WpPageQuery query)
      Retrieves a paginated list of pages using optional filtering and sorting criteria.

      The result set can be refined using WpPageQuery, for example by filtering on search criteria, include or exclude lists, or sort order.

      Parameters:
      paginationQuery - the pagination settings, including page number and page size; must not be null
      query - additional page query parameters; may be null when no extra filtering is needed
      Returns:
      a paginated response containing WpPage items
    • trash

      WpPage trash(long id)
      Moves a page to the trash by its unique identifier.
      Parameters:
      id - the ID of the page to trash
      Returns:
      the trashed WpPage
    • update

      WpPage update(long id, WpPageCreateUpdateRequest updateRequest)
      Updates an existing page.

      Updates a page in WordPress using the provided request payload.

      Parameters:
      id - the ID of the page to update
      updateRequest - the page update request; must not be null
      Returns:
      the updated WpPage