Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [plugin-json-api]

The tag has no usage guidance, but it has a tag wiki.

-1
votes
1answer
62 views

external api call dont know what i´m doing wrong

Hi I'm trying to make a Call to the API I'm pretty new to PHP so if there is an obvious mistake enlighten me. <form method="POST" action=""> <div class="...
0
votes
1answer
58 views

Override plugin function to show invoices even if not logged in

I am using WooCommerce Print Invoice plugin to print invoices. Now I am working on a Cordova app for my website and I need to be able to see invoices from wordpress. Plugin has a function to hide or ...
0
votes
0answers
75 views

Extending the API I created to return category names

I created this api using a plugin called WP REST API Controller. But it didn't return custom taxonomy categories so I installed a plugin called WP REST API – Pure Taxonomies, it's returning category ...
2
votes
1answer
122 views

How do I perform a “get” call to an external API, and then display the JSON results on a page in my WordPress site?

A client has an external API that is storing all member info. My tasks are: a.) Create a 'Member Profile Search' page on his site, where users can search for members using certain keywords. b.) ...
4
votes
2answers
1k views

WP REST API only returning partial list of users

Started working with the WP REST API for the first time. Our ultimate goal is to dynamically load UI elements based on which user is presently logged in. However, my attempts to pull a list of all ...
-1
votes
0answers
196 views

Understanding JSON API search

I want to use the JSON API in woocommerce to search vehicle wheels, i have a API that returns all vehicle data in JSON when you input a number plate. I select some data out of the returned JSON ...
0
votes
2answers
408 views

Using the JSON API via HTTPS and HTTP

We have developed a mobile application using the JSON API plugin. The current website is running on HTTP, we are planning to change the website to HTTPS. Currently, mobile users on the live app are ...
0
votes
1answer
203 views

.htaccess and proxy settings for routing a decoupled REST API consuming theme

Developing a decoupled front-end consuming the REST API... I'm using create-react-app so can enter a proxy field corresponding to WP in my package.json and write my calls like fetch('/wp-json/v2/...
1
vote
1answer
186 views

ping_status in JSON REST API

What is ping_status in JSON schema of wordpress REST API? And what is it's use cases?. The official documentation is not much explain about it - Posts|REST API Handbook.
2
votes
1answer
1k views

How to Securely and remotely Create new user in wordpress using Rest API

I am trying to create users in wordpress Version 4.9.1, remotely using the wordpress API. This is my PHP code below: $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_PORT => "8080", ...
2
votes
1answer
128 views

Add external js file to footer with id

