Wordpress REST API Flashcards
Q: What is the WordPress REST API?
A: A RESTful interface for interacting with WordPress data using HTTP requests.
Q: What does REST stand for?
A: Representational State Transfer.
Q: What are the primary HTTP methods used in the REST API?
A: GET, POST, PUT, DELETE.
Q: What is the base URL for the WordPress REST API?
A: https://example.com/wp-json/.
Q: What is the namespace for core WordPress API endpoints?
A: wp/v2.
Q: What endpoint retrieves a list of posts?
A: /wp-json/wp/v2/posts.
Q: What endpoint retrieves a single post by ID?
A: /wp-json/wp/v2/posts/{id}.
Q: What endpoint retrieves a list of pages?
A: /wp-json/wp/v2/pages.
Q: What endpoint retrieves all categories?
A: /wp-json/wp/v2/categories.
Q: What endpoint retrieves all tags?
A: /wp-json/wp/v2/tags.
Q: What are the common methods for authenticating REST API requests?
A: Basic Auth, OAuth, Application Passwords, JWT Authentication.
Q: Which authentication method is built into WordPress 5.6+?
A: Application Passwords.
Q: What header is required for Basic Auth in REST API requests?
A: Authorization: Basic [Base64EncodedCredentials].
Q: What plugin is commonly used for JWT Authentication?
A: The “JWT Authentication for WP REST API” plugin.
Q: Why is authentication required for certain REST API actions?
A: To ensure only authorised users can create, update, or delete data.
Q: What query parameter is used to filter posts by category?
A: categories.