Getting 401 unauthenticated error in WP Rest API revisions
I'm trying to fetch preview data through WP Rest API using a url such as /wp-json/wp/v2/pages/1140/revisions/1653
.
An extra header is also included: 'X-WP-Nonce': nonce
- nonce comes from WP.
Why am I getting 401 unauth error? Thanks
{ code: 'rest_cannot_read',
2020-07-21T11:45:35.930292+00:00 app[web.1]: message: 'Sorry, you are not allowed to view revisions of this post.',
2020-07-21T11:45:35.930293+00:00 app[web.1]: data: { status: 401 } }