Status 401: You are not allowed to delete this post – BASIC
-
Since updating from v3.4.0 to 3.5.1 I’m getting this error when trying to delete a post, using a custom python script. I’ve used this script for the past 16 mths without any issues, until this latest update.
Error msg:
Failed to delete post with id 873 on https://xxxxx.com. Status code: 401, Response: {"code":"rest_cannot_delete","message":"Sorry, you are not allowed to delete this post.","data":{"status":401}}
Reverting to v4.0 the error disappears.
The puzzling thing is that I can make posts ok with another custom script and it uses the same authentication details I use in my remove_post script.
Authentication code:
# Setup the authentication credentials
username = "xxxxx"
password = "xxxxxxxxxx"
token = base64.b64encode(f'{username}:{password}'.encode("utf-8")).decode("utf-8")
headers = {
"Authorization": "Basic " + token,
"Referer": "https://yahoo.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
}
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.