0

As shown in the photo below i have got post as well as questions in my wordpress site.
I am able to access the posts/an individual post via this api - http://webaddress.com/wp-json/wp/v2/posts or http://webaddress.com/wp-json/wp/v2/posts/15402

However i am unable to view the questions on my website using this api - http://webaddress.com/wp-json/wp/v2/posts?filter[post_type]=question

Is a question not a post and how do i fix this api?(because on wp-admin the questions page has the url - http://webaddress.com/wp-admin/edit.php?post_type=question

enter image description here

rnjai
  • 1,065
  • 2
  • 17
  • 32
  • 1
    You need to update for get custom post type post list, [Refer this solution](https://wordpress.stackexchange.com/questions/201657/wp-rest-api-fetch-posts-from-post-type) – Gnanasekaran Loganathan Aug 28 '17 at 10:31

1 Answers1

0

After some hit and trial it worked with this -
/api/get_post/?post_type=question and /api/get_post/?post_type=answer

This plugin was used - https://wordpress.org/plugins/json-api/#4.2.-Category-response-object

rnjai
  • 1,065
  • 2
  • 17
  • 32