Working Around rest_forbidden_context

I am trying to request page content, but the raw page content, calling this route:

/wp-json/wp/v2/pages/ + id + ?context=edit

In response to this I get:

code: rest_forbidden_context
data: {status: 401}
message: Sorry, you are not allowed to edit this post.

Makes sense, guessing I just can't get the edit content unathenticated. However, it is unclear to me how I can retrieve the raw content of a post/page from the API.

Potential Solutions I am struggling to find:

  1. Is there a way to auth through the api?
  2. Can I define my own endpoint to get around this?
  3. Can I turn off any authentication requirements (my wordpress sits headless behind a server anyways so I'm not worried about security)

Topic authentication api Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.