TijsVerkoyen\Twitter\Twitter::directMessagesDestroy PHP Метод

directMessagesDestroy() публичный Метод

Important: This method requires an access token with RWD (read, write & direct message) permissions. Consult The Application Permission Model for more information.
public directMessagesDestroy ( string $id, bool[optional] $includeEntities = null ) : array
$id string The ID of the direct message to delete.
$includeEntities bool[optional]
Результат array
    public function directMessagesDestroy($id, $includeEntities = null)
    {
        // build parameters
        $parameters['id'] = (string) $id;
        if ($includeEntities !== null) {
            $parameters['include_entities'] = $includeEntities ? 'true' : 'false';
        }
        // make the call
        return $this->doCall('direct_messages/destroy.json', $parameters, true, 'POST');
    }

Usage Example

Пример #1
0
 /**
  * Tests Twitter->directMessagesNew
  */
 public function testDirectMessagesNew()
 {
     $response = $this->twitter->directMessagesNew(null, 'tijs_dev', 'Running the tests.. 私のさえずりを設定する ' . time());
     $this->isDirectMessage($response);
     $this->twitter->directMessagesDestroy($response['id']);
 }
Twitter