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
586 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 ...
16
votes
6answers
5k 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 ...
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 ...
1
vote
2answers
120 views

Rest API Multisite Site List?

I have a multisite and I’m able to use the rest api for posts/tags/etc for specific sites but I was wondering if there’s a away to get a list of sites on the network using the rest api? something ...
0
votes
1answer
22 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 ...
0
votes
0answers
24 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
23 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 ...
1
vote
0answers
17 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 /...
0
votes
0answers
16 views

Autosuggest endpoint ElasticPress [closed]

The only other SO q&a that matches this question is out of date and no longer works. I thought autosuggest was a core, enabled feature of ElasticPress out-of-the-box. This does not appear to be ...
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
2answers
3k views

Ways to load admin-ajax faster without initializing all plugins?

I'm facing a problem with wp ajax performance. I'm initializing an ajax call from my javascript side but the response takes 3-5 secs to come back. I understand that admin ajax call has to load the ...
3
votes
0answers
60 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
10 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
9 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
32 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
30 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
votes
0answers
30 views

WordPress.com REST endpoint for /wp-json/wp/v2

The REST endpoint /wp-json/wp/v2 is available for self-hosted WP blogs. Where do I find this endpoint for blogs that run on WordPress.com? I tried https://public-api.wordpress.com/wp/v2/sites/example....
1
vote
1answer
42 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
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" ...
0
votes
1answer
2k views

Make Custom Fields Public in JSON - API

How do i make the custom fields public in rest API? I have added a custom field to the rest api. the challenge is - The metadata is returned when i am signed in my browser. if i try as public using ...
0
votes
1answer
438 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
1answer
16 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
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
0answers
11 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 ...
5
votes
2answers
3k views

WP-AJAX vs WP REST API: What to use for requests to the website from outside?

I have website on WP. Also I have account in one web service. I need to get a request from this web service to a certain address of my website. This is a webhook that I want to handle with my own ...
0
votes
1answer
16 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
28 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 ...
1
vote
1answer
462 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 ...
1
vote
2answers
2k views

WooCommerce: Can't use wc_get_products for custom REST API endpoints

I'm trying to create some custom REST API endpoints which get products with some special conditions, for example one endpoint for featured products. I tried to use the wc_get_products function like ...
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": "...
0
votes
1answer
1k views

Display Post Featured Image along with Categories via WP Rest API

I have a custom function that pulls in (3) posts from another Wordpress blog, and it's pulling them from specific categories I specify via a shortcode. Now, with that said, I cannot get it to ...
0
votes
1answer
17 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
16 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
24 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' => ...
1
vote
0answers
73 views

How to insert Comment metadata via REST API

I am trying to insert comment from my android app , i am using REST API and POST method /wp-json/wp/v2/comments/ The method is working great , but I would like to include metadata when inserting ...
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
31 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 ...
1
vote
0answers
29 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?
2
votes
1answer
3k views

Rest API Hook When Post Is Requested

I am aware that I can use the endpoint /wp-json/wp/v2/posts/{id} to fetch a post. I am building an implementation of WordPress that relies completely on the JSON API and its endpoints. It is an ...
1
vote
1answer
2k views

featured image not found in json from wp rest api

I found that the image must be in the element featured media but I found another link that leads to another link contains this message in French means ( Sorry, you do not have permission to do that.) ...
4
votes
1answer
1k views

Creating a post with the REST API, curl and oauth returning 401 error

I'm trying to create a WordPress post using the REST API, OAuth, and cURL. However, I'm running into some trouble. I'm able to create a blank post (no title, slug, etc) using the following code: $...
0
votes
1answer
21 views

Uploading picture 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
22 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
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
2answers
3k views

Get the Category Name instead of ID from WP-API

I'm trying to get the category name instead of the ID from the WP REST API for my Custom Post Type. Some articles about endpoint modification gave me some ideas on how to solve it, but unfortunately i'...
0
votes
0answers
21 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
36 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 ...