WordPress API development with Postman or PAW

The Wordpress API works well. Once you figure out how to send a REST request, you'll be jamming in no time. Below are a few lessons I've learned along the way on how to streamline the development cycle.

Tips

Tip 1: Pick an API tool

Although ```curl`` is a fantastic tool, I recommend something more comprehensives, such as Postman or Mac PAW. Both services enable you to store your requests in the cloud.

For the remainder of this article, I am going to use PAW.

Tip 2: Import this Wordpress API Collection into Postman or PAW

I've attached a file that allows you to see all the possible API requests you can make from a basic Wordpress API installation. This document is all you need to get started.

https://spaces.hightail.com/space/IGiQ0ktyFD


Installing Wordpress API Collection for PAW

Step 1 - Open up PAW

Step 2 - Import Collection

Step 3 - Choose POSTman Collection

Step 4 - Done!

Step 5 - Set Up Env Variables

Both Postman and PAW allow you to create environmental variables that will work across all of your requests. What I usually do is adjust the variable named base_url to my WordPress site.

Click "Manage" on the upper left corner.

Change the value.


Resources