threads-api icon indicating copy to clipboard operation
threads-api copied to clipboard

Deleting Posts Doesn't work

Open alhassanalbadri opened this issue 2 years ago • 2 comments

Hey so I was tinkering around with the library and found out the following:

If you try to delete a post right after publishing (like the example does) it works fine, but whenever you use getPostIDfromURL to get the postID and use that, then it doesn't work and it returns a 500 error.

alhassanalbadri avatar Aug 31 '23 10:08 alhassanalbadri

Can you post the code you use? getPostIDfromURL isn't even async

ishaanbuildsthings avatar Aug 31 '23 16:08 ishaanbuildsthings

Can you post the code you use? getPostIDfromURL isn't even async

The issue is not in getPostIDfromURL, it is originated from the delete method. The code is part of a bigger context but it is as follows:

const threadsClient = // assume this is an instance of threads.
const postID = threadsClient.getPostIDfromURL('placeholder'); // the code returns a valid post id, no issue here
await threadsClient.delete(postID); // the code throws the 500 here at this request

The request sent is as follows: POST /api/v1/media/1188739602403146218596443867793401045807132630629409586704810983867956/delete/ HTTP/1.1

The web version of Threads is out by the way, there it sends a request to https://www.threads.net/api/graphql

alhassanalbadri avatar Aug 31 '23 16:08 alhassanalbadri