Questions tagged [rest-api]

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

393 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
365 views

Creating a contact form with Laravel frontend

I'm building my site with a Laravel frontend. The idea is that I can build the website in Laravel and simply use WordPress as a CMS for the content. I'm using Corcel to achieve this and so far it is ...
1
vote
1answer
137 views

Ajax with plugins returns 0

I'm trying to create buttons in edit-comments table, and I want to use Ajax with a plugin for the task. This is the code of the plugin under plugins/no_email/no_email.php : <?php /* Plugin Name:...
1
vote
1answer
32 views

Unknown characters added to meta data values

I am trying to import post meta through the REST API. I have the meta value set on the parent site, but when I import the post to the child site there are additional characters added to the value. ...
1
vote
0answers
318 views

REST API authentication for a plugin

For a plugin I write a bookmarklet which will make a REST call to an custom post type (CPT) endpoint to save the data. To save a CPT I need to authenticate the user, unfortunately, this is not ...
1
vote
1answer
44 views

Manipulating/view postmeta remotely

I'm new to WordPress development. I'm using a plugin, "Tribe Events," that stores event venues and organizers associated with an event in the wp_postmeta table and I want to be able to easily access ...
1
vote
0answers
921 views

Passing Meta array in wp-rest api

I have been trying to pass a meta array to a post via front-end using WP-REST API but to no avail. functions.php: //Add custom field to REST API function filter_post_json( $data, $post, $context ) { ...
1
vote
0answers
310 views

WP-REST create user with custom meta

Hello first time messing with wordpress. I'm trying to create users from another express app but having some problem creating custom meta for them ? I tried a POST like this but it failed to create ...
1
vote
0answers
1k views

receive a custom parameter with rest api

I have a WordPress page that show some fields that are given in the query string for example I can call the page with : www.mysite.com/mypage?testparam=myvalue and in the page I have this ...
1
vote
0answers
115 views

how to save selected option in variable for rest api category filter

I am using this code to select category,now i want to save the selected category in variable and pass it to wp rest api post url.. echo '<select name="categories">'; // Add custom option as ...
1
vote
1answer
494 views

Custom REST endpoints for a custom post type with custom fields

