Submodules
- xdk.direct_messages.client module
DirectMessagesClientDirectMessagesClient.__init__()DirectMessagesClient.create_by_conversation_id()DirectMessagesClient.create_by_participant_id()DirectMessagesClient.create_conversation()DirectMessagesClient.delete_events()DirectMessagesClient.get_events()DirectMessagesClient.get_events_by_conversation_id()DirectMessagesClient.get_events_by_id()DirectMessagesClient.get_events_by_participant_id()
- xdk.direct_messages.models module
CreateByConversationIdRequestCreateByConversationIdResponseCreateByParticipantIdRequestCreateByParticipantIdResponseCreateConversationRequestCreateConversationResponseDeleteEventsResponseGetEventsByConversationIdResponseGetEventsByIdResponseGetEventsByParticipantIdResponseGetEventsResponse
Module contents
This module provides access to the direct messages endpoints of the X API and serves as the main entry point for all direct messages-related functionality.class xdk.direct_messages.DirectMessagesClient
Client for direct messages operations
Parameters
__init__
Parameters
create_by_conversation_id
Create DM message by conversation ID
Sends a new direct message to a specific conversation by its ID.
Parameters
The DM Conversation ID.
Request body
create_by_participant_id
Create DM message by participant ID
Sends a new direct message to a specific participant by their ID.
Parameters
The ID of the recipient user that will receive the DM.
Request body
create_conversation
Create DM conversation
Initiates a new direct message conversation with specified participants.
body: Request body
:returns: Response data
:rtype: CreateConversationResponse
Parameters
delete_events
Delete DM event
Deletes a specific direct message event by its ID, if owned by the authenticated user.
Parameters
The ID of the direct-message event to delete.
Returns
DeleteEventsResponse - Response data
get_events
Get DM events
Retrieves a list of recent direct message events across all conversations.
Parameters
The maximum number of results.
This parameter is used to get a specified ‘page’ of results.
The set of event_types to include in the results.
A comma separated list of DmEvent fields to display.
A comma separated list of fields to expand.
A comma separated list of Media fields to display.
A comma separated list of User fields to display.
A comma separated list of Tweet fields to display.
Returns
GetEventsResponse - Response data
get_events_by_conversation_id
Get DM events for a DM conversation
Retrieves direct message events for a specific conversation.
Parameters
The DM conversation ID.
The maximum number of results.
This parameter is used to get a specified ‘page’ of results.
The set of event_types to include in the results.
A comma separated list of DmEvent fields to display.
A comma separated list of fields to expand.
A comma separated list of Media fields to display.
A comma separated list of User fields to display.
A comma separated list of Tweet fields to display.
Returns
GetEventsByConversationIdResponse - Response data
get_events_by_id
Get DM event by ID
Retrieves details of a specific direct message event by its ID.
Parameters
dm event id.
A comma separated list of DmEvent fields to display.
A comma separated list of fields to expand.
A comma separated list of Media fields to display.
A comma separated list of User fields to display.
A comma separated list of Tweet fields to display.
Returns
GetEventsByIdResponse - Response data
get_events_by_participant_id
Get DM events for a DM conversation
Retrieves direct message events for a specific conversation.
Parameters
The ID of the participant user for the One to One DM conversation.
The maximum number of results.
This parameter is used to get a specified ‘page’ of results.
The set of event_types to include in the results.
A comma separated list of DmEvent fields to display.
A comma separated list of fields to expand.
A comma separated list of Media fields to display.
A comma separated list of User fields to display.
A comma separated list of Tweet fields to display.
Returns
GetEventsByParticipantIdResponse - Response data