“Sorry, you are not allowed to create posts as this user.
-
Whenever I try to create post I receive:
401 Unauthorized Connection: close Date: Thu, 19 Oct 2017 11:03:28 GMT Server: Apache/2.4.18 (Ubuntu) Allow: GET Content-Type: application/json; charset=UTF-8 Access-Control-Allow-Headers: Authorization, Content-Type Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages Client-Date: Thu, 19 Oct 2017 11:03:28 GMT Client-Peer: 192.152.0.144:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked Client-Warning: Missing Authenticate header Link: <https://192.152.0.144/index.php/wp-json/>; rel="https://api.w.org/" X-Content-Type-Options: nosniff X-Robots-Tag: noindex {"code":"rest_cannot_edit_others","message":"Sorry, you are not allowed to create posts as this user.","data":{"status":401}}
Request for it:
POST https://SERVER/wp-json/wp/v2/posts Accept-Encoding: gzip Authorization: OAuth oauth_consumer_key="4OyIe97fyJds", oauth_nonce="NONCE", oauth_signature="SIGNATURE", oauth_signature_method="SIGNATURE_METHOD", oauth_timestamp="1508413884", oauth_token="TOKEN", oauth_version="1.0" User-Agent: WWW-Mechanize/1.75 Content-Length: 251 Content-Type: application/json {"author":1,"content":"<p>TEST body<br\\/><\\/p>","date":"2017-10-19T00:00:00","link":"http:\\/\\/abcnews.go.com\\/US\\/wireStory\\/latest-police-maryland-office-park-shooter-50563833","modified":"2017-10-19T07:03:12","status":"publish","title":"TEST title"}
I got client key and client secret from:
users > applications > app
access token and access_secret from logged in user from “WP REST API – OAuth 1.0a Server”.
Other requests with the same parameters works. Even same code worked for prev version (I can’t remember which one exactly). Current one is 4.8.2.
What did change and how can I debug it?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘“Sorry, you are not allowed to create posts as this user.’ is closed to new replies.