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:
- Is there a way to auth through the api?
- Can I define my own endpoint to get around this?
- 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