Sending Direct Messages

Send a direct message.
Signature:
public async Task<DirectMessage> NewDirectMessageAsync(
    string screenName, string text)
public async Task<DirectMessage> NewDirectMessageAsync(
    ulong userID, string text)
Parameters/Filters:
Name Purpose Type Required
screenName Screen name of user to send DM to string yes
text Text of message to send string yes
userID ID of user to send DM to ulong yes


Return Type: DirectMessage
v 3.0 Example:
            var message = await twitterCtx.NewDirectMessageAsync(
                "Linq2Tweeter", "Direct Message Test - " + DateTime.Now + "!'");

            if (message != null)
                Console.WriteLine(
                    "Recipient: {0}, Message: {1}, Date: {2}",
                    message.RecipientScreenName,
                    message.Text,
                    message.CreatedAt);
v2.1 Example:
var message = twitterCtx.NewDirectMessage("16761255", "Direct Message Test - " 
                                          + DateTime.Now);

if (message != null)
{
    Console.WriteLine(
        "Recipient: {0}, Message: {1}, Date: {2}",
        message.RecipientScreenName,
        message.Text,
        message.CreatedAt);
}

Twitter API: direct_messages/new

Last edited Nov 29, 2013 at 3:21 AM by JoeMayo, version 15