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

235 questions
0
votes
1 answer

Wordpress Questions - Access from api

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…
rnjai
  • 1,065
  • 2
  • 17
  • 32
0
votes
1 answer

Wordpress api wp-api v2 + JWT 401 Error

I'm having trouble trying to connect with WP-API + JWT. My request get a 401 response "code":"rest_not_logged_in","message":"No estas conectado.","data":{"status":401} Request headers: Request…
0
votes
1 answer

Wordpress API not returning anything until I use rest_ensure_response

I have a JWT plugin for authentication but when I make call to /wp-json/jwt-auth/v1/token it doesn't return anything, so I tried to return the response from rest_ensure_response function and it returned the response correctly. It was also the…
Suhail Akhtar
  • 1,718
  • 15
  • 29
0
votes
1 answer

Sending arguments to a PHP callback

I'm using wordpress wp-api to create some endpoints and I have this call: register_rest_route('1.00', '/trial/confirm', array( 'methods' => 'POST', 'callback' => array($trial_service, 'callback_confirm'), …
zag2010
  • 439
  • 2
  • 4
  • 10
0
votes
0 answers

Node module similar with passportJS that offers oauth, local, and basic strategy authentications?

Are there any node module that can compete with passportJS. Something that can provide oauth1, oauth2, local and basic authentication? I've been trying to login to wordpress using wordpress API. I managed to login successfully using oauth2 but…
0
votes
2 answers

WP API featured image attachment

Using WP API I am trying to get the featured image from a post but unsuccessful - here is the line of code that is not working: ourHTMLString += postsData[i]._links[i].wp:featuredmedia[i].href.guid.rendered; The other lines of code is working. Here…
roshambo
  • 2,624
  • 6
  • 31
  • 54
0
votes
1 answer

wordpress statistic of wp api

I'm aware that there are tons of plugins that can track user behaviour in a wordpress site. Those plugins can track how many views does a blog post has. Currently, I am developing an ionic app where the contents come from wordpress served by using…
Syahnur Nizam
  • 81
  • 1
  • 12
0
votes
1 answer

WP API Media create() required parameters

I'm trying to make a request to post / upload a new media with WP API v2 (WP 4.7.3). I'm using a Node client (https://github.com/WP-API/node-wpapi) to deal with this. As I'm only getting errors 400 rest_upload_no_data, I'm trying to find which…
enguerranws
  • 8,087
  • 8
  • 49
  • 97
0
votes
1 answer

How to make WordPress Rest API parameters accessible without authentication?

How can I make certain parameters of the WordPress Rest API accessible to anyone without first being authenticated – for example, the page parameter doesn't work (where blog is a custom post type) in this…
gray
  • 798
  • 18
  • 31
0
votes
1 answer

Include categories custom fields in REST api

I am working with Advanced custom fields, where I add an image selector for categories in wp - But I can't see the data in my JSON response for categories? I have tried to use several plugins to do the same, but That haven't worked either - I am…
Stender
  • 2,446
  • 1
  • 14
  • 22
0
votes
1 answer

Ionic 2 WP-REST API post request 401 error with headers set for basic authentication

I am developing a simple application to create a post in Wordpress through wp-rest api. Everything(creating, updating deleting posts) works fine on postman. I can even fetch posts using same api in my application. but when I try to create a posts…
0
votes
1 answer

Error WordPress REST API V2 call with Vue.js

I am getting the following error, when I make a call to WP REST API with Vue.js and axios. XMLHttpRequest cannot load http://my-wordpress-site.com/wp-json/wp/v2/posts. The 'Access-Control-Allow-Origin' header has a value 'http://null' that is not…
gassio
  • 185
  • 2
  • 13
0
votes
1 answer

add fields to wp api categories request

I am able to add fields to wp api post request i.e. http://demo.wp-api.org/wp-json/wp/v2/posts using rest_prepare_post filter like this : function my_rest_prepare_post( $data, $post, $request ) { $_data = $data->data; $thumbnail_id =…
Abhishek Kumar
  • 2,136
  • 3
  • 24
  • 36
0
votes
0 answers

Post request to custom end point

I wish to make a post request to a remote site but so that it updates remote site with data from database. I succeeded in getting the data using get request from database of current site but am unable to create a callback function for the post…
Landry
  • 137
  • 11
0
votes
1 answer

How do I access the nested categories data and reference it in my controller?

I'm creating an Ionic app with the WP Rest API. I have returned the post data but I'm furthermore looking to get the category name. The JSON data for the posts only contains the category ID. I am trying to access the category ID and reference it in…
kristofferandreasen
  • 847
  • 2
  • 12
  • 24