I am working on a wordpress project that is highly customized. I have custom post type "foo-post" and within there I have a custom field "foo-field" (created by advanced custom fields plugin and is ...
1
vote
0answers
263 views

WP API post__not_in is not working

I'm using WP API to get posts in my application and I'm trying to exclude some posts from query using filter[post__not_in]. after removing filter in WP 4.7, I'm using WP REST API filter parameter ...
1
vote
0answers
778 views

Loop Performance > JSON files vs. WP_Query vs. REST API

I've a site that uses just about a bazillion complex loops...in many instances. For many said loops, I found myself using WP_Query to create an array only to use another WP_Query ad-almost-infinitum ...
1
vote
0answers
166 views

REST API: Limit Read Permissions for Default Endpoints

What is the best way to limit read access for certain endpoints? (we're assuming I already have an authentication method in place) For example, I have a custom post type 'resume', which is registered ...
1
vote
1answer
706 views

Embedding custom posts with REST API

I am trying to find a way to embed basing custom post infomation, such as post title and few custom metas on other website. The easiest seems to be doing it in iFrame, but there are many "no's", you ...
1
vote
0answers
1k views

how to do login using woocommerce rest api From android

I am finding solutions online but nothing work for me any once can help me for this problem i am using this document for reference but not getting any solutions if any clue please help me http://...
1
vote
0answers
125 views

Why it doesn't show media urls on rest Api? (Wordpress)

Im using Listable theme on my website and Rest Api because im developing the Android App. I need to show on the rest api the url links of my listings but they doesn't show. For example here: http://...
1
vote
0answers
384 views

How to do POST request with WP REST API v2 to custom table?

I have custom table called wp_props and need to make simple search with a couple of params and return json data. I want to use WP REST API for that, how to use custom table with that api as I see only ...
1
vote
1answer
439 views

rest api request including meta_query filter

I'm creating a web service using the WP REST API v.2. Is it possible to include something like a meta_query filter when requesting a custom post type? For example, if I was using WP_Query, I could ...
1
vote
2answers
97 views

How do I query my Wordpress posts on another HTML page using the Wordpress Restful API?

I have a fully functional Wordpress site and I want the to create a new separate website that displays the posts from the wordpress site using the Wordpress Rest API. I understand that typing http://...
1
vote
2answers
4k views

Problem with Woocommerce REST API Authentication

I am using the postman for the check the REST API Call in WooCommerce. When I call the Woocommerce Defaults API. It displays the error like. { "code": "woocommerce_rest_cannot_create", "message": "...
1
vote
1answer
262 views

Post to WordPress using REST API from external site

I am trying to post to WordPress using the REST API. The aim is to have a form that accepts The following information: Title Content ACF Custom Field 1 (possibly repeater field) ACF Custom Field 2 (...
0
votes
0answers
10 views

Uploading pic via rest api

I have picture URL like http://cdn.action.pl/File.aspx?CID=73191&UID=jani1903&PID=115d9055a5d14aeacec6ecbb1484714f&P=/Pictures/KSL/SON/KSL/KSLSONKSL0059/29X0c3F9t0I051R5P7Q5u8K8k1A3O0s1....
0
votes
0answers
18 views

Wordpress REST API Search decoded URL with cyrillyc symbols

I'm trying to use REST API search opportunity with string: https://example.com/wp-json/wp/v2/posts?search=searchquerry, but it doesn't works with decoded url and cyrillyc symbols. For example, if I ...
0
votes
0answers
13 views

WooCommerece REST API not showing all subcategories by parent

I'm requesting to the following endpoint: wp-json/wc/v3/categories?parent=someID I get a response for the first 2 children, but those children also have children (deeply nested here of categories ...
0
votes
0answers
21 views

Loop through Wordpress API response errors

I am having trouble parsing my AJAX response from my WordPress API that my hybrid mobile app is making. Below is (one of many ways I have tried to parse the response all of which have not worked): ...
0
votes
0answers
20 views

Showing Modal in Gutenberg Save Method

I have custom post type which is "persons" I am getting these custom post types using Wordpress API and withSelect method. I am also using semantic-ui-react for my User interfaces. edit: withSelect( (...
0
votes
0answers
29 views

How to modify the HTML output of Gutenberg block? (Youtube)

I'm using a headless Wordpress linked to a Nuxt projet and I like to modify the output of my Gutenblock when it's called from the REST API. Current ouput is : <!-- wp:core-embed/youtube {"url":"...
0
votes
1answer
22 views

Get custom post type REST API not working

I want to load the content of a modal using the REST API of wordpress. I've added the show_in_rest param to the custom post type I've registered in my function file, but I'm unable to load it, I will ...
0
votes
0answers
24 views

How can I add a meta[] to my custom post type and search by term with the Rest API?

I just started to use the Rest API and I want to get all posts that belong to a certain taxonomy and term(s) within that taxonomy. That part is working now. Then I want the those posts to have a meta[...
0
votes
0answers
32 views

Create user with ACF custom fields via REST API

I'm unable to create a User via the WordPress REST API when I include custom fields within the payload. I have 2 custom fields on the User object, created with ACF: phone_number (string) state (...
0
votes
0answers
16 views

API call returning wrong data

My question/issue is that wp_remote_get() is pulling in the wrong page/data on one site, and I'm stumped. I have 3 WP sites. Site 1 has a page with content that is used across all three sites. The ...
0
votes
0answers
27 views

How to create thumbnails programmatically?

I've migrated content from a CMS (not WP) to Wordpress, through a nodejs script that uses the package wpapi (https://github.com/WP-API/node-wpapi). The main image is set as a featured image in ...
0
votes
1answer
28 views

Extract XML/JSON element from Zillow API response and populate into Gravity Forms field

Given this stack: WordPress 5.3 GravityForms 2.4.15.6 (paid: common, right?) Forms: 3rd-Party Integration (free: Link to WordPress plugin page) Forms: 3rd-Party Inject Results (free: Link to ...
0
votes
0answers
57 views

save_post hook error with REST API

I'm trying to auto generate the post title and slug for a custom post type upon post creation. It's sort of a log book, the users will only write in the main content field. The title and slug both ...
0
votes
0answers
26 views

Connecting Wordpress with an External API

I need insight into connecting a Wordpress with an external API. This is the expected action needed to be carried out. A user tries to search on the Wordpress with four different forms fields (...
0
votes
0answers
58 views

Wordpress forbidden 403 on delete in production vs local environment

i build a system that allow the user to delete post by ID with wordpress API. this system works fine on localhost, but after i uploaded the site to production i can't delete the post all i get is an ...
0
votes
0answers
59 views

Get featured image and additional posts thumbnail Wordpress REST API

I want to use the REST API of wordpress to build a new version of a custom theme. I'm able to get the json response of a particular category, but I need to find a way to obtain also the featured image ...
0
votes
0answers
21 views

How much PHP and MySQL or MariaDB knowledge should I know to start writing WordPress themes and plug-ins and whatever else a beginner can edit?

I'm not a novice web developer. I know how to use Python and Django at a beginner to intermediate level. I know my basic HTML5, CSS, and JS. I've been learning React.js through Scrimba.com as well as ...
0
votes
0answers
16 views

API POST to Quickbooks with OAuth

I have created a form on my website for the customer to fill, and I would like to use this data to create a customer in Quickbooks, I have the javascript API code functioning in vs code with node.js, ...
0
votes
1answer
12 views

rest api add post meta

I want to show tow post meta in one rendered field rest api my fields are 1- folder_path 2- file_name call example website/folderpath/filename.ext i want to show it everywhere in rest api ...
0
votes
0answers
9 views

Adding get_results to wp rest api

I got custom function where I retrieve guid's attached to each post. Now I want to add this on WordPress API. global $wpdb; $post_id= $object['id']; $sql = "SELECT post_content FROM wp_posts WHERE ...
0
votes
0answers
13 views

Filter terms not working properly in rest API

I'm using rest-api plugin to fetch flight details from wordpress. I had registered a custom taxonomy called 'searchflight' with terms corresponding to country,city and flight. My problem is that when ...
0
votes
0answers
20 views

How to set the post permalink using the WordPress REST API?

When fetching the posts, I can access the link property which represents the full post link. But when creating a post, what is the way to set that permalink value? Setting the slug does not seem to ...
0
votes
0answers
23 views

How achive serving multiple concurrent Ajax / Rest calls in plugin?

I am developing a plugin that does at some point gather a bunch of data from a bunch of other servers. So for each of these servers, there will be one ajax call in the frontend that expects xhr ...
0
votes
0answers
8 views

Batch creating Product and variations

We have a multisite where the main site contains "all" products. Each sub-site is its own store with its own products. Products in the sub sites are created using a React application where users log ...
0
votes
0answers
18 views

WP Rest API, reset pagination when fetching posts from a new category

I am using ajax and the Wp Rest API to fetch posts from different categories. When I click on a category link, the posts from that category are loaded into the page. What pagination options do I have ...
0
votes
0answers
30 views

WC REST API Error Handling

I am using the WooCommerce Rest API to query the products on a WooCommerce store. The Product ID ($id) is retrieved from the order line items. Some of the old orders in my database have products that ...
0
votes
0answers
89 views

WP Rest API not working

WP 5.2.4 /wp-json/wp/v2/ Gives 404 error. I updated permalinks,have a working .htaccess on Apache and not using "plain permalinks" and still this thing don't work. My Apache and its configuration ...
0
votes
0answers
37 views

CRUD from WordPress to Business Central 365 through OData REST API

The goal here is to use WordPress as a front-end to create, read, update and delete data which is being pulled from Microsoft Dynamics 365 Business Central through OData Webservices in a JSON format. ...
0
votes
0answers
14 views

All permission check methods are called on request

Requesting the create_item() method in my custom rest-controller::WP_REST_CONTROLLER all registered and implementd permission-callbacks are called. Echo the name of the permission-callback in the ...