We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm getting an error message when I'm attempting to update a post.
How do I know if login is successful?
I'm able to get a list of posts so the endpoint works.
I'm using the following:
var wp = new WPAPI({ endpoint: apiRoot, username: username, password: credential, auth: true }); var test = "posts"; // get posts if (test=="posts") { log('verify endpoint') wp.posts().then(function( response ) { log("response", response) }).catch(function(error) { log("error", error) }) return; } if (test=="update") { var postNumber = 28; var date = new Date() var time = date.getTime(); var update = wp.posts().auth().id( postNumber ).update({ title: "Time " + time }) .then(function(response){ console.log("complete"); console.log(response); }) .catch(function(err){ log("error:", err); }); }
I've installed and activated this plugin.
{ code: 'rest_cannot_edit', message: 'Sorry, you are not allowed to edit this post.', data: { status: 401 } }
Attempting to create a post returns this:
{ code: 'rest_cannot_create', message: 'Sorry, you are not allowed to create posts as this user.', data: { status: 401 } }
I'm using the download of wpapi.js (7/6/2017) here:
http://wp-api.org/node-wpapi/installation/
FYI I'm not on node. I'm in a client that runs ES6.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm getting an error message when I'm attempting to update a post.
How do I know if login is successful?
I'm able to get a list of posts so the endpoint works.
I'm using the following:
I've installed and activated this plugin.
Attempting to create a post returns this:
I'm using the download of wpapi.js (7/6/2017) here:
http://wp-api.org/node-wpapi/installation/
FYI I'm not on node. I'm in a client that runs ES6.
The text was updated successfully, but these errors were encountered: