Sending and receiving events
API Reference contents
POST direct_messages/destroy (deprecated, sunset August 16th, 2018)
GET direct_messages/events/show
GET direct_messages/events/list
POST direct_messages/events/new (message_create)
GET direct_messages/show (deprecated, sunset August 16th, 2018)
GET direct_messages (deprecated, sunset August 16th, 2018)
GET direct_messages/sent (deprecated, sunset August 16th, 2018)
POST direct_messages/new (deprecated, sunset August 16th, 2018)
DELETE direct_messages/events/destroy
GET direct_messages/events/list¶
Returns all Direct Message events (both sent and received) within the last 30 days. Sorted in reverse-chronological order.
Resource URL¶
https://api.twitter.com/1.1/direct_messages/events/list.json
Resource Information¶
Response formats | JSON |
Requires authentication? | Yes (user context only) |
Rate limited? | Yes |
Requests / 15-min window (user auth) | 15/user |
Parameters¶
count (optional) | Max number of events to be returned. 20 default. 50 max. |
cursor (optional) | For paging through result sets greater than 1 page, use the “next_cursor” property from the previous request. |
Example Response¶
Events are returned in the events
array. A next_cursor
property will be returned if there are more events to be retrieved.
Note
To determine if there are more event to retrieve, always look for the presence of a
next_cursor
. In rare cases theevents
array may be empty.
{
"next_cursor": "AB345dkfC",
"events": [
{ "id": "110", "created_timestamp": "5300", ... },
{ "id": "109", "created_timestamp": "5200", ... },
{ "id": "108", "created_timestamp": "5200", ... },
{ "id": "107", "created_timestamp": "5200", ... },
{ "id": "106", "created_timestamp": "5100", ... },
{ "id": "105", "created_timestamp": "5100", ... },
...
]
}
Note
User objects are not hydrated.