W
W
WebDev2016-07-28 17:40:37
Twitter
WebDev, 2016-07-28 17:40:37

TwitterOAuth tweet post?

I use the TwitterOAuth API library.
I try as in the documentation:

$consumerkey        = "xxx";
        $consumersecret     = "xxx";
        $accesstoken        = "xxx";
        $accesstokensecret  = "xxx";

        try {
            $connection = new \TwitterOAuth($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
            $connection->post('statuses/update', ['status' => 'Test message']);
        } catch (\Exception $e) {}

Nothing happens. All data is correct, the application has write permissions. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WebDev, 2016-07-28
@kirill-93

It was necessary to regenerate tokens after changing rights

R
Rou1997, 2016-07-28
@Rou1997

your accesstoken is wrong, see Exception or remove it altogether try..catch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question