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
15 views

Adding Custom Endpoint in WordPress Rest API

I have been working on custom WordPress rest API Endpoint. Goal is to create a WordPress custom route in this route i want to get Category Id and convert it to Category Name. I have written the ...
0
votes
0answers
16 views

WordPress Rest API - Draft, then Publish

and thanks in advance for the help, I've been using the WordPress REST API, in combination with an automated tweeting tool, to post onto my site and have the post automatically shared to Twitter. The ...
0
votes
1answer
28 views

How to use _embed when using _fields?

It seems that if you use _fields in an API request also containing _embed, the _fields filter will filter out all embeds. The following request: domain.com/wp-json/wp/v2/posts?_fields=link,title&...
0
votes
2answers
899 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
0answers
13 views

404 Rest Route not found - when serving behind “proxy”

To avoid CORS and speed up my static site, I have made a "proxy" from my static site. Basically, I can make a request to: staticsite.com/wp-json/some-endpoint and it fetch and return the response ...
2
votes
1answer
4k views

How to generate HMAC-SHA1 signature to use with WP REST API and OAuth1

I'm trying to publish a post using WP REST API. I was able to authenticate using OAuth1 using the PAW http client. I was able to publish a post to the site as well (again using PAW). PAW generated ...
0
votes
0answers
8 views

Get Request: cURL error 7: couldn't connect to host

I am trying to make a GET request to a url from my wordpress installation to get the access token but I receive this error: WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [...
0
votes
1answer
16 views

Filter post_content before loading in Gutenberg editor

I'm trying to manipulate the editor content(blocks) before it's shown in the editor. So ideally I would perform a search and replace and the editor will have a modified version of blocks, but will not ...
9
votes
5answers
19k views

How to get custom post meta using REST API

I am trying to create a REST APIs for my wordpress website which is used for facility listing using wordpress job manager plugin. I have registered my custom post , taxonomies in \plugins\rest-api\...
0
votes
0answers
11 views

How to create ACF repeater from REST API? [closed]

I want to create repeater childrens fields from REST api and JSON? How is that possible? My goal is to "tell" acf repeater fields to create my n number of repeater subfields. Secound, bonus question:...
0
votes
1answer
12 views

exclude particular category in api

How do I exclude a particular category in the API? For all categories - I may use the following: https://www.example.com/?rest_route=/wp/v2/posts&per_page=100 What if I need across all the ...
0
votes
0answers
16 views

Retrieving X-WP-Total header using cURL

I am accessing a WP site from an outside app and using the restAPI routes / endpoints to work with posts, pages, comments, users, etc... I am wondering how I can change / use the below cURL to ...
0
votes
1answer
647 views

Single page applications with Wordpress: routes and templates

(Read carefully, this is a question about Wordpress and not about AngularJS) I'm trying to make a single page application with AngularJS and the Wordpress rest API. Many things that are usual when ...
0
votes
1answer
47 views

How to add taxonomy to a post using WP REST API?

I'm using REST API, but I have a taxonomy called Ingredients to my Product custom post type. I can create a Product posting to the endpoing /wp-json/wp/v2/produtos, but how can I attach a custom ...
0
votes
1answer
20 views

WordPress Rest API with rest_do_request, possible race condition?

I am attempting to retrieve a response within my custom plugin, as based on the REST routes provided by another plugin. When running the following block of code in the root scope of my theme's ...
0
votes
0answers
10 views

Woocommerce API: Get product custom meta_data

I am trying to create products from a woocommerce website to another via the API (v2) and I want to send custom meta_data so I added these lines in the request: (the point is to create the product in ...
0
votes
1answer
13 views

Got Blank issue for get data from /wp-json/v2/post

before I was enabled to get data from my website using Wordpress API V2. I access https://sitename.com/wp-json/wp/v2/posts it will return the post with default number per game is 10. then after we add ...
4
votes
1answer
997 views

WP REST API returns blank response if post is too long

I'm working on an iOS app that requires the use of WP Rest API to fetch posts. Everything is working smoothly and I fetch posts by ID using this endpoint: https://example.com/wp-json/wp/v2/posts/...
0
votes
0answers
12 views

Weird problem occurs while using Wordpress REST API to create new post

This is what happens. I have WPBakery editor on my wordpress site. When I go to 'Edit Post' and paste custom HTML code (adjusted to WPBakery tags) and publish that post everything looks correct. But, ...
1
vote
0answers
19 views

Organize media library into folders and get folders via WP Rest API?

I'm building a Vue/NuxtJS portfolio site that will hopefully use WordPress as a headless CMS. I've been searching for hours but can't seem to come to a definitive solution. I know it's possible to ...
0
votes
0answers
539 views

REST API and Loopback error

I've been working on a site for a client for a few months now and recently I noticed that the Health Check functionallity added on the newest versions of WordPress is reporting two errors about the ...
0
votes
0answers
25 views

When are the user meta fields created in the database? Admin vs Woo API REST

I'm trying to save the initial value (saved_fname) of a new user created, when the registration is done from the admin panel it works but when I do it from REST API (Integromat) the user registers but ...
0
votes
2answers
23 views

wordpress api using rest_route for other pages

Ok, so I am using WordPress rest API to fetch the data using front-end. I am having the plain permalinks and unfortunately, I am not allowed to change the permalinks. So, for https://www.example....
0
votes
1answer
25 views

post values to custom post type which has advanced custom fields

I am trying to use Ajax and jQuery to post data to a custom post type. The title field works as is standard wordpress field but the color field does not. I also tried replacing 'color' with the name ...
0
votes
0answers
7 views

How to update ACF options page field with AJAX?

I have a path from ACF REST API, I want to update that value from the front, with AJAX. How I can how to do that, but the important thing is anyone can access it, so I have to put it away 401 code. ...
2
votes
2answers
78 views

Disable REST API for a user ROLE

I'm looking for a way to disable Rest API for a user role called 'external_user' (disable wp-json queries.) This user role can see right now alot of posts and pages information with when we put wp-...
-1
votes
0answers
14 views

Tablepress: dynamic cell content via Code Snippets

my goal is to display dynamic content from an api to certain cells in different tablepress tables in Wordpress. I am new to PHP but experienced with Javascript, so I also am open to suggestions ...
4
votes
2answers
10k views

Get Image URL instead of Attachment Id in Rest API

I want to show recent posts in my Android application and I'm suing this end point to get the list of posts https://www.geekdashboard.com/wp-json/wp/v2/posts How can I get the complete URL of ...
1
vote
1answer
189 views

How to add WP API and JS featured image attachment

I would like to fetch the image from the wordpress rest api - I have the following code: HTML: <div class="post-item"> <div id="posts">Loading posts... </div> Ajax script: <...
0
votes
1answer
19 views

Creating a WordPress Post via REST API - HTML or Markdown?

When creating a post using the WordPress REST API, should the post body content include HTML or should the post body content be written in Markdown language? Or can it be either? I'm looking to ...
0
votes
1answer
27 views

Need wp rest api for featured video post

hi i very new to rest api...I'm using WP REST API V2 in my project. After sending Get request to get posts, I don't see fields with the source of my audio/video wordpress posts (youtube or soundcloud ...
0
votes
1answer
23 views

Cant register rest routs from class instance

I am writing a plugin in OOP PHP for word press I have a problem with rest routes not registering... plugin class: require_once plugin_dir_path( __FILE__ ) . 'inc/org-clients-repository.php'; ...
0
votes
1answer
591 views

Rest API encoding of double quotes

I have a standard rest API setup in WP. The results are displayed in an IOS App. Now the problem occurres, that single and double quotes and & are returned in the JSON as Unicode Decimal Code: eg. ...
0
votes
0answers
21 views

One WooCommerce Store to multi distributor sites

I have two Stores on WooCommerce, Store A and Store B. I want to fetch products and categories to store B from store A so that store B is a sub store of store A, I cannot use MultiSite because store ...
0
votes
0answers
12 views

Block access to all WordPress “data” outlets

I've got an issue. I want to know all WordPress "secret" urls (so I can block them) For examples: Https://example.com/feed That exposes the posts. Is there some address that displays all tags/...
-1
votes
1answer
15 views

Extend WordPress REST API with Scheme Pro Plugin

I am creating a Vue app powered with WP REST API. Situation is that I have a website that has content and I added schema pro plugin for SEO enhancement. Now since I am using WP REST API, my question ...
3
votes
1answer
1k views

Android authentication

I'm using WordPress REST API (Version 2), and I want to authenticate Android native app with my self-hosted WordPress site. How can I perform that using username and password ?
0
votes
1answer
30 views

WordPress and React how to integrate?

I am new to this. I am good at WordPress things but just wondering the possibilities with react integration. These are my doubts If I develop a react app is it only possible to connect them via REST ...
0
votes
0answers
16 views

Woocommerce Rest API: woocommerce_product_invalid_image_id

Woocommerce version: 4.1.0 I am trying to create a product with categories and images via the API but I get this error : {"code":"woocommerce_product_invalid_image_id","message":"#0 is an invalid ...
0
votes
0answers
13 views

REST API Custom Namespace - unable to add/edit post

I have setup a controller class for my custom post type which extends the WP_REST_Posts_Controller class as I need some additional validation around whether or not the post can be viewed. A custom ...
0
votes
1answer
1k views

How to display parent category with first level child in REST API

I want help on WP REST API I want to display Categories with a first level child with some attributes. Here how it should look like: { Parent "id": 3, "name": "Football", "slug": "football" ...
1
vote
1answer
651 views

WordPress Rest API Create Post

Is it possible to login to my different WP website from another WP website (they have different domain and host) ? Actually, I am trying to create a post on one of my site from my another site using ...
0
votes
0answers
7 views

Woocommerce duplicate images on images rearrange via api

When images in product gallery are rearranged via the API in Woocommerce then duplicate images are created with the new order. The old ones are left there unattached and the Media folder gets bigger ...
18
votes
6answers
7k views

Does something like is_rest() exist

I am starting a bit with the REST API. If I am not completly mislead, the init action hook is also executed when its a REST API request. Now, I want to execute some code only, when it is not a REST ...
0
votes
1answer
201 views

Tax are not showing on order while placing order with REST API

I'm trying to placing order with REST API which will use for android app. I've used wc_create_order() for placing order but I didn't getting tax values as I got in web view. What I want - I need to ...
0
votes
0answers
17 views

Social login authentication via wordpress rest api

I am building a Vue app powered by Wordpress Rest API. After stumbling upon many options for authentication, I chose JWT authentication. However, i still haven't been able to find the solution for ...
0
votes
0answers
10 views

No 'Access-Control-Allow-Origin' when call rest API

I am using ReactJs with WordPress. WordPress running on localhost 8888 port and React app running on 3000 port. When I change the WordPress site URL (from settings->general) to localhost:300 then I am ...
0
votes
0answers
16 views

Extend Plugin that creates an endpoint for GET request to also accepts POST requests

I use a plugin called GiveWP for creating donation forms. The endpoint to see all the forms and data is /give-api/v1/forms/ The plugin has only built an endpoint to GET the data of created forms ...
15
votes
5answers
21k views

Hiding WordPress REST API v2 endpoints from public viewing

I would like to start using the WordPress REST API v2 to query information from my site. I've noticed that when I visit an endpoint URL directly, I can see all of the data publicly. I've also seen ...
1
vote
1answer
46 views

How to handle Woocommerce API credentials

I'm currently working on an Angular app with a headless Wordpress as a backend. I'm trying to figure out a way to integrate E-Commerce into that and WooCommerce seams the be the way to go. I'm working ...

1
2 3 4 5
18