Join Morten Rand-Hendriksen for an in-depth discussion in this video Exploring common routes, part of WordPress REST API (WP-API): First Look (2015).
- Let's take a look at some common routes.…I want to show you how you can use the different routes…available in the API index to get the information…you are looking for and also how you can use…the different arguments available and…the endpoints in those routes to filter down information…to specific types of output.…You'll remember that the API index is found at…wp-json/wp/v2.…This gives you a list of all the available routes…and, within each of the routes,…you'll get a list of all the available endpoints…and within the endpoints, you get a list of…all the available arguments.…
If we go to Postman and GET…wp-json/wp/v2, we get all of these routes.…And if I go and search for something like posts,…I will get the posts route.…As you'll remember, the posts route has two endpoints,…GET and POST, and if you're looking to GET posts,…we have a series of arguments,…context, page, per_page,…and filter.…And here I want you to focus on this per_page argument.…You see all the index endpoints to the routes here…are defaulting to a per_page value of 10,…
With the WP API, developers can access the data on a WordPress site—such as users, posts, and categories—programmatically. The result is an expansion of the already limitless field of possibilities where theme and plugin development is concerned.
This course is a first look at the WP API: what it is, how to get it running, how to interact with it, what it can do for us, and what we can do with it. Join Morten Rand-Hendriksen, your guide and WordPress guru, as he walks through the tools and major features (such as routes and endpoints) of the WP API, as well as a short project that shows how this new API will be used in real-world workflows.
- Installing the WP API
- Exploring common routes
- Examining WP API output
- Building plugins with the WP API
- Crafting WP API URL requests
- Creating AJAX functions with the WP API