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.
Expanding the response with embeds - WordPress Tutorial
From the course: WordPress: REST API
Expanding the response with embeds
- [Morten] Now that you've seen how we use Postman to interact with the WordPress REST API, let's take a closer look at the response from the REST API and how we can expand it. Here, I encourage you to play along using Postman and a WordPress site of your choosing. I've set my environment to mor10.com, I'll go over the Collections and select the Posts route. This is the route that we requested previously. So here, I get the 10 most reasoned posts from my site. Looking that this response, you'll see we get the entire post for each of these posts. So here we have all the information that's stored from the post: ID, date, modified date, the slug for the post, the status, the title, the content, the except comes down here, then the author ID, the featured media IDs, and that would be the featured image, and that's the post for the featured image, and whether or not there are comments available, if it's a sticky post, and so…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is the WordPress REST API?2m 42s
-
(Locked)
What are RESTful APIs and JSON?2m 16s
-
(Locked)
Routes and endpoints1m 43s
-
(Locked)
Communicating with the REST API4m 16s
-
(Locked)
Explore the REST API response7m 23s
-
(Locked)
Useful routes: A quick reference5m 8s
-
(Locked)
Expanding the response with embeds6m 14s
-
(Locked)
Challenge: Find posts in a category2m
-
(Locked)
Solution: Find posts in a category5m 18s
-
-
-
-
-