-
messages()returns a list of the 20 most recent direct messages sent to the authenticating user.Example 853. Retrieving recent direct messages received
<?php
$twitter = new Zend_Service_Twitter(array(
'username' => 'johndoe',
'accessToken' => $token
));
$response = $twitter->directMessage->messages();The
message()method accepts an array of optional parameters to modify the query.since_idreturns only direct messages with an ID greater than (that is, more recent than) the specified ID.sincenarrows the returned results to just those statuses created after the specified date/time (up to 24 hours old).pagespecifies which page you want to return.
-
sent()returns a list of the 20 most recent direct messages sent by the authenticating user.Example 854. Retrieving recent direct messages sent
<?php
$twitter = new Zend_Service_Twitter(array(
'username' => 'johndoe',
'accessToken' => $token
));
$response = $twitter->directMessage->sent();The
sent()method accepts an array of optional parameters to modify the query.since_idreturns only direct messages with an ID greater than (that is, more recent than) the specified ID.sincenarrows the returned results to just those statuses created after the specified date/time (up to 24 hours old).pagespecifies which page you want to return.
-
new()sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below.Example 855. Sending direct message
<?php
$twitter = new Zend_Service_Twitter(array(
'username' => 'johndoe',
'accessToken' => $token
));
$response = $twitter->directMessage->new('myfriend', 'mymessage');
-
destroy()destroys the direct message specified in the requiredidparameter. The authenticating user must be the recipient of the specified direct message.Example 856. Deleting direct message
<?php
$twitter = new Zend_Service_Twitter(array(
'username' => 'johndoe',
'accessToken' => $token
));
$response = $twitter->directMessage->destroy(123548);




