createMessage abstract method

Future<TwitterResponse<MessageData, void>> createMessage({
  1. required String conversationId,
  2. required MessageParam message,
})

Creates a Direct Message on behalf of an authenticated user, and adds it to the specified conversation.

Parameters

  • conversationId: The dm_conversation_id of the conversation to add the Direct Message to. Supports both 1-1 and group conversations.

  • message: The object that contains the text and attachments parameters.

Endpoint Url

Authentication Methods

  • OAuth 2.0 Authorization Code with PKCE
  • OAuth 1.0a

Required Scopes

  • tweet.read
  • users.read
  • dm.read
  • dm.write

Rate Limits

  • User rate limit (User context): 200 requests per 15-minute window per each authenticated user.

  • User rate limit (User context): 1000 requests per 24-hour window per each authenticated user.

  • App rate limit: 15000 requests per 24-hour window shared among the app.

Reference

Implementation

Future<TwitterResponse<MessageData, void>> createMessage({
  required String conversationId,
  required MessageParam message,
});