From the course: WordPress: REST API

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Routes and endpoints

Routes and endpoints - WordPress Tutorial

From the course: WordPress: REST API

Start my 1-month free trial

Routes and endpoints

- [Instructor] Interacting with a WordPress REST API is done through accessing what's known as routes and endpoints. These are two are connected terms that are used together, so they should also be explained together. An endpoint is a function available through the API, so the verbs I mentioned in the REST definition. An endpoint performs a specific function by taking one or more arguments and returning the resulting data. A route or route is a name or address you use to access the available endpoints, in our case, a URI. So in short, the route is the URI, the endpoint is the action performed on that URI. This all makes a lot more sense if we look at a practical example. Let's say I want to get the contents of a specific post from WordPress with the post ID 456. I can achieve this by using the GET endpoint at the wp/v2/posts/456 route. This endpoint retrieves the data from the database entry with the ID 456 and returns…

Contents