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
0answers
7 views

How do I read Jira issues in a WordPress site using OAuth?

We're trying to setup the Jira REST api and are getting hung up on the OAuth authentication process. We followed the Atlassian (Jira) examples for this but they are seemingly outdated and not working. ...
0
votes
0answers
8 views

Downloads from my plugin not shown after migrating to up2date WP/WooCommerce

What does the plugin: The Plugin creates a custom endpoint which is used to pass the download URL to woocommerce as post metadata and complete the order. It adds the download with order id, date and ...
0
votes
0answers
9 views

Oauth question for gravity forms API in python

I'm trying to access the entries endpoint via python on a wordpress site. I am able to use Postman successfully, but when I try to use the requests library in python I run into some errors. First I ...
1
vote
0answers
11 views

Formating content rendered from wordpress REST API as JSON and not HTML

I am new to Wordpress and REST API and I need to read posts from /wp-json/wp/v2/posts with an external application called Intuiface. Intuiface can interpret JSON but the content of the post is shown ...
0
votes
0answers
21 views

Rest API and how to deal with it in server side

I'm developing a wordpress theme that uses REST API mostly. Normally I'm just creating a custom endpoint and pulling the data from that endpoint with vanilla JS's fetch. My problem is: I have a ...
1
vote
0answers
16 views

Ho to style post content for Wordpress API?

I'm completely new to Wordpress and Wordpress API. I managed to understand how the API works and how to fetch data from it on my Vue application. Now, I have an issue with my posts. I am trying to ...
1
vote
0answers
12 views

Use the backbone.js client to save custom post type meta