I know how to add custom/external js but i dont know how to pass js id also. i am using it as: wp_register_script( 'validation', 'https://www.asd.in/script.php?id=3ff00a469474bbe71a9218a7f0377518', ...
1
vote
0answers
111 views

Ajax store response json in variables

The response of success ajax call is in the form of json like this one: {"prize_name":"Keys 4","prize_image":"http:\/\/localhost\/web-game-w\/wp-content\/uploads\/2017\/09\/4rare.jpg"} How I can ...
1
vote
1answer
472 views

How to alter WP-JSON main query or best practise for custom endpoints

I have a wordpress instance full of custom post types called "games". Each game can have a rating. The main query on the frontpage uses this query: public function my_modify_main_query( $query ) { ...
0
votes
1answer
104 views

Fetching API data using

I am trying to write a simple plugin that fetches some data from an API endpoint. I am planning to read the api key from a shortcode, but didn't get that far yet. I wrote the following piece of code. ...
1
vote
2answers
932 views

Create a new post from hybrid mobile App in WordPress using JSON API plugin

So i am developing a hybrid app using cordova and jquery mobile. I need to login to a wordpress blog site and create a new post in my hybrid app. I am using JSON Api plugin(https://wordpress.org/...
0
votes
1answer
148 views

Get the name of the post type

I'm consuming data from a wordpress site to my ionic app using the JSON api. I usually get the data from different post type with this url : www.mywordpress.com/api/get_posts/?post_type=artists The ...
2
votes
1answer
1k views

Wordpress JSON API returns normal site page in html. How do I get it to give me JSON?

For example, entering http://mywordpresswebsite.example.com/?json=1 into the browser loads the main site html, the same as omitting the json querystring variable: http://mywordpresswebsite.example.com/...
2
votes
3answers
965 views

Why use JSON API to display recent posts?

why not WP_query? http://www.htmlgoodies.com/beyond/javascript/provide-a-json-feed-from-your-wordpress-site-using-the-json-api-plugin.html, here if you look at the comment at the bottom the guy wants ...
0
votes
1answer
356 views

json API plugin not returning any post with get_category_posts

I am using the json api for the api calls in my WordPress site. When I tried http://example.com/api/get_category_posts&slug=catname Then the default post category news can not be obtained. And ...
0
votes
1answer
240 views

WP API users per page

I've been testing around the v2 of the Wordpress plugin WP REST API in a web app. My goal is to develop an Ionic app. I've found a problem, though. I've managed to list 100 posts of a custom post ...
1
vote
1answer
800 views

Update post using json api v2

I'm trying to update a post using the json api Version 2.0-beta13.1. It returns success but doesn't modify the post. I'm doing it from Python but I don't think there should be anything special about ...
19
votes
5answers
34k views

WP Rest API - How to get featured image

I'm very new to this API, in fact I've only spent couple hours on it so far. I've done my research but cannot find anything about it... The issue is, I can't seem to get the featured image of a post. ...
0
votes
3answers
9k views

WP REST API - Retrieve content from page

I already get posts from categories with: http://domain.com/wp-json/wp/v2/posts?filter[category_name]=category-name but how can i retrieve content from page? - [page_name]=page-name for example but ...
0
votes
1answer
1k views

wp json api - get posts by category

I have added a method to core controller of WP JSON API plugin that extracts the posts by category wise, however getting only one category data. Please find the code below. public function ...
1
vote
1answer
2k views

Why aren't tags and categories added in post request to WP Rest API

I'm using V2.0 and trying to create a post using the /posts endpoint. Here's the payload being sent with my request: var payload = { title : "some title", format : "link", tags: ["...
1
vote
1answer
1k views

JSON API plugin, Get posts by category return no post

Im trying to get the posts by category. using this URL: /api/core/get_category_posts/?slug=cat2 But responding this: {"status":"ok","count":0,"pages":0,"category":{"id":3,"slug":"cat2","title":"...
1
vote
1answer
3k views

how to get nonce using json api

I try to open this url in my browser or calling from my frontend application: http://78.47.177.214/blog/api/get_nonce/?controller=posts&method=create_post i keep getting the response {"...
3
votes
1answer
4k views

Retrieve all users from wordpress database via REST/JSON API

I've read that the WP REST API v2 retrieves only users that have made a post for the blog. I'm developing an iOS and Android app that needs to use the Wordpress registration. How I could retrieve a ...
0
votes
1answer
347 views

WP-API + JS Backbone client - how to update post meta

Using the WP API and Backbone-based JS client, I'm trying to update a post's metadata as follows: var parentId = 96; // the post id var metaData = new wp.api.collections.PostMeta('', {parent: ...
4
votes
1answer
799 views

WP set auth cookie using Ajax is not saved to browser

We are creating an external dashboard that uses Wordpress data, obviously, we use WP REST API v2 We want total separation from the traditional WP Dashboard, but we also want to log in user "behind ...
2
votes
0answers
1k views

Authenticated request to WP REST API V2 returning 403 error on /users/me [closed]

I am using WP REST API Version 2.0-beta7 together with WP OAuth Server version 3.1.91 After authenticating with the User Credentials grant type, a request to /wp-json/wp/v2/users?access_token=[...
12
votes
4answers
17k views

Get WP Navigation Menu from REST API V2

I'm trying to get the navigation menu from JSON response using WP REST API v2 plugin. There is no navigation menu plugin extension for the REST API v2, but only for V1. From codex WordPress Post ...
0
votes
1answer
1k views

PHP calling function within a class

I'm writing my own php class and I have multiple functions within the class. Something like this: class JSON_API_Hello_Controller { public function test_cat(){ global $json_api; ...
2
votes
1answer
784 views

Request object for validate_callback

I'm trying to define a new REST Api endpoint based on WP REST API (version 2) and have question relating to what arguments are available to the validate_callback and sanitize_callback. Is the Request ...
0
votes
0answers
45 views

Do you see any problems (mainly security-related) with how I've used wp_ajax_* actions?

I am writing a Wordpress plugin that will allow logged in users to manage a specific resources via WP admin interface. These resources should then be made available to an Android app, but only users ...
0
votes
1answer
2k views

WP REST API v2. filters doesn't work

I'm using WP REST API v2 to get posts. When I tried to open localhost/wp-json/wp/v2/posts in my browser I got json with all my posts. I tried to open localhost/wp-json/wp/v2/posts/?category_name=...
6
votes
0answers
850 views

Slow REST API calls on self-hosted WordPress [closed]

I'm using WordPress REST API to access some posts from an app we're creating, but the API calls are really slow! If I'm using the domain in the call like this: https://public-api.wordpress.com/rest/...
1
vote
1answer
1k views

WP REST API Access-Control-Allow-Origin response is cached

I have an AngularJS site that is pulling in posts from WordPress via the plugin "WP REST API (WP API)". I am testing a site on both dev and staging subdomains, and the WP API works on both. However, ...
0
votes
1answer
989 views

multi-language multi-site with REST API

I am creating a site with multiple sub-sites that should support multiple languages and be queryable with a REST API. The site itself is mostly a CMS with various pages and maybe some posts for ...
-1
votes
1answer
1k views

get content from json api to post

i am trying to get post from json api from a non wordpress site and i want to post the content to my wordpress site. currently trying with https://wordpress.org/plugins/json-api/ above plugin ...
12
votes
4answers
11k views

WP REST API fetch posts from post type

How can I get all the posts from a specific custom post type with WP REST API (either v1 or v2)? I'm very new to this and trying to understand how to do that. I am currently using WP REST API v2 and ...
1
vote
0answers
207 views

PHP > Scheduled Tasks > Sending daily email with dynamic API variables

I'm trying to write a PHP cron job that would call an API, return a set of numerical variables, calculate a second set of variables, and send an email to selected recipients with those variables ...
0
votes
1answer
352 views

Best way to retrieve data in custom api extended from wp-api

I have extended WP API plugin to provide an API which can process documents. Routes public function register_routes($routes) { $documents_routes = array( '/v1/documents' => array( ...
2
votes
1answer
3k views

Add custom parameters to JSON API search query?

I am using JSON API plugin to query wordpress from a mobile app. Currently I have a theme on my wordpress site which works as a directory returning "near me" results when a search is made. This is ...
1
vote
1answer
829 views

JSON API - search by custom taxonomy

I am trying to get the posts base on some parameters. My JSON API query is as follow. http://www.example.com/api/get_posts/?post_type=job_listing&page=10&count=5/ Here is my JSON result for ...
0
votes
1answer
77 views

wp_query - show pages that have parent defined

Can I achieve this with wp_query? I only want to get pages that have parent selected. I'm using JSON API plugin and need to make a http request - would this be possible with url wp query also? For ...
1
vote
0answers
69 views

Include related custom fields from one post type in another post type's JSON feed

I have a custom post type called Offers, and in this post type is a custom field called Store, which is a relationship field type to another custom post type Stores. This has been created using the ...
1
vote
1answer
359 views

Json api does not return all metadata

I am using this plugin https://wordpress.org/plugins/json-api/ to create a new entry is saved correctly in the database all the wp_postmeta customfield table, but when you run api/get_post/?post_type=...
4
votes
1answer
594 views

Updating Post Meta with Backbone and the REST API

I'm getting started with a project that is making use of Backbone and the WP REST API, but I"m having a little trouble. Using the built in API JS for models and collections allows me to pretty easily ...
0
votes
1answer
693 views

JSON API Plugin not showing Attachments id reused

First of all, I am talking about this plugin: https://wordpress.org/plugins/json-api/ So now regarding my problem: The plugin is working fine and without any problems. All attachments are showen for ...