Setting ?context=edit results in rest_forbidden_context, even for an Administrator user

Question

I’m an Administrator role user. When I’m using the REST API, if I attempt to call

GET /wp-json/wp/v2/posts?context=edit

I get this error message:

401 Unauthorized : [rest_forbidden_context] Sorry, you are not allowed to edit posts in this post type.

Similar errors are generated for pages queries as well. If I query:

GET /wp-json/wp/v2/users?context=edit

I get a slightly different error message:

401 Unauthorized : [rest_forbidden_context] Sorry, you are not allowed to list users.

I can use the same API endpoints with ?context=view with no problem, but I’d like to be able to view the posts and page content without shortcode expansion, so it’s my understanding that I need to query against edit context.

Again, I have the administrator role on the server and can log into the dashboard and edit any post, so I don’t think it’s a user permission issue with my userid. Any ideas on what might be causing the error?

0
William McVey 3 months 0 Answers 9 views 0

Leave an answer