Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete_post not work #341

Closed
afrizal423 opened this issue Jun 17, 2024 · 3 comments · Fixed by #342
Closed

delete_post not work #341

afrizal423 opened this issue Jun 17, 2024 · 3 comments · Fixed by #342

Comments

@afrizal423
Copy link

 raise exceptions.BadRequestError(error_response)
atproto_client.exceptions.BadRequestError: Response(success=False, status_code=400, content=XrpcError(error='InvalidRequest', message='Input/repo must be a valid did or a handle'), headers={'Date': 'Mon, 17 Jun 2024 04:58:07 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '81', 'Connection': 'keep-alive', 'X-Powered-By': 'Express', 'Access-Control-Allow-Origin': '*', 'ETag': 'W/"51-YuSfFFAs4Bhu5p38J588fpGYISo"', 'Vary': 'Accept-Encoding'})

Delete post not working, I'm just following this example https://github.com/MarshalX/atproto/blob/main/examples/delete_post.py

@MarshalX
Copy link
Owner

MarshalX commented Jun 17, 2024

Show the full code pls. Are you sure that is 1:1 as the example?

@afrizal423
Copy link
Author

I tried it exactly as shown in the example. and get a return value like that.
I just changed the handle and password

@MarshalX
Copy link
Owner

@afrizal423 ah. looks like the example is outdated. pls try this

client = Client()
client.login('my-handle', 'my-password')

post_ref = client.send_post('Test send-delete from Python SDK')
print('Post reference:', post_ref)

print('Post URI:', post_ref.uri)
print('Deleted successfully:', client.delete_post(post_ref.uri))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants