Direct messages/sent
« Return to the list of API methods
Contents |
URL
http://yourserver/api/direct_messages.format
Description
It returns the latest 25 private messages sent by the authentificated user
Available formats
XML, JSON, RSS
HTTP Method
GET
Requires authentication
YES
Optional parameters
- page: The page you want to see. Example: http://yourserver/statuses/friends_timeline.json?page=2
- count: The number of notes you want to see. Example: http://yourserver/statuses/friends_timeline.xml?count=10
- since_id: Returns results with an ID higher than specified. Example: http://yourserver/statuses/friends_timeline.rss?since_id=123
- max_id: Returns results with an ID lower than specified. Example: http://yourserver/statuses/friends_timeline.json?max_id=142
Return example (XML)
curl http://yourserver/api/direct_messages.xml
<?xml version="1.0" encoding="UTF-8"?> <direct_messages type="array"> <direct_message> <id>38</id> <created_at>Sun Apr 25 0:07:09 +0000 2010</created_at> <text>!marcosgdf 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> </direct_messages>
Return example (JSON)
curl http://yourserver/api/direct_messages.json
[ { "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 } } ]
Return example (RSS)
curl http://yourserver/api/direct_messages.rss
<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title><![CDATA[jiskotest // Private notes sent by marcosgdf]]></title> <description><![CDATA[Private notes sent by marcosgdf]]></description> <link>http://localhost/trunk/direct_messages/sent.rss</link> <atom:link href="http://localhost/trunk/direct_messages/sent.rss" rel="self" type="application/rss+xml"/> <generator>Jisko</generator> <ttl>10</ttl> <image> <link>http://localhost/trunk/</link> <title>Private notes sent by marcosgdf</title> <url>http://localhost/trunk/static/img/logos/logo.png</url> </image> <item> <title><![CDATA[marcosgdf: !marcosgdf abc]]></title> <description><![CDATA[marcosgdf: !marcosgdf abc]]></description> <pubDate>Sun, 25 Apr 2010 02:07:09 +0200</pubDate> <link>http://localhost/trunk/marcosgdf/38</link> <guid>http://localhost/trunk/marcosgdf/38</guid> <dc:creator>marcosgdf</dc:creator> <source url="http://localhost/trunk/rss/profile?u=marcosgdf">marcosgdf's notes feed</source> </item> </channel> </rss>

