Join Morten Rand-Hendriksen for an in-depth discussion in this video Understanding routes and endpoints, part of WordPress REST API (WP-API): First Look.
- Interacting with the WP API is done…through accessing routes and endpoints.…These two are connected terms that are used together,…so they have to be explained together.…An endpoint is a function available through the APIs,…so the verbs I mentioned in the REST definition.…An endpoint performs a specific function by taking…one or more parameters and returning…the resulting data to the client.…A route is the "name" you use…to access the available endpoints.…In layman's terms, the route is the URL,…and the endpoint is the action performed on the URL.…
To see how this works, we need an example.…Let's say I want to get the contents…for a specific post from WordPress.…I can achieve this by using the GET endpoint…on the wp/v2/posts/456 route.…The same route also has two other endpoints.…PUT, which grabs the existing data…and returns it once I've updated it,…and DELETE, which deletes the data entry from the server.…The WP API provides a long list of routes,…and different routes have different endpoints.…
Later in this course we'll explore…
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