Questions tagged [rest-api]

Questions about the core RESTful HTTP API for accessing WP content and data.

Filter by
Sorted by
Tagged with
0
votes
1answer
504 views

Upload image to wordpress using ionic/cordova with WP REST API V2

i am building mobile application with ionic and wordpress rest api v2, how to create post with image or upload image with wp rest api? i just can create post without image. Thanks
0
votes
1answer
333 views

Trouble Commenting via the WP REST API using nonces

I'm trying to post a comment via the WP REST API. Here is my request: axios({ method: 'post', url: `${WP_API_ENDPOINT}/comments`, headers: {'X-WP-Nonce': wpRestSettings.nonce}, data: {...
0
votes
1answer
26 views

Why does “if statement” has to “die()”, otherwise wont work?

if ($_GET['api'] == 'json' && isset($_GET['id'])) { $post = get_post($_GET['id']); // $post contains the post object header("content-type: application/json"); ...
0
votes
1answer
1k views

WP Rest API v2.0 user profile update issue

I'm using WP Rest API plugin to use Wordpress as backend of iOS app. I need to update the username using the following endpoint http://......com/wp-json/wp/v2/users/1?context=edit And this is the ...
0
votes
1answer
39 views

Best way to make a JSON API from Wordpress?

How would you explain this to a newbie? eg.: I have two websites, I want one to display the posts of the other through JSON API?
0
votes
1answer
94 views

custom php file inside my custom folder of plugins directory is not caching

I am using W3-Total-Cache plugin, here is my plugin configurations : I am trying to implement caching on my custom php file. I have created a folder (api) inside plugins directory. i.e /wp-content/...
0
votes
2answers
45 views

Can we use website data which is having wp rest api plugin?

Suppose I have created an app that uses WordPress REST API plugin and displays the posts from the WordPress site. Now, if I find the WordPress site which is having the WP REST API plugin and I am ...
0
votes
1answer
683 views

Handling _embed for custom REST API endpoints

I am preparing a plugin for REST API integration (the WP 4.7 core version) by providing custom endpoints for data from the plugin. One of the things I am trying to do is to set a _links property in ...
0
votes
2answers
824 views

Sending post data over REST API, how to parse shortcodes in post_content?

I am using the REST API to publish posts outside of WordPress, and have run into a problem where not all of my shortcodes are getting processed. Specifically, most of my plugins' shortcodes are ...
0
votes
1answer
1k views

How to get results of subcategories also?(WP Rest Api v2)

We can get posts from a category using below request `/wp/v2/posts?categories=1&search=somequery` It only gives results from category(1) only. How can we get results from category(1) and ...
0
votes
1answer
1k views

Right hook to redirect frontend visitors while respecting rest api plugins to run first?

I don't need a frontend on the WP site. All visitors will be redirected to an external url where my frontend app lives. I now have the following code in the root of my theme functions.php: if ( ! ...
0
votes
0answers
385 views

Rest API User Levels

I've got a a mobile angularjs app that's using https://github.com/Tmeister/wp-api-jwt-auth jwt auth to add to WP_Rest API www.wp-api.org which works fine, when a user is an Administrator. However, ...
0
votes
2answers
117 views

How to do rest APi with wordpress

I want to use rest Api with my website i have WP REST API plugin installed but i don't want to get just posts my website is a listing website all my listings are done with this plugin Listing Builder ...
0
votes
1answer
1k views

Check authentication credentials using WP REST API

I'm using the WP REST API in combination with the Application Passwords plugin. What I would like to do is simply check to make sure a username and password combination (encoded as a base64 string) is ...
0
votes
1answer
252 views

WP Rest API V2 OR Operator in URL

Does anybody know if I can do an OR search in the URL like: http://www.example.com/api/wp-json/wp/v2/books/?(filter[category_name]=anthropology&filter[category_name]=africa)|(filter[category_name]...
0
votes
1answer
118 views

Query only title/field/featured media of posts [closed]

I'm going to develop a Wordpress plugin as a webesrvice for mobile application. How can I get only title/id/featured media of posts in wordpress plugins? I had a look at wordpress developer ...
0
votes
1answer
289 views

WP API users per page

I've been testing around the v2 of the Wordpress plugin WP REST API in a web app. My goal is to develop an Ionic app. I've found a problem, though. I've managed to list 100 posts of a custom post ...
0
votes
1answer
430 views

how to filter the data's comparison operators (>= & <=) & range between values using the WP REST API

I'm quit new for wordpress development. Working with property management website with mobile API Development. Here need to filter the data's for based on conditions like greater than and less than &...
0
votes
0answers
1k views

REST API And Error Codes - No Message

I'm writing some code which inserts a new post and some postmeta using AngularJs and the REST API. I'm filtering the rest_pre_insert{postype} hook which is allowing me to throw an error when the ...
0
votes
2answers
2k views

Why 'do_shortcode' doesn't work in a REST request?

Why do_shortcode doesn't work in a REST call ? In the example below, do_shortcode exists, but the shortcode isn't interpreted. Route declaration /* Adding a route with callback is ...
0
votes
2answers
262 views

Restructure Objects coming from Rest-Api

I am working with wp-rest api and i have this json structure to work with: [ { "id": 11, "title": { "rendered": "Test-Font" }, "acf": { "schrift": [ { "...
0
votes
1answer
1k views

wp_query json ouput

I'm writng custom endpoints for my mobile app.. My output like this Tried somethings, but getting null values for id, title and content. function my_function($request) { $data = array(); $id = (...
0
votes
1answer
198 views

Best Way to detect unique posts in wp rest api

I am developing an android app for my WordPress blog. I have some bad trouble to detect and get post. So first I give u a vision from what I am into: I want to get post from past, so I do this: Get ...
0
votes
1answer
78 views

Connecting a wordpress site to an AngularJS APP

Currently I have a application that needs a blogging system added. The application is built with an AngularJS front-end and a python/Django back end. I wanted to use wordpress as the blogging system ...
0
votes
0answers
894 views

GET request for media files in WP REST API 2 results in an empty array

EDIT: I have reported the issue to the development team of the plugin and they have resolved it in BETA10 version of the plugin. I have been trying to fetch all the media files from the REST API ...
0
votes
1answer
51 views

Upload User Avatar from android to Wordpress using Rest API

I am developing an android app that give users ability to browse , register, login, post and comment to my wordpress blog using Rest Api . I am trying now to add a way for users to update their ...
0
votes
1answer
85 views

how can I add an URL parameter to a rest route using register_rest_route()?

I would like to add a REST route that would looks like .../v1/import/?url=XXX where XXX is an URL. I had a try with register_rest_route('.../v1','import/?url=(?:/(?P<url>\w+))?', array( ...
0
votes
1answer
173 views

PHP: authenticate for a REST request?

I did create some custom endpoints for a plugin i'm working on, with the REST api. It works quite well, but now I would like to secure those requests : I don't want external users (EDIT: I mean remote ...
0
votes
1answer
237 views

Where is the HTML content for my post in the API

I've been looking at the docs and tutorials online to find out if there's a way to get to the html content of my posts. For example, this endpoint gives me all the information related to one post, but ...
0
votes
1answer
867 views

Fatal error: Call to undefined function register_rest_route()

I get the error Fatal error: Call to undefined function register_rest_route() when I try to go to example.com/wp-json. What is wrong? This is how my code looks like: add_action('rest_api_init', ...
0
votes
2answers
248 views

Is it possible to bulk update a table using WP Rest API?

I am new to web services, so kindly bear with me. I am building a WordPress website for a client where they require some data to be stored in a custom table. They have an application which fetches the ...
0
votes
1answer
1k views

Best option to implement external register/login to WP from self-made API

Hi everyone and thank you in advance for reading the question and helping me out. I amb building with a friend an app that uses a custom self-made PHP-MySQL API to be cross-platform. Everything in ...
0
votes
2answers
5k views

How to login via wordpress api and get user details?

I want to login via wordpresss api. I tried with "/wp-json/wp/v2/users" . but it just returns user 1 details. My goal is login via api and fetch all profile information.
-1
votes
1answer
799 views

Call to undefined function upload_is_user_over_quota()

I have two different multisites: www.example.org www.example-two.org On both sites, there are 5 sub-sites. They're hosted on the same server (that I have setup myself using VirtualMin). All 10 sub-...
-1
votes
1answer
378 views

Wordpress REST API not displaying all information

Here is the WP site. And here is the site's REST API. Now if you go to the real estate listings page on the site here, you will find 2 dummy listings, but when I try to search for data of those ...
-1
votes
1answer
405 views

ACF orderby not sorting dates correctly [closed]

I have created a simple headless WP REST API to manage some data to an app I am creating. Per this post I have implemented that filter plugin to re-allow filtering with ACF and the REST API. Therefore,...
-1
votes
1answer
28 views

How to change WordPress api v2

I am working at mobile android app. I want use WordPress api so I need to add new tables to WordPress api layer like shop and hospitals
-1
votes
1answer
29 views

Wordpress API standard compliance and specification for external database [closed]

HOW TO CONNECT WORDPRESS WITH EXTERNAL DB SERVER VIA API?
-1
votes
1answer
139 views

Rest API does not work after changing Wordpress Theme

Rest API works perfectly with default theme twenty sixteen, but when I change the theme the post on site does not appear. Anyone have the exact problem? <script type="text/javascript"> $(...
-1
votes
2answers
46 views

Create a new page on front page for logged in user

I am going to find a way for logged in users to create pages from front page. For example there are three buttons so called button1,2,3. When logged in users clicks on button1, a page with title ...
-1
votes
1answer
2k views

Using Wordpress.com API to retrieve featured images

I'm using the wordpress.com API to access a blog's content: https://public-api.wordpress.com/wp/v2/sites/MYSITENUMBER/pages It works great, I can access all the text content I need, however, I ...
-1
votes
2answers
2k views

WooCommerce REST API endpoints don't exist

Note: This question is a verbatim copy of the one I posted a week ago there. I've tried various solutions from other questions with no luck, until someone suggested that I ask here on the WP dedicated ...
-2
votes
1answer
25 views

how to know that a wordpress plugin support using API?

i want to ask about wordpress plugins how i can know that the plugin support api and can be used to build apps with Rest-api and some platform like React Native to build apps. the plugin need users ...
-2
votes
1answer
170 views

How many users/load can the rest API handle?

Can the Wordpress rest API be used by thousands of public users at the same time or is it limited for only developers to use? I want to use the API to serve content to thousands of users, but am ...
-2
votes
1answer
21 views

Taxonomy term RestApi data 10 rows limitions

i have created a pod taxonomy(Products) in Wordpress ... i have 16 item of terms(categories) for product taxonomy ... but after going to this routes : http://...../wp-json/wp/v2/product_categories , ...

1
13 14 15 16
17