So I have this small piece of code that renders an array of IDs: const selected = this.$data.list.selected; function get_ids(input, field) { const output = []; for (let i=0; i < input....
2
votes
0answers
21 views

Wordpress blog posts api - get posts by author

Is there a standard route for getting all blog posts by specific author id? I can't find anything obvious. I tried this but I get a 404 error http://localhost:8888/mysite/wp-json/wp/v2/posts?author=...
0
votes
0answers
10 views

Need to display custom post type data in xml format in domainname.com/example.xml url

I need to display custom post type all data as XML format in domain.com/example.xml url Please guide me that how can I do it. It will be always updated details. Site is in wordpress.
0
votes
0answers
12 views

Woocommerce REST API - add filter to set maximum query per page for product brands

I'm trying to list all my product brands in a single page, currently i'm able to get only 100 brands per page by using wp-json/wc/v3/products/brands?per_page=100. but if i set per_page=200, i'm ...
0
votes
1answer
21 views

wp_get_object_terms() returns invalid taxonomy inside rest_api_init hook

I have created a taxonomy called 'country' and I have created a function that hooks into rest_api_init inside which is wp_get_object_terms($post-ID, 'country'). For some reason wp_get_object_terms ...
0
votes
1answer
26 views

Application passwords not working on localhost?

I have to get following error on the localhost "code":"application_passwords_disabled" Server & Apache: Xampp v3.2.4 OP: Win 10 64Bit WP: v5.6.1
0
votes
0answers
12 views

Woocommerce API v3 get products in multiple categories - relation AND [closed]

all of these show products in any of these categories. I want only products with ALL categories. wp-json/wc/v3/products?category=126&category=123&category=125 wp-json/wc/v3/products?category=...
1
vote
0answers
15 views

Override Wordpress POST REST API

I use the REST API to create post and taxonomy remotely in a Wordpress website. It works perfectly for classical fields but i need to send some custom fields, and there are not interpreted by ...
0
votes
0answers
16 views

External API integration in WordPress

I have API URL where I have access key and token along with JSON format. Now I need help as to how to integrate it. My clients need his form leads directly into his API. Below is the code with the ...
0
votes
0answers
15 views

Escape commas in REST API

Sending metadata through the REST API like this, is creating multiple entries because of the commas meta: { plugin_rule_what: 'discount_percentage', plugin_rule_applies_multiple_options:'product_22119,...
1
vote
1answer
118 views

How to stop a Gutenberg Block from firing multiple GET Requests?

I've been building a Gutenberg Block that sends a GET request to the Woocommerce REST API. It is composed of a text input that receives an ID of a product and fetches it to the Woocommerce REST API. ...
0
votes
0answers
14 views

building a new site, can i use the woocommerce Rest API for bulk importing

for work, i have been tasked with building a new website. their main concerns with the new site was a better categorisation system. in order to import their products from the old site to the new one, ...
0
votes
1answer
76 views

Strange behavior: random HTTP error 500 fixed by visiting Permalinks settings page (htaccess issue with language code)

I’ve got a pretty weird behavior on my site that I’d like to resolve. From time to time (no recognized pattern), my site shows a 500 error, on the front pages or on some admin pages. When this 500 ...
0
votes
2answers
31 views

How do I get the site url from a Block (within the block editor)

I have a block in which I'd like to display a link based on the site url. So for example, when the user enters "Futuristic", the link will display as https://my-site.com/futuristic/ I've ...
0
votes
0answers
12 views

WooCommerce Customer Rest API

I am trying to create a mobile app for a WooCommerce site, I can see that there is a REST API, however, it would seem this is for use for the admin side of things. Such as an admin app to monitor and ...
0
votes
1answer
30 views

WP_REST_Response() doesn't seem to return the expected object

Building on this answer, the WP_REST_Response() object returned by the callback function of my custom route is not the object I'm asking it to return. My object has a "status" of 304 and a &...
1
vote
1answer
31 views

How to create a post using REST API with sending data as a JSON body?

I am able to create posts on my WordPress website using it's REST API with the below curl request format. Website uses basic auth plugin for the authentication process. curl --user "username:...
0
votes
1answer
12 views

Fill up advanced custom field of a custom post type via API REST POST

I have few custom fields created by ACF on a custom post type "room". I use postman and the REST API to try to create a new room with my custom fields. The Autorization is ok. I success to ...
1
vote
0answers
16 views

How to upload Woocommerce product images via API? [closed]

I am using Python lib to automate product uploading. I am looking at Woocommerce Rest API documentation and I could not find a way to upload products while creating one. All it assumes that product ...
0
votes
0answers
21 views

Exporting Post Content Including post_content_filtered Field

How can we include the post_content_filtered field with our exported post content in WordPress? We have an older WordPress site (setup behind a firewall circa 2016/2017, version 4.7.19). This site ...
5
votes
1answer
93 views

Are there server performance benefits to fetching only specific fields when querying the REST API?

I understand that having less data being downloaded improves the experience to the end user, but my question is related to the actual server performance, would the response be faster? I am fetching ...
0
votes
0answers
13 views

Blacklisting jwt after logout in wordpress

I need to blacklist jwt after logout. Does anyone implemented it in in wordpress and could share his approach? What I’ve thought of is storing blacklisted user jwt in user meta (value and expiration ...
0
votes
1answer
29 views

wp_nonce vs jwt

I’ve recently added jwt authentication to my website because frontend of my site is completely decoupled from backend. What I haven’t thought of is that I could use wp_nonce instead of jwt - create ...
0
votes
1answer
39 views

Wordpress REST API V2: how to get list of all posts?

I need to get a list of all posts in a certain category. The number of posts is more than 100. I do not need the post's content. I need only id and slug. https://example.com/wp-json/wp/v2/posts/ ...
0
votes
0answers
4 views

How to get featured image field value from REST API?

THe field, fimg isn't really available in the REST API. I am seeing the media id in the REST API, but that doesn't really help. Would like to avoid using any plugin to achieve this. Any help?
0
votes
1answer
22 views

Custom WP API endpoint NULL body data

I have a weird issue, that bashes my head in. It's probably something minor that I am overlooking, but for the life of me I cannot figure it out. Here's the premise: I am making a POST request to a ...
0
votes
0answers
9 views

How to use webhooks to change, remove and add Navigation Menu Items

I sell flowers online in my Woocommerce shop. Because flowers are seasonal, Every month I need to manually change the Product Category items in the Navigation Menu likt this schedule: December 1st: ...
0
votes
1answer
13 views

Get Custom taxonomy parent with wordpress REST API

I have a custom taxonomy product_category , and it accepts parent / child relationship. The url: /wp-json/wp/v2/product_category shows me everything, Parent and Child. is it possible to add parameters ...
1
vote
0answers
16 views

Custom Post Type and Custom REST API Endpoint result in Gutenberg editor not working

I have a custom post type (article) and have implemented a custom REST API endpoint for that post type. I can retrieve single and multiple articles via the custom endpoint without any issues. However, ...
0
votes
0answers
32 views

WordPress 5.6 Application Passwords

I have reviewed this page but could not fully understand it. Does this feature in 5.6 provide us with an interface? The page displayed above did not appear in my admin panel. Also I write url ...
0
votes
1answer
15 views

Force REST API Authentication for each request method

WordPress end points default rules, GET ----> PUBLIC POST, PUT, DELETE ----> AUTH How can I force authentication the WordPress REST API GET method requests?
0
votes
1answer
45 views

Headers already sent error with get_template_part in REST API call

Crosspost from StackOverflow I've looked at multiple other questions about this warning (Headers already sent...etc) and this thorough explanation, but I'm not finding a solution for the circumstances ...
1
vote
0answers
23 views

Setting maintenance mode via REST API

Is there a way to set a WP site to maintenance mode via REST API?
1
vote
1answer
28 views

Is it posible to use wp.data.select('core') outside a block?

I have an options page I have created for a post type which doesn't use a Guttenberg block, but I was wondering if inside that page I could somehow make use @wordpress/data in order to retrieve posts ...
0
votes
0answers
20 views

Wordpress Rest Api rest_cannot_edit

Hello I want to edit the post by rest api. i login succesfully with admin access but still i get when logging in i get response {'success': True, 'redirectTo': 'https://cannedsplam.com/wp-admin/'} ...
0
votes
0answers
8 views

Create a Middleware that intercepts and modifies incoming api requests

I'm trying to create a firebase rest api social login plugin, but do not want the headache of managing multiple tokens (social and Wordpress) one, so I thought that I can intercept incoming requests ...
0
votes
1answer
35 views

Sidebar endpoint using WordPress API

I cannot find any info on this. Is there a default endpoint for sidebars? For example pages: http://localhost:8888/digifacelive/wp-json/wp/v2/pages I have looked at the WordPress API documentation ...
0
votes
0answers
35 views

Using backbone Javascript Client for menus

So I'm using the Backbone Javascript Client (https://developer.wordpress.org/rest-api/using-the-rest-api/backbone-javascript-client/) provided by WordPress and I am wanting to extend or pull in menus. ...
0
votes
1answer
14 views

How can I spin up a new website for a registered user automatically?

We have created a bunch of custom plugins at our agency, and the whole packaged website is like a 'product' at hand. Is there a way to scale this in a way that we can give out a free trial, where when ...
0
votes
1answer
19 views

register_meta not showing custom post type metabox data in rest api

I have added a custom post type and I want to expose the custom field value in the rest api. As per the docs register_meta can be used. I have created a custom post meta box using the wordpress way. ...
1
vote
1answer
40 views

Create a new post using rest api and save featured image using an external image url

I am trying to create a post using the rest API. Which I am able to do with a fetch request as below. OurPostData contains the title, content and URL of a featured image which is an external url ...
0
votes
1answer
25 views

How to make a fetch() POST request to wordpress rest api?

I am trying to make a POST request to rest api. But I am getting 401 Unauthorised error. Also can someone help with handling nonce in it? #OurPostData : Contains the title. fetch('https://mywebsite....
1
vote
0answers
48 views

No 'Access-Control-Allow-Origin' header is present [closed]

I keep getting this error message when I am sending a fetch request from the admin side. I want to connect to that API and get some response. Access to fetch at 'https://34557322456.execute-api.ap-...
0
votes
0answers
12 views

Update Block Attributes from Rest Api

I have created a REST API, which takes the parameter 'id' and returns the same value. Now what I want is to send this value to dynamic blocks that I've created. What I want to achieve is that if a ...

1
2 3 4 5
23