I want to delete Facebook posts that I have made after a certain number of days. I know I can delete a specific post with curl:  curl -i -X DELETE "https://graph.facebook.com/{post-id}?access_token={access-token}"; However, I need to do it programmatically, in order to schedule the deletes appropriately. Following a Stackoverflow post:
https://stackoverflow.com/questions/57646038/
I came up with the following snippet:
    access_token = '...blah...'
    base_api = 'https://graph.facebook.com/'
    post_id = '742194719255364_1530633492430138'

    payload = {
            'access_token': page_access_token,
            }
    response = requests.delete(base_api + post_id, params=payload)
    print(response)
 response is 400
Since I know the post-id is correct (saved when doing the post), I interpret 400 as a malformed url, but I can't see what might be wrong.
Any ideas please?
Graeme
--
 Next meeting: Online, Jitsi, Tuesday, 2026-09-01 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  https://dorset.lug.org.uk
 New thread, don't hijack:  mailto:[email protected]

Reply via email to