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

WooCommerce REST API AJAX Auth - 401 response

I need to implement vuejs to load the categories of my store. I've read that the woocoomerce rest api need authenticate requets to work, so I'm trying to get the categories using oauth on localhost ...
0
votes
0answers
13 views

Custom REST API POST Endpoint Not Working, 404 Error

I'm writing a plugin, and I'm having some trouble with the custom endpoint that takes in data from the front-end of the app (Angular), and will pass it another function to filter some data. I have the ...
0
votes
2answers
25 views

Looping through and combining calls to Woocommerce REST API

I have to make calls to multiple pages of a Woocommerce product database (getting all products in one go seems to not be an option), and the looping and collection of the results isn't working as I ...
0
votes
0answers
12 views

Getting all woocommerce products from REST API call in plugin

I am developing a plugin that extends Woocommerce and acts as a custom product filter. The part I'm having trouble with is that it's not tied to one specific site, and has to fetch the products from ...
-2
votes
0answers
11 views

React front end with WP CMS - GraphQL or Rest API?

I am starting to work on a React site with WP CMS. I was wondering if the GraphQL API will be easier to use than REST. Thank you
0
votes
1answer
47 views

[Vue warn]: Error in render: "TypeError: Cannot read property 'wp:featuredmedia' of undefined - REST API

I'm using this code to learn vuejs and to make a portfolio infinite scroll using the WordPress REST API. I'm able to render the first ten post but on scroll vue will stop working and give me this ...
1
vote
0answers
12 views

WP API querying a custom post type and a custom field

I'm developing a site that displays results from a local running race from the past 15 years or so. I have a custom post type called result with several custom fields. Each result looks like: ...
0
votes
0answers
16 views

WordPress API - sign-up to multiple Multisites from one single form

Creating a sign-up form network multisite registration where the user can register to three different Multisites at the same time (and automatically new sub-sites are generated In three different ...
0
votes
1answer
19 views

How to send the body in wp_remote_post as “raw”?

I'm not sure if I'm asking the right question, so here is the context. I'm making a POST to an API (The api is to a Google Sheets Script - so there are some unusual limitations). When I use postman ...
0
votes
0answers
29 views

WP REST API roles field parameter not working, works on Postman

NOTE: Thought it was just localhost, also getting same behavior on a live site Problem: Querying even when logged in as an administrator always returns this: The query: http://localhost/site/wp-...
0
votes
1answer
36 views

Backbone with custom rest endpoints

I have created a custom endpoint that returns select user meta data. I am trying to access this endpoint with Backbone. It works as expected in Postman and from my Backbone/javascript script If I have ...
0
votes
0answers
20 views

is it possible to fetch data from a remote api while admin is writing a new post?

Editor picture: I wonder if it is possible to fetch data from a remote api while user is typing a new post inside the editor. That data should be shown anywhere in the screen (I mean, inside the ...
1
vote
1answer
15 views

How do you format the set_body option for WP_Rest_Request?

I am looking to pull data from a Google Spreadsheet using SpreadAPI. This is my current code. $request = new WP_REST_Request('POST', 'https://script.google.com/macros/s/UNIQUE_CODE/exec'); $...
1
vote
0answers
13 views

`rest_user_query` can't access post author in post edit screen

I'm trying to modify the user dropdown in the post edit screen to show only (a) the current user and (b) the current author of the post. I can't do this using wp_dropdown_users_args because the meta ...
1
vote
0answers
27 views

Accessing user Meta data via REST and backbone

I'm writing a plugin to allow users to update information stored in wp_usermeta. I'm trying to use the Backbone JavaScript client with REST. I have the HTML code. <div id="container">Loading......
0
votes
0answers
13 views

Add new post with API from another server

I have a wordpress site on a domain and a script for archiving documents on another server. When this process is finished I need that script to create a new post with some info on the wordpress site. ...
1
vote
1answer
51 views

Case insensitive header params for API request

I am making API requests with token based Auth mechanism. Here is example request. TokenRequest({ method: 'POST', url: {URL HERE}, headers: {'Authorization': Bearer {token}}, ...
-2
votes
0answers
79 views

Plugin is causing issue with wordpress API & Loopback. cURL error 28

I have a plugin that's having an issue, and the developer is not responsing, (which is a bigger issue) . the problem is that it seems to be disrupting the REST API, I'm getting this error, in site-...
0
votes
0answers
18 views

Is there any way to get a variable for $current_user password to send a post request to endpoint?

I've tried the code below but wordpress only send the hash password, so the endpoint response is 404 (not found). function identify_user() { $url = 'http://spring-app-build:8080/api/auth/login'; if (...
0
votes
0answers
16 views

WordPress site that will integrate with external APIs

I would like to create an WordPress site that will integrate with external APIs and will take data by API from all the affiliates networks like https://www.offervault.com/ . Anyone can assist me and ...
0
votes
0answers
35 views

How to access a table in a wordpress database using REST API?

I have a wordpress database. There are some tables in it. I want to access the table contents of the table wp_fa_user_logins using REST API to know when a user logged in. I know I can SSH into the ...
0
votes
0answers
38 views

AJAX request from Chrome Extension to Wordpress Website

I developed a chrome extension which extract some data from the user visiting page and I want to transmit them to my database by an AJAX call (my website is a basic wordpress website). The point is ...
0
votes
1answer
34 views

Ajax call to my Wordpress website from an external application [duplicate]

I have on website on wordpress and a external web app. I try to make an AJAX call from this external web app to get some info from my wordpress site/ database but i got an error message 400. Here is ...
1
vote
0answers
21 views

CORS & Remote access to WP via RestAPI

I have built an app which enables the manager of many WP sites to make RestAPI GET, POST, PUT & DELETE requests which work perfectly when using them from this Apps, when the WP site are hosted on ...
0
votes
0answers
11 views

Rest API: sending an image linked to a remotely posted ..post

I am building an app which will enable the user to manage / send posts to the WP sites he will be managing, remotely, this from the same Web app, without accessing any of the WP sites themselves , ...
0
votes
1answer
19 views

Adding Amchart Interface to Wordpress API

I'm using the amchart wordpress plugin and want to add support for it via the wp rest API. Here's what I've done so far: in ../includes/setup.php (To $args array I've added: This will create the /...
1
vote
0answers
13 views

How to add a custom REST field to limit data when fetching?

Images don't show by default in REST API so I have added a featured image url manually and this works ok https://i.imgur.com/l5R7XKl.png add_action('rest_api_init', 'register_rest_images' ); function ...
0
votes
0answers
10 views

Connect XML-RPC, REST or other endpoint to some BI tool or dump raw blog data

I am trying feed data generated by my Wordpress.org blog network into: Microsoft Power BI Desktop or other business intelligence or reporting tool or to at least be able to actually see some data ...
0
votes
1answer
40 views

Accessing private posts through REST API, same code that works in remote doesn't in local

I am capable of fetching private posts through the wp rest api by calling mydomain/wp-json/wp/v2/posts?status=private&slug=whatever I am authenticating well and receiving a valid token, no ...
0
votes
0answers
34 views

add tags to wordpress post using REST API

I'm new to WordPress programming and I'm trying to connect to WordPress REST API and send a new post with content and many tags. I can connect to API and send a new post but I can't add tags to those ...
1
vote
1answer
62 views

Custom search with Custom Fields in WP REST API?

Good morning! Is there any way to do searches with the WordPress REST API with custom fields, being more specific, I have some custom posts, with a custom field of a specific date, and I want to do a ...
0
votes
1answer
17 views

Wordpress output data to another website and pull data

Would you like to ask, is it possible to send data from the WordPress website to another website, and get the data back from another website? I would like to make a function with text insert and a ...
0
votes
0answers
12 views

Get custom data from the user REST API endpoint

If I request a user from the user REST API endpoint described here : https://developer.wordpress.org/rest-api/reference/users/#retrieve-a-user I don't see any of the custom data, is there a way to ...
0
votes
1answer
16 views

How to integrate together a website currently hosted Wordpress.com and a custom web application currently hosted on Azure?

Background: I am a C# developer and have developed a web site/application that can be hosted on Azure (or any Linux server). Another person has created a Wordpress blog and he is managing it through ...
0
votes
1answer
29 views

Expose a custom field of a custom post type to the REST API

I added a custom field to posts and exposed it to the REST API, which works for standard posts and appears in the APIs response. But does not work for a custom post type (projects) which is basically ...
1
vote
1answer
37 views

Rest API in integration tests - filtering by slug not working?

I have a bunch of custom fields in my REST API response, and I need to refactor the code for it, so I'm creating an integration test for it, just to make sure nothing breaks in the process of ...
0
votes
1answer
20 views

Custom API plugin to execute 3rd party API to retrieve data

I am new to WordPress here. I have this request where I need to create a custom REST API plugin where when user triggers the following URL link: www.example.com/wp-json/v1/getCoupon/123456?CouponID=...
0
votes
0answers
18 views

How the wordpress login and signup in react native app

Can anyone help me to login and sign up in reactnative app i have a Wordpress website and i want to link my wordpress site to reactnative app. search lots of solution but no one help me. i am using ...
1
vote
0answers
26 views

Custom endpoint to get all custom taxonomy terms

I'm trying to build a custom endpoint to get all terms from custom taxonomy the taxonomy name is cats I'm using this code function wl_cats() { $args = [ 'numberposts' => ...
0
votes
1answer
14 views

Consult array data in REST API Filter

Is it possible to make a filter with REST API Filter or any other technology to discover all elements that have job_listing_category = 86? Since job_listing_category is an array. Actual state: https:/...
0
votes
0answers
32 views

Hide response returned from WordPress REST API call

I have created this simple WordPress REST API where users can perform:   Option A • Types in the following URL in browser:       → www.example.com/wp-...
0
votes
0answers
12 views

Login with Facebook via API

I am making an Android app that uses the WP V2 REST API. The main site allows for login with facebook to leave comments. I would like to extend this same ability to my Android App. Is it possible to ...
3
votes
0answers
63 views

How to authenticate custom API endpoint in WooCommerce

I have created custom API, which is working fine, but I am not able to authenticate it, it returns result without checking for keys I have created consumer key and secret key from admin. How to ...
1
vote
0answers
30 views

Hiding API routes list

When you go to /wp-json or /wp-json/[namespace] on an API-enabled WordPress site, it shows all of the API routes and endpoints. How can I disable this behaviour without disabling the REST API?
0
votes
0answers
11 views

Single Post Pagination via REST API when post is split into multiple pages

Within a post you can use the <!--nextpage--> tag to split a single post into multiple pages. With the Rest API, you can get an entire single post by doing: http://example.com/wp-json/wp/v2/...
0
votes
0answers
23 views

Remote publishing using WP's RetAPI // Issues with HTACCESS

I am accessing a WP site with the WP API BasicAuth plugin installed & activated, and for very basic WP installs the following lines, added to the .HTACCESS files allows perfect GET / POST / PUT ...
0
votes
0answers
49 views

get Woocommerce product format json for WP_Query

I'm building custom endpoint REST API and I need the same format wooCommerce gave for its post type ( product ), using the WP_Query() class. I tried the wc_Product_Query and for some reason not ...
1
vote
0answers
46 views

Get subscribers via REST API and send post notification

I use this code below to send email after post send to draft. But after this I need also send emails for subscribers. I have tried to use newsletter plugin to get subscribers via REST API. But is ...
0
votes
0answers
37 views

REST API Perfect Woocommerce Brand - Get Brand by id or name

Does Perfect woocommerce brand plugin provide APIs for getting brand by id or name? Current API doc only provides apis for retrieve all brands, delete brand and insert brand but does not provide ...
0
votes
0answers
19 views

Creating Posts using WP-API/Basic-Auth

I am building an App to remotely publish posts into any WP sites. I have installed the WP-API/Basic-Auth plugin in the target WP site I have tested the below script from my local test sandbox to a ...

1 2 3 4 5 17