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?
Some additional details: My server version: 5.5.3 Accessing the API using the wordpress_json library for Python (which under the hoods uses requests' Basic Authentication headers)