Articles of rest api

WordPress V2 REST-API: Endpoints 404?

I just installed and activated the latest version of the WP REST API plugin. However, when I attempt to access a REST endpoint, I end up with the Apache 404 page. $ curl -i ‘http://example.com/wp-json/wp/v2/posts/1’ HTTP/1.1 404 Not Found Date: Wed, 20 Jul 2016 01:23:25 GMT Server: Apache/2.4.18 (Unix) PHP/5.6.23 Content-Length: 219 Content-Type: text/html; charset=iso-8859-1 […]

WP Rest API v2 return posts with specific tag

I am trying to get posts from blog: http://christianconcepts.com/ which are tagged “appcontent”. I tried this querry: http://christianconcepts.com/wp-json/wp/v2/posts/?filter[tag]=appcontent but it I still get unfiltered results. For example, this post: http://christianconcepts.com/pdf-ebook-available/ doesn’t have “appcontent” tag but it is still returned. “REST API – Filter Fields” plugin is installed. Could someone help me?

wp-json/ return 404, but wp-json/wp/v2/ works fine on my nginx server

When I access my WordPress site as www.example.com/wp-json/ I got this 404 error. `{“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}` But the REST api return the correct json object if I use the url of www.example.com/wp-json/wp/v2/. My permalink is setup as /%year%/%monthnum%/%postname%/, and here is part of my nginx configuration settings: server […]

node-wpapi: how to handle authentication?

I’m referring to official node-wpapi javascript client library for official (4.7+) REST APIs. Here the doc: http://wp-api.org/node-wpapi/authentication/#cookie-authentication I’m reading the Cookie Authentication paragraph, but I’m not in this situation. I’m trying to build a Single Page App, so I need to register/login/logout the user using REST API. I don’t need to use node-wpapi, I could […]

Get more than 10 posts in a specific category with the wordpress api

I’m currently building an Ionic app that uses the WordPress api. I can retrieve posts in a specific category by using the following: // Retrieve filtered data for the categories to show posts. function getCategoryName(categoryName) { return ($http.get(svampeURL + ‘posts?categories=’ + categoryName).then(handleSuccess, handleError)); } The problem is that it only returns 10 as it is […]

Inserting custom post meta value using WP-REST API

I’m using this tutorial to insert a post via front-end using WP-REST API. I have added more fields to add custom post meta data to the post but while the post is being submitted via the front-end, the custom post meta are not being inserted. I’m not sure where I am going wrong. Form.php: <?php […]

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 ?

Will using REST API impact SEO?

I’m just learning the REST API and am considering using for a friends portfolio site of illustrations. I’m planning to build the frontend using Backbone templates populated at runtime via the API. Bootstrap for the responsive layout. My concern is that SEO will be less effective than just using a wordpress theme with Yoast SEO […]

Wp Rest Api Custom Endpoint for page subpages

I’m tring to add a custom endpoint for a page subpages. Parent Page ID = 151 function list_subpages( $data ) { $subpages = get_pages( array( ‘child_of’ => $data[‘151’], ) ); if ( empty( $subpages ) ) { return null; } return $subpages; } add_action(‘rest_api_init’, function () { $version = ‘2’; $namespace = ‘wp/v’ . $version; […]

WP REST API returns incorrect data?

I’m trying to get a page from the API based on its page template however it seems to be returning incorrect data? so I’m unsure whether I am using the API correctly. http://domain.dev/wp-json/wp/v2/pages?template=page-contact.php Returns pages using different page templates? Also if I was to query by page id, it brings back pages which are not […]