Direct messages/destroy

«  Return to the list of API methods

Contents

URL

http://yourserver/api/direct_messages/destroy/ID.format

Description

It deletes the private message with the specified ID

In order to delete it, the authentificated user has to be the author of the specified private message. This method will return the info about the private message

Available formats

XML, JSON

HTTP Method

POST

Requires authentication

YES

Required parameters

Return example (XML)

curl http://yourserver/api/direct_messages/destroy/39.xml -d ""
<?xml version="1.0" encoding="UTF-8"?>
<direct_message>
 <id>39</id>
 <created_at>Sun Apr 25 0:28:55 +0000 2010</created_at>
 <text>abc</text>
 <sender_id>1</sender_id>
 <recipient_id>1</recipient_id>
 <sender_screen_name>marcosgdf</sender_screen_name>
 <recipient_screen_name>marcosgdf</recipient_screen_name>
 <sender>
  <id>1</id>
  <name>marcosgdf</name>
  <screen_name>marcosgdf</screen_name>
  <location/>
  <description/>
  <profile_image_url>http://localhost/trunk/static/img/avatar/default_note.png</profile_image_url>
  <url/>
  <protected>true</protected>
  <followers_count>0</followers_count>
  <created_at>Fri Apr 16 20:12:11 +0000 2010</created_at>
  <favourites_count>0</favourites_count>
  <statuses_count>4</statuses_count>
  <friends_count>1</friends_count>
  <following>false</following>
  <utc_offset/>
  <geo_enabled>false</geo_enabled>
  <time_zone/>
  <profile_background_image_url>http://localhost/trunk/themes/transparency/img/bg.png</profile_background_image_url>
  <profile_background_tile>false</profile_background_tile>
  <notifications>false</notifications>
  <verified>false</verified>
  <lang>default</lang>
  <contributors_enabled>false</contributors_enabled>
 </sender>
 <recipient>
  <id>1</id>
  <name>marcosgdf</name>
  <screen_name>marcosgdf</screen_name>
  <location/>
  <description/>
  <profile_image_url>http://localhost/trunk/static/img/avatar/default_note.png</profile_image_url>
  <url/>
  <protected>true</protected>
  <followers_count>0</followers_count>
  <created_at>Fri Apr 16 20:12:11 +0000 2010</created_at>
  <favourites_count>0</favourites_count>
  <statuses_count>4</statuses_count>
  <friends_count>1</friends_count>
  <following>false</following>
  <utc_offset/>
  <geo_enabled>false</geo_enabled>
  <time_zone/>
  <profile_background_image_url>http://localhost/trunk/themes/transparency/img/bg.png</profile_background_image_url>
  <profile_background_tile>false</profile_background_tile>
  <notifications>false</notifications>
  <verified>false</verified>
  <lang>default</lang>
  <contributors_enabled>false</contributors_enabled>
 </recipient>
</direct_message>

Return example (JSON)

curl http://yourserver/api/direct_messages/destroy/38.json -d ""
{
    "id": 38,
    "created_at": "Sun Apr 25 0:07:09 +0000 2010",
    "text": "abc",
    "sender_id": "1",
    "recipient_id": "1",
    "sender_screen_name": "marcosgdf",
    "recipient_screen_name": "marcosgdf",
    "sender": {
        "id": 1,
        "name": "marcosgdf",
        "screen_name": "marcosgdf",
        "location": null,
        "description": "",
        "profile_image_url": "http:\/\/localhost\/trunk\/static\/img\/avatar\/default_note.png",
        "url": null,
        "protected": true,
        "followers_count": "0",
        "created_at": "Fri Apr 16 20:12:11 +0000 2010",
        "favourites_count": 0,
        "statuses_count": "4",
        "friends_count": "1",
        "following": false,
        "utc_offset": null,
        "time_zone": null,
        "profile_background_image_url": "http:\/\/localhost\/trunk\/themes\/transparency\/img\/bg.png",
        "profile_background_tile": false,
        "notifications": false,
        "verified": false,
        "lang": "default",
        "contributions_enabled": false,
        "geo_enabled": false
    },
    "recipient": {
        "id": 1,
        "name": "marcosgdf",
        "screen_name": "marcosgdf",
        "location": null,
        "description": "",
        "profile_image_url": "http:\/\/localhost\/trunk\/static\/img\/avatar\/default_note.png",
        "url": null,
        "protected": true,
        "followers_count": "0",
        "created_at": "Fri Apr 16 20:12:11 +0000 2010",
        "favourites_count": 0,
        "statuses_count": "4",
        "friends_count": "1",
        "following": false,
        "utc_offset": null,
        "time_zone": null,
        "profile_background_image_url": "http:\/\/localhost\/trunk\/themes\/transparency\/img\/bg.png",
        "profile_background_tile": false,
        "notifications": false,
        "verified": false,
        "lang": "default",
        "contributions_enabled": false,
        "geo_enabled": false
    }
}