Extending REST API
Now that you are comfortable with the default working of the default routes and methods, let’s discover how to add new data to the REST API or enhance and manipulate existing response objects in the Extending the REST API section.
Explore these videos for insights and tutorials on extending REST API. This section comprises 6 modules with a combined duration of approximately 45 minutes.
| Video Content | Time |
|---|---|
| Pt 1: Modifying the Response | 8:19 |
| Pt 2: Modifying the Response | 8:53 |
| Embedding Links | 7:36 |
| register_rest_field() | 5:39 |
| Adding Custom Endpoints | 9:36 |
| More on Extending REST API | 04:57 |
Explore the videos for insights and tutorials on REST API authentication. This section comprises 4 modules with a combined duration of approximately 20 minutes.
| Video Content | Time |
|---|---|
| Introduction to Application Passwords | 3:51 |
| Creating Posts Using REST API | 5:28 |
| Updating & Deleting using REST API | 5:16 |
| How WordPress Authenticates Requests | 5:43 |
Ideas to Explore:
- What does WordPress use to make external API requests? (Which library is used)
- Can you change the REST base from wp-json to something else? If yes, what happens if you have hard-coded wp-json in the URLs?
- How do you make internal (same website) REST calls in WordPress?
- What is JSONP? Is it enabled in WP by default? If not, how do you enable it?
References
- Writing a WP REST API endpoint in 2 minutes by Tom J Nowell