LearningSpot@Wordpress icon

LearningSpot@Wordpress

Consume Wordpress API

Page → Get

AI-generated

Summary

Retrieve a specific WordPress page by its unique identifier, optionally providing a password if it is protected and setting the request context to control the fields included in the response.

Inputs

  • Page ID (required) — Unique identifier for the page to retrieve.
  • Options — Optional parameters including 'Password' for accessing protected pages and 'Context' to specify the scope of the request affecting the response fields ('view', 'embed', or 'edit').

Output shape

a single JSON object representing the requested page, including all fields based on the context provided

The operation uses a GET request to the endpoint /pages/{pageId}. If the page is password protected, the password should be provided in the options. The context option controls the level of detail in the returned page data.

Examples

Example 1: Get a public page by its ID

Provide the 'Page ID' parameter without a password and use the default 'view' context to retrieve typical public data.

Example 2: Get a password-protected page

Provide the 'Page ID' and the 'Password' in options; context can be set to 'view' to retrieve accessible data.

Links

Discussion