Application User don’t have access to create Post Via REST API
-
I am calling the create POST API but it’s giving me error. Is there any issue with the versions I am using latest versions which is 6.7.2.
This is the endpoint that I am calling. https://bright-cast.com/wp/wp-json/wp/v2/posts
I am using REST API Logs plugin to check the logs. Here is the detail of the API.Request Headers:
{ "accept": "*/*", "authorization": "Basic YWRtaW46QnJpZ2h0********", "content_type": "application/json", "content_length": "39", "host": "bright-cast.com", "user_agent": "curl/8.7.1", "x_https": "1" }Body Content:
{"title": "My test", "status": "draft"}Response Header:
{ "X-Powered-By": "PHP/8.1.31", "Content-Type": "application/json; charset=UTF-8", "X-Robots-Tag": "noindex", "Link": "<https//bright-cast.com/wp/wp-json/>; rel="https//api.w.org/"", "X-Content-Type-Options": "nosniff", "Access-Control-Expose-Headers": "X-WP-Total, X-WP-TotalPages, Link", "Access-Control-Allow-Headers": "Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type", "Allow": "GET" }Response Body:
{ "data": { "code": "rest_cannot_create", "message": "Sorry, you are not allowed to create posts as this user.", "data": { "status": 401 } }, "headers": { "Allow": "GET" }, "status": 401 }The blog I need help with is: (visible only to logged in users)
-
Hi there!
This appears to be a permission issue. I would recommend reaching out to the Web Host for the site you mentioned and asking them to take a look.
- The topic ‘Application User don’t have access to create Post Via REST API’ is closed to new replies.