adriantombu / twitter-cleaning

Delete your old tweets & likes automatically with Github Actions
GNU General Public License v3.0
22 stars 34 forks source link

403 Forbidden in New Project -> New App #7

Closed Electr0Spark closed 1 year ago

Electr0Spark commented 1 year ago

Hey, first of all, thanks in advance for the solution. Tried to run the script throught Actions but I'm having 403 errors while throwing this "detailed" message in those: "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal". Second time I drop project and app but to no avail, still giving me the same issue. I saw your Actions are working well, are you using any paid app? I'm just trying with the free dev one.

Thanks!

adriantombu commented 1 year ago

Hey @Electr0Spark!

I made a doc on how to properly retrieve the credentials on Twitter, did you follow all the steps? 😊

I'm not using any paid app, but it's been running for quite a while now and maybe there have been some changes to the API itself for creating new apps that I'm not aware of.

Electr0Spark commented 1 year ago

Hello back @adriantombu!

Thanks for your answer. Yes, I followed all the steps properly and also I've been checking about this error message but didn't found any info - got some clues and I guess it can be cause of being in the free plan and not in the basic (100$) one. One thing I'm wondering is about endpoints access with the free plan - supossedly, I can access only to /get and /delete ones (so the unlike one shouldn't work for me) but the delete tweets script doesn't work for me neither and is throwing the same 403 so I can't figure why that happens.

EDIT: just checked to rewrite a bit the script and run it from my local. Found out that running only against V2 deleteTweets function (so, delete/:id endpoint) works flawlessly while keeping the script as it is, fails with the mentioned 403 soon as I hit the userTimeline function.

gregrahn commented 1 year ago

I've also hit the new API limitations with delete tweet (works) and delete like (not working). The endpoints for the free/basic/pro level are documented here

Using twurl seems to confirm this is an API permissions issue, not a auth one.

$ twurl -X DELETE "/2/tweets/{redacted}"
{
  "data": {
    "deleted": true
  }
}

$ twurl -X DELETE "/2/users/{redacted}/likes/{redacted}"
{
  "client_id": "XXXXXXXX",
  "detail": "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.",
  "registration_url": "https://developer.twitter.com/en/docs/projects/overview",
  "title": "Client Forbidden",
  "required_enrollment": "Appropriate Level of API Access",
  "reason": "client-not-enrolled",
  "type": "https://api.twitter.com/2/problems/client-forbidden"
}
adriantombu commented 1 year ago

Dang, yes it seems that the latest restrictions of the free API have been quite drastic, to say the least... So yeah, managing likes is only possible with the "Basic" tier now (100$ / month, what a joke).

I guess my GitHub actions still work because... well... I don't have anything else to delete anymore since I left Twitter last year 😄