> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-5e62557c.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DirectMessagesClient

> X API SDK의 direct_messages.client Python 모듈에 대한 참조입니다. X API v2의 direct messages 엔드포인트를 호출하기 위한 클라이언트 클래스와 메서드입니다.

## DirectMessagesClient

<Badge color="blue">Class</Badge>

<Badge color="gray">기반 클래스: object</Badge>

다이렉트 메시지 작업을 위한 클라이언트

## 생성자

### `__init__`

#### 매개변수

<ParamField path="path.client" type="Client" />

### `create_by_conversation_id`

Create DM message by conversation ID
Sends a new direct message to a specific conversation by its ID.

#### 매개변수

<ParamField path="path.dm_conversation_id" type="str">
  The DM Conversation ID.
</ParamField>

<ParamField path="body.body" type="CreateByConversationIdRequest">
  요청 본문
</ParamField>

### `create_by_participant_id`

Create DM message by participant ID
Sends a new direct message to a specific participant by their ID.

#### 매개변수

<ParamField path="path.participant_id" type="Any">
  The ID of the recipient user that will receive the DM.
</ParamField>

<ParamField path="body.body" type="CreateByParticipantIdRequest">
  요청 본문
</ParamField>

### `create_conversation`

Create DM conversation
Initiates a new direct message conversation with specified participants.
body: 요청 본문
:returns: 응답 데이터
:rtype: CreateConversationResponse

#### 매개변수

<ParamField path="body.body" type="CreateConversationRequest" />

### `delete_events`

Delete DM event
Deletes a specific direct message event by its ID, if owned by the authenticated user.

#### 매개변수

<ParamField path="path.event_id" type="Any">
  The ID of the direct-message event to delete.
</ParamField>

#### 반환값

`DeleteEventsResponse` - 응답 데이터

### `get_events`

Get DM events
Retrieves a list of recent direct message events across all conversations.

#### 매개변수

<ParamField path="path.max_results" type="int or None" default="None">
  결과의 최대 개수입니다.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get a specified ‘page’ of results.
</ParamField>

<ParamField path="path.event_types" type="List or None" default="None">
  The set of event\_types to include in the results.
</ParamField>

<ParamField path="path.dm_event_fields" type="List or None" default="None">
  표시할 DmEvent 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  표시할 Media 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`IteratorGetEventsResponse`

### `get_events_by_conversation_id`

Get DM events for a DM conversation
Retrieves direct message events for a specific conversation.

#### 매개변수

<ParamField path="path.id" type="Any">
  The DM conversation ID.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  결과의 최대 개수입니다.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get a specified ‘page’ of results.
</ParamField>

<ParamField path="path.event_types" type="List or None" default="None">
  The set of event\_types to include in the results.
</ParamField>

<ParamField path="path.dm_event_fields" type="List or None" default="None">
  표시할 DmEvent 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  표시할 Media 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`IteratorGetEventsByConversationIdResponse`

### `get_events_by_id`

Get DM event by ID
Retrieves details of a specific direct message event by its ID.

#### 매개변수

<ParamField path="path.event_id" type="Any">
  dm event id.
</ParamField>

<ParamField path="path.dm_event_fields" type="List or None" default="None">
  표시할 DmEvent 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  표시할 Media 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`GetEventsByIdResponse` - 응답 데이터

### `get_events_by_participant_id`

Get DM events for a DM conversation
Retrieves direct message events for a specific conversation.

#### 매개변수

<ParamField path="path.participant_id" type="Any">
  The ID of the participant user for the One to One DM conversation.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  결과의 최대 개수입니다.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get a specified ‘page’ of results.
</ParamField>

<ParamField path="path.event_types" type="List or None" default="None">
  The set of event\_types to include in the results.
</ParamField>

<ParamField path="path.dm_event_fields" type="List or None" default="None">
  표시할 DmEvent 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  표시할 Media 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`IteratorGetEventsByParticipantIdResponse`
