5
Start with installing a plugin WordPress REST API on your wordpress site
Second, install Chrome Plugin called “POSTMAN” on your PC
To access the JSon
Open Postman with GET
type : http://your-site-name/wp-json/wp/v2/
To view all posts
GET http://your-site-name/wp-json/wp/v2/posts/
To view specific posts/pages, use its id
GET http://your-site-name/wp-json/wp/v2/posts/<post id>
GET http://your-site-name/wp-json/wp/v2/pages/<page id>
Example :
GET http://your-site-name/wp-json/wp/v2/posts/30
GET http://your-site-name/wp-json/wp/v2/pages/10
For view 10 available categories
GET http://your-site-name/wp-json/wp/v2/categories
To view specific category id
GET http://your-site-name/wp-json/wp/v2/categories/<category id>
Example
GET http://your-site-name/wp-json/wp/v2/categories/3
Filter specific category name will bring all slugs under that category
GET http://your-site-name/wp-json/wp/v2/posts?filter[category name]=categoryname
example
GET http://yoursitename/wp-json/wp/v2/posts?filter[category_name]=wordpress
Filter specific category id
GET http://your-site-name/wp-json/wp/v2/posts?filter[cat]=<categoryid>
example
GET http://your-site-name/wp-json/wp/v2/posts?filter[cat]=4
Tags behave the same way as category
GET http://your-site-name/wp-json/wp/v2/terms/tag
To display all available tags
http://your-site-name/wp-json/wp/v2/terms/tag?per_page=0
Tags based on id
GET http://your-site-name/wp-json/wp/v2/terms/tag/
Filters based on slug
GET http://your-site-name/wp-json/wp/v2/posts?filter[tag]=<tagid>
Filters based on tag id
GET http://your-site-name/wp-json/wp/v2/posts?filter[tag_id]=<tagid>
Common Routes for Users
GET http://your-site-name/wp-json/wp/v2/users
Current logged in user
GET http://your-site-name/wp-json/wp/v2/users/me
Users based on id
GET http://your-site-name/wp-json/wp/v2/users/
example
GET http://your-site-name/wp-json/wp/v2/users/<user id>
Example
GET http://your-site-name/wp-json/wp/v2/users/2
Common Routes for comments
GET http://your-site-name/wp-json/wp/v2/comments
Comments based on id [will return 10 latest comment on that post]
GET http://your-site-name/wp-json/wp/v2/comments?post=<comment id>
example
GET http://your-site-name/wp-json/wp/v2/comments?post=3
For all comments on specific posts
GET http://your-site-name/wp-json/wp/v2/comments?post=3&per_page=0
5
5