Can't connect to my WordPress hosted blog with the REST API – 404 not found error
-
So, I am trying to use Node to connect to my WordPress site to get my posts, like this:
var WP = require( ‘wordpress-rest-api’ );
var wp = new WP({
endpoint: ‘https://dellingsen.wordpress.com/wp-json/wp/v2/posts’,
username: ‘dellingsen’,
password: ‘xxxxxxxx’
});wp.posts().get(function( err, data ) {
if ( err ) {
console.log(‘Error!’);
console.log(err);
}
console.log(‘GET Posts: ‘);
console.log(data);
});This is the error I am getting:
{ Error: cannot GET /wp-json/wp/v2/posts/wp/v2/posts (404)What am I missing? Some things I read talked about Permalinks, but I don’t even see Permalinks anywhere on my WordPress site in the Settings.
The blog I need help with is: (visible only to logged in users)
- The topic ‘Can't connect to my WordPress hosted blog with the REST API – 404 not found error’ is closed to new replies.