Questions tagged [wp-api]

Provides an easy to use HTTP REST API to access your WordPress site’s data.

This project was born to create an easy-to-use, easy-to-understand and well-tested framework for creating these APIs, plus creating APIs for core.

This plugin provides an easy to use REST API, available via HTTP. Grab your site’s data in simple JSON format, including users, posts, taxonomies and more. Retrieving or updating data is as simple as sending a HTTP request.

Official website

221 questions
61
votes
14 answers

Wordpress REST API (wp-api) 404 Error: Cannot access the WordPress REST API

I have been using the Wordpress REST plugin WP-API for months now while developing locally with XAMPP. I recently migrated my site to an EC2 instance and everything is working fine except I now get a 404 with the following message whenever I try to…
dsal1951
  • 1,240
  • 1
  • 14
  • 20
14
votes
3 answers

Rendering external HTML/React components dynamically in React

Is it possible to take HTML/JSX content from an external source and render it in dynamically in React? In our case we want to take content from the Wordpress API and render it on both the client and the server (we're using NextJS) So, the Wordpress…
jonhobbs
  • 21,469
  • 23
  • 94
  • 144
13
votes
1 answer

Fetching drafts forbidden in Wordpress rest api

I am using the wpapi npm module to interface with the WP rest api in a node app. I am authenticated and my user created some draft posts. When I go to the dashboard with the same credentials, I can see/edit the draft posts as well. I am using this…
motleydev
  • 3,007
  • 6
  • 26
  • 45
12
votes
4 answers

Disable default routes of WP REST API

I need to disable default routes of WP REST API and add custom routes. I found this question which helps me to find following answer. remove_action('rest_api_init', 'create_initial_rest_routes', 99); However this will also remove any custom…
Janith Chinthana
  • 3,494
  • 2
  • 23
  • 50
12
votes
3 answers

how to send HttpRequest and get Json response in android?

i want to build an android app for my wordpress website using wp-api plugin. how can i send HttpRequest(GET) and recive response in Json?
moosavi
  • 134
  • 1
  • 1
  • 12
12
votes
1 answer

Android Loopj image upload broken with WP API v1 & v2

I'm using Loopj to upload files into my WordPress site and WP REST API v1 and/or v2 (same results). The authentications goes great, headers goes great, file "uploads" but when I check it in my WordPress backend... the image or file is broken. The…
Mariano Zorrilla
  • 5,125
  • 2
  • 22
  • 44
10
votes
5 answers

How can I get a list of posts for a category with WP-API?

Should be easy, but didnt find it in the WP-API docs.
thomers
  • 2,483
  • 4
  • 26
  • 47
9
votes
3 answers

How to generate Retrofit client library from wp rest api using swagger

I am creating android client for my WordPress website . Is there a way to generate retrofit 2 client library from wp rest client using swagger or is there any other tool to generate the same .
Rahul
  • 327
  • 1
  • 4
  • 26
8
votes
2 answers

WP rest API get post by title

I'm trying to check by a post title if post exist or not. For some reason when i try something like: http://domain.com/wp-json/wp/v2/posts?filter[post-title]=table I want if post with the name table exist, to get the post, if not, get an empty…
BenB
  • 2,180
  • 2
  • 22
  • 41
7
votes
1 answer

WP_REST_Response vs WP_Error

I'm a bit confused about how errors are handled in Wordpress's REST API. In their examples, they suggest using WP_Error to return errors, but WP_REST_Response has the HTTP status code as a second parameter, which makes it shorter and somewhat…
Dmitriy Gamolin
  • 844
  • 1
  • 11
  • 27
7
votes
1 answer

Using Contact Form 7 via WP REST API

Having little access to the server on this external site, I have used WordPress and the WP REST API v2 to pull in content that is, of course, managed on WordPress. Works great! I have been able to post Contact Form 7 data from this external site to…
pelicanpaul
  • 186
  • 1
  • 7
7
votes
4 answers

Make WordPress WP-API faster by not loading theme and plugins

I would like to make requests to the WordPress API much faster. My API is implemented in a plugin (using register_rest_route to register my routes). However, since this is a plugin, everything is loaded with it (the child-theme and the theme) and…
TigrouMeow
  • 960
  • 3
  • 16
  • 28
7
votes
4 answers

WP Rest API + AngularJS : How to grab Featured Image for display on page?

I am accessing Wordpress data through an HTTP REST API plugin (this wordpress plugin: http://v2.wp-api.org/). I know how to grab my post title, but how do I display the featured image associated with that post using this plugin? My test shows the…
redshift
  • 3,166
  • 12
  • 41
  • 94
6
votes
3 answers

How to filter posts modified after specific date in Wordpress API v2

I am trying to fetch(filter) the posts modified after specific date through WordPress REST API 2.0-beta15 & WordPress v4.8.3 and update that with the existing posts in my client app. Using after and before query params provided by WordPress I can…
6
votes
1 answer

Assign custom taxonomy to post with REST API

I'm using the built-in WP REST API to create posts (custom post type). I've got this part working, below is some example JSON I submit to create a new post. { "title": "The story of Dr Foo", "content": "This is the story content", …
Ashley Brown
  • 4,756
  • 6
  • 32
  • 70
1
2 3
14 15