Posting to WordPress API using oAuth1.0 authentication

So, I spent days getting the oAuth authentication token and I am finally able to create posts using Postman.

Now I’m trying to implement the authentication on my site and am getting a 401 error. My request header looks like this:"POST", "/wp-json/wp/v2/recipes");
                                'OAuth oauth_consumer_key="2ZbpQzTR3B5b",oauth_token="Luz5LnEzpt5axVBf4GDT5fE8",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1491374534",oauth_nonce="qHW1BG",oauth_version="1.0",oauth_signature="VNv4lP6ogZ3778wLrdQpGzloE9U%3D"');
                            createRecipe.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  createRecipe.onreadystatechange = function() {
    if (createRecipe.readyState == 4) {
      if (createRecipe.status == 201) {
        console.log('Created Recipe!');

      } else {
        alert("Error - try again.");

Here it is, working in Postman:

What am I missing here??

Read more here: Posting to WordPress API using oAuth1.0 authentication

Leave a Reply

Your email address will not be published. Required fields are marked *