Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

WP API backbone client 403 error

$
0
0

Replies: 0

Using the WP API backbone client in admin and I keep running into an error that I can track down. On initial load of a post I run this simple code

export const posts = ( postID ) => {
  const post = new wp.api.models.Post(
    {
      id: postID
    }
  );
  return post.fetch().done(function (res) {
    return res;
  });
};

which seems to fetch the schema from /wp/v2/

I can hit that route just fine and get back the proper API response, but for some reason, the client where I am attempting to load my post obj, I get back a 403 with json response of {"code":"rest_cookie_invalid_nonce","message":"Cookie nonce is invalid","data":{"status":403}}

Any ideas on how to fix?


Viewing all articles
Browse latest Browse all 59525

Trending Articles