This project has moved and is read-only. For the latest updates, please go here.

Querying Direct Messages Sent to a User

Gets the 20 latest Direct Messages sent to a user.

Entity: DirectMessage
Type: DirectMessageType.SentTo
Name Purpose Type Required
Count Number of direct messages to return; max is 200 int no
IncludeEntities Include Twitter entities bool no
MaxID Return direct messages earlier than or equal to this ID ulong no
Page Page to retrieve int no
SinceID Return direct messages later than this ID ulong no
SkipStatus Exclude status information bool no

v3.0 Example:
            var dmResponse =
                    (from dm in twitterCtx.DirectMessage
                     where dm.Type == DirectMessageType.SentTo
                     select dm)

            if (dmResponse != null)
                dmResponse.ForEach(dm => 
                    if (dm != null && dm.Recipient != null)
                            "Name: {0}, Tweet: {1}",
                            dm.Recipient.ScreenNameResponse, dm.Text);
v2.1 Example:
            var directMessages =
                (from tweet in twitterCtx.DirectMessage
                 where tweet.Type == DirectMessageType.SentTo &&
                       tweet.Count == 2
                 select tweet)

                dm => Console.WriteLine(
                    "Sender: {0}, Tweet: {1}",

Twitter API: direct_messages

Last edited Nov 29, 2013 at 3:23 AM by JoeMayo, version 11