I am using the code from github /dg/twitter-php to send tweets and keep getting the below error EVEN THOUGH I just setup my app as “Read + Write + Read and post direct messages” and when I changed from Read only to this it said successful update / changes live now and then later I came back and found it was back to read only… does anyone know what I am doing wrong??

Errors:
[20-Jun-2021 12:13:10 America/Boise] PHP Fatal error: Uncaught DG\Twitter\Exception: Server error #401 with answer {“request”:“/1.1/statuses/update.json”,“error”:“Read-only application cannot POST.”} in /{redacted}/Twitter.php:361
Stack trace:
#0 /{redacted}/Twitter.php(113): DG\Twitter\Twitter->request(‘{redacted}’, ‘POST’, Array)
#1 /{redacted}/tweet-send.php(17): DG\Twitter\Twitter->send(‘I am fine’)
#2 {main}
thrown in /{redacted}/Twitter.php on line 361

I also tried just now to change from “Read + Write + Read and post direct messages” to “Read + Post Tweets and profile information” and still nothing works.

This is cornfusing to me… LOL

When you change permissions, your access tokens retain their old permissions - so if you changed permissions you also have to reset your access tokens.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.