Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rest-api]

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

0
votes
0answers
18 views

How to make a Wordpress REST API?

If I declare a PHP variable in custom page: carbon_get_theme_option( 'crb_myName_field' ); Then I use Axios to get this variable via Javascript but not sure which is URL... how do you achieve it?
0
votes
0answers
19 views

Autotrader API Integration

I am looking to pull in a feed of used cars from Autotrader. Has anyone had any luck with the Autotrader API Docs and integrating with WordPress? Their current API documentation is very vague - is ...
0
votes
0answers
11 views

Attachment metadata has value of '1'

While accessing /wp-json/wp/v2/media endpoint I'd got an error 500. Checking the logs, I'd seen the following issue: PHP Recoverable fatal error: Object of class stdClass could not be converted to ...
1
vote
0answers
19 views

Extending wp JavaScript base class to make a post request to a custom REST endpoint

I've defined a REST endpoint /my-plugin/v1/post-read to show whether a post has been read or not, per-user. In PHP, my plugin keeps track of this depending on page views while logged in. I'm now ...
0
votes
1answer
48 views

How to use Python to create a Post in Wordpress?

I found the API reference here: https://v2.wp-api.org/reference/posts/ Based on the API reference above, I wrote this Python code: from urllib.request import Request, urlopen from datetime import ...
0
votes
0answers
19 views

Woocommerce brands rest api problem [closed]

When adding the product is not added to the brand. /wp-json/wc/v3/products/ brands[0][id]
0
votes
0answers
9 views

Relations between taxonomy terms for getting parent child nested Json objects and arrays

i have 2 taxonomies (cat) (subcat) and they have some terms(rows) for example , , i want make a relation like SQL data tables between the taxonomy terms for giving me a nested object of arrays in the ...
0
votes
1answer
19 views

Upload buddypress profile and cover photo using rest API

How can i upload buddypress profile and cover photo using WP rest API. I have created the custom endpoint and have the image ready in base64 within the app and all the authentication and stuff in ...
-2
votes
2answers
34 views

Get all orders Problem [on hold]

wp-json/wc/v3/orders?customer=18 When I login with admin orders are coming. but the seller comes empty when I login. incoming postman result; [ ]
-1
votes
0answers
12 views

what is the endpoint to create login and register in a react native app by using woo rest api [closed]

hi there after reading woocommerce rest api documentaion but i cant found end point to create login and register in a react app like on woordpress website
0
votes
0answers
15 views

Dokan rest api Get all orders problem [closed]

Dokan module rest api When I log in as admin, it brings all orders. But when I login as a vendor, it does not bring orders. incoming postman result; [] GET /wp-json/dokan/v1/orders/ HTTP/1.1 Host: ...
0
votes
1answer
20 views

Woocommerce Rest Api Categories problem

/wp-json/wc/v3/products/categories My site has 10 main categories. But when I run the query, only 3 main categories and their subcategories are listed. Other categories don’t come up with what could ...
0
votes
0answers
20 views

Make a plugin API accessible

I have a few plugins and I want to alter them to make each of them responsive to API calls I.e GET, POST, EDIT and DELETE data. ultimately I want to make calls from my Cordova app to communicate with ...
0
votes
0answers
10 views

Customer Count of last object of Totals is always 0 from Woocommerce sales report api [closed]

I am using Woocommerce Offcial php rest Api library in my local Crm application. And calling Sales report data. $query = [ 'context' => 'view', 'date_min' => '2019-01-01', 'date_max' => '...
0
votes
1answer
56 views

How to render WP Rest-API Endpoints in a React.js Theme with Woocommerce

I am building a Ecommerce Wordpress/Woocommerce Theme using React.js. I am using the npm package: create-react-wptheme This package renders the react app directly inside of the index.php of the ...
0
votes
0answers
15 views

Create new editable route/endpoint based on meta key

I'm currently making a store which is receiving it's data from external sources. Being new to the world of editing/creating REST API, I've come across a problem. The problem is that the external ...
0
votes
1answer
14 views

Notify Jenkins of new post on Wordpress

Does anyone know if it is possible to "notify" a Jenkins VI server whenever a new post is made on a headless wordpress installation? The reason why I'm asking this is because I'm using gatsby to ...
0
votes
0answers
11 views

Autosave for frontend editing

I have pages for draft posts, new posts, and all posts. I am using modified version of plugin Frontier Post. How can I have it to auto save the progress on a separate page (revisions page). This ...
0
votes
1answer
19 views

Update user meta via REST API?

I have a native app project that gets all data from /wp-json/wp/v2. I've registered phone using this register_meta('user', 'phone', array( "type" => "string", "show_in_rest" => true ));...
0
votes
1answer
19 views

Wordpress API for custom post types returns rest_no_route

I created a custom post type and I am trying to get the posts from it using WP-API, however, when I try to access the API I get the error rest_no_route message. The set up for my custom post type is ...
-2
votes
1answer
17 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 , ...
0
votes
1answer
21 views

Access WP_REST_Server from within plugin namespace

I am new to OOP and developing plugins. I have developed a plugin using the Plugin-Boilerplate with namespace. I expanded the boilerplate to include a REST folder and class so I could create custom ...
0
votes
0answers
23 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
2answers
25 views

Store post in raw markdown format, no html?

Is it possible to store posts in pure markdown format? so that I can retrieve the content through the REST API and get the markdown code, without any added html?
-1
votes
2answers
31 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 ...
0
votes
0answers
25 views

Understanding SHORTINIT with Wordpress 5

What I am trying to achieve I am looking at using Wordpress decoupled, and most tutorials and guides go into detail on using the Rest API. Recently, I discovered the SHORTINIT option to load a very ...
0
votes
0answers
14 views

Order REST API by acf date picker

I'm currently working with wordpress API, I need to order my callback from the api by my ACF. Right now my query looks like this: https://odeonodense.dk/wp-json/wp/v2/events I want to order this ...
0
votes
0answers
14 views

Getting products categorized of multiple woocommerce stores by API [on hold]

How can I get products categorized of multiple woocommerce stores by API? Note that products can have a different category with each other but with common meaning. Like 'toy' and 'plaything'.
0
votes
0answers
6 views

create post usin rest API only after user have been registered and logged in via ajax returns 403 cookie nonce is invalid

I have a 3 step form and the last step is register or log in step. If the user is already logged in the third step is not shown to him and after second step the form will generate post using wp rest ...
0
votes
1answer
21 views

How to create callback function which returns all posts with specific data?

I need to create a new route all which returns only the specified fields for all posts. add_action( 'rest_api_init', function () { register_rest_route( 'custom', 'all' ,array( 'methods'...
1
vote
1answer
19 views

Why my admin doesn't work after adding rest_prepare_post filter?

When I add a filter to custom get_all_posts API callback, API works, but the admin page for each page is blank. Why? function get_all_posts( $data, $post, $context ) { return [ 'id' ...
0
votes
0answers
30 views

Upload Media using the WP API

I'm trying to create a plugin to allow me to upload media files to the media library using the WordPress API V2. I'm trying to use Filepond to do this but I'm facing a 401 unauthorized issue. plugin....
0
votes
1answer
30 views

Custom route and query

I am trying to use a custom WordPress route and function, but I am getting a route and function not found error. Below is my code but I am not sure where it is breaking: add_action('rest_api_init', ...
0
votes
1answer
20 views

ACF attachment custom field in rest response

I created an extra select option ACF field for media uploader and I would like to retrieve the associated values in Gutenberg MediaUploader onSelect. Is there a workaround for this case?
0
votes
2answers
41 views

Detect if REST API is running

Many times I have code and I want to make sure it only runs in a rest api context, or it never runs in a rest context. I know there are some hooks, but is there a function similar to wp_is_doing_cron?...
1
vote
1answer
32 views

WordPress 5 WP REST routes - No errors

I'm using WP JSON to return JSON for certain routes. Prior to WordPress 5, WP JSON would return PHP errors in the response, e.g. Notice:xxx or Warning:xxx when a PHP error was encountered. Since I ...
0
votes
1answer
27 views

Using The REST API How To Pull All Custom Posts?

What I am trying to do is pull back all posts of a custom post type. I know with the WordPress REST API you can add per_page=100 to the end of the REST API to pull back 100 posts, but I need a way to ...
0
votes
0answers
32 views

REST API v2: Get List of Posts by Multple Taxonomy Tags using AND Operator

I'm currently working on an Angular application that interfaces with Wordpress' REST api. A major component of this application is a filterable index of Posts where users can select multiple tags to ...
0
votes
0answers
17 views

Get value of HAL links of post fetched from WordPress REST API

I'm fetching a list of posts from the WordPress Rest API and receive them fine. After receiving them I want to display/work with the links passed by the API at the End of the response. The links are ...
0
votes
1answer
21 views

Serve text/html from wp-json API via WPEngine, headers not being set properly

I have read multiple entries in the WP Codex, numerous articles and Stack Exchange questions. I have a fully functioning API for a private plugin I am developing, but when moving it into production on ...
0
votes
0answers
21 views

Woocommerce REST API for my account & checkout process

I'm new in WooCommerce REST API, I have worked with custom endpoints but I need some help/tutorial related to WooCommerce REST API. I have research about it but I didn't found any tutorial(s) for this....
0
votes
0answers
58 views

Custom meta POST request fired twice when updating a post in Gutenberg

I have made a feature similar in behaviour to Revision Notes, but for Gutenberg. It is a Gutenberg sidebar plugin which adds a text field where users can write an edit summary when they edit a post, ...
0
votes
0answers
18 views

get all event tickets rest api

i'm using ticketra as a plugin and i have donig so will untill i want to get all event's tickets by event id, here is the json response of tickets custom post type: { "id": 159, "date": "2019-01-...
0
votes
2answers
22 views

Why does AWStats show /wp-json* as Viewed URLs

Generally, I track site resource usage using Google Analytics. Recently, I needed to check a clients site stats through AWStats instead. I noticed a number of URLs starting with /wp-json ... My ...
0
votes
0answers
22 views

Wordpress Update Role using API Cross site

I want to get user by email address. Getting issue with custom api endpoint route. function getUserByEmail( $data ) { $user = get_user_by( 'email', $data['email'] ); if ( empty( $...
0
votes
1answer
30 views

Wordpress: How to create custom REST API route?

How can we create custom REST API route for sending specific data format to Android or IOS app ?
0
votes
0answers
46 views

Rest API. Post content

Good afternoon everyone. I have a website made with wordpress version 5.02. I want to use Rest Api functionality for developing native android application. At this address https://my-site/wp-json I ...
0
votes
1answer
39 views

Woocommerce REST API: creating variations

I'm using the Woocommerce REST API to automatically create product variations when a new product is added. The idea behind it, is that for every new product a variation for the paper size of the ...
0
votes
0answers
36 views

Wordpress search post using unicode

I'm working with wordpress rest api I need to searching WP posts with unicode character example searching on my site: https://example.net/?s=ngoại+tình The results is OK The I applied to my api : ...
0
votes
0answers
55 views

REST API get featured image source for custom post type

I created a custom post type and am getting the posts using the REST API. The returned json looks like this... categories: [] content: {raw: "Morbi mollis tellus ac sapien. Etiam ut purus matt…allis ...