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

# DirectMessagesClient

다이렉트 메시지 작업을 위한 Client

이 Client는 X API의 다이렉트 메시지 엔드포인트와 상호 작용하기 위한 메서드를 제공합니다. 인증, 요청 형식화, 응답 파싱을 처리하여 다이렉트 메시지와 관련된 모든 작업을 수행합니다.

<div id="constructors">
  ## 생성자
</div>

<div id="constructor">
  ### constructor
</div>

• **new DirectMessagesClient**(`client`): [`DirectMessagesClient`](/ko/xdks/typescript/reference/classes/DirectMessagesClient)

새 다이렉트 메시지 Client 인스턴스를 생성합니다

#### 매개변수

| Name     | Type                                                     | Description          |
| :------- | :------------------------------------------------------- | :------------------- |
| `client` | [`Client`](/ko/xdks/typescript/reference/classes/Client) | 주요 X API Client 인스턴스 |

#### 반환값

[`DirectMessagesClient`](/ko/xdks/typescript/reference/classes/DirectMessagesClient)

#### 정의 위치

[direct\_messages/client.ts:340](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L340)

<div id="methods">
  ## 메서드
</div>

<div id="createbyconversationid">
  ### createByConversationId
</div>

▸ **createByConversationId**(`dmConversationId`, `options`): `Promise`\<`Response`>

대화 ID로 다이렉트 메시지 생성
지정된 대화의 식별자(ID)를 사용해 새 다이렉트 메시지를 전송합니다.

#### 매개변수

| 이름                 | Type                                                                          | 설명            |
| :----------------- | :---------------------------------------------------------------------------- | :------------ |
| `dmConversationId` | `string`                                                                      | DM 대화의 id입니다. |
| `options`          | `CreateByConversationIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -             |

#### 반환값

`Promise`\<`Response`>

API 응답으로 resolve되는 Promise 또는 `requestOptions.raw`가 `true`인 경우 원시 `Response`

#### 정의 위치

[direct\_messages/client.ts:385](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L385)

▸ **createByConversationId**(`dmConversationId`, `options?`): `Promise`\<[`CreateDmEventResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.CreateDmEventResponse)>

#### 매개변수

| 이름                 | 타입                              |
| :----------------- | :------------------------------ |
| `dmConversationId` | `string`                        |
| `options?`         | `CreateByConversationIdOptions` |

#### 반환값

`Promise`\<[`CreateDmEventResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.CreateDmEventResponse)>

#### 정의 위치

[direct\_messages/client.ts:398](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L398)

***

<div id="geteventsbyconversationid">
  ### getEventsByConversationId
</div>

▸ **getEventsByConversationId**(`id`, `options`): `Promise`\<`Response`>

DM 대화의 DM 이벤트를 가져오기\
특정 DM 대화에 대한 다이렉트 메시지 이벤트를 조회합니다.

#### 파라미터

| Name      | Type                                                                             | Description  |
| :-------- | :------------------------------------------------------------------------------- | :----------- |
| `id`      | `string`                                                                         | DM 대화 ID입니다. |
| `options` | `GetEventsByConversationIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -            |

#### 반환값

`Promise`\<`Response`>

API 응답으로 resolve되는 Promise이며, requestOptions.raw가 true인 경우 원시 Response를 그대로 반환합니다

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:506](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L506)

▸ **getEventsByConversationId**(`id`, `options?`): `Promise`\<[`Get2DmConversationsIdDmEventsResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.Get2DmConversationsIdDmEventsResponse)>

#### 매개변수

| 이름         | 타입                                 |
| :--------- | :--------------------------------- |
| `id`       | `string`                           |
| `options?` | `GetEventsByConversationIdOptions` |

#### 반환

`Promise`\<[`Get2DmConversationsIdDmEventsResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.Get2DmConversationsIdDmEventsResponse)>

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:519](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L519)

***

<div id="createconversation">
  ### createConversation
</div>

▸ **createConversation**(`options`): `Promise`\<`Response`>

DM 대화 생성
지정된 참여자들과 새로운 직접 메시지(DM) 대화를 시작합니다.

#### 매개변수

| 이름        | type                                                                      |
| :-------- | :------------------------------------------------------------------------ |
| `options` | `CreateConversationOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } |

#### 반환값

`Promise`\<`Response`>

API 응답을 resolve하는 Promise이거나, requestOptions.raw 가 true 인 경우 원시 Response

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:784](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L784)

▸ **createConversation**(`options?`): `Promise`\<[`CreateDmEventResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.CreateDmEventResponse)>

#### 매개변수

| 이름         | type                        |
| :--------- | :-------------------------- |
| `options?` | `CreateConversationOptions` |

#### 반환값

`Promise`\<[`CreateDmEventResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.CreateDmEventResponse)>

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:793](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L793)

***

<div id="geteventsbyparticipantid">
  ### getEventsByParticipantId
</div>

▸ **getEventsByParticipantId**(`participantId`, `options`): `Promise`\<`Response`>

DM 대화의 이벤트를 가져옵니다.
특정 DM 대화에 대한 DM 이벤트를 조회합니다.

<div id="parameters">
  #### Parameters
</div>

| Name            | Type                                                                            | Description              |
| :-------------- | :------------------------------------------------------------------------------ | :----------------------- |
| `participantId` | `string`                                                                        | 1:1 DM 대화의 참여 사용자 ID입니다. |
| `options`       | `GetEventsByParticipantIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                        |

#### 반환값

`Promise`\<`Response`>

API 응답으로 resolve되는 Promise이며, requestOptions.raw가 true인 경우 원시 Response

#### 정의 위치

[direct\_messages/client.ts:889](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L889)

▸ **getEventsByParticipantId**(`participantId`, `options?`): `Promise`\<[`Get2DmConversationsWithParticipantIdDmEventsResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.Get2DmConversationsWithParticipantIdDmEventsResponse)>

#### 매개변수

| 이름              | 유형                                |
| :-------------- | :-------------------------------- |
| `participantId` | `string`                          |
| `options?`      | `GetEventsByParticipantIdOptions` |

#### 반환값

`Promise`\<[`Get2DmConversationsWithParticipantIdDmEventsResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.Get2DmConversationsWithParticipantIdDmEventsResponse)>

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:902](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L902)

***

<div id="getevents">
  ### getEvents
</div>

▸ **getEvents**(`options`): `Promise`\<`Response`>

DM 이벤트 가져오기
모든 대화에 걸쳐 최근 다이렉트 메시지 이벤트 목록을 가져옵니다.

#### 매개변수

| 이름        | 타입                                                               |
| :-------- | :--------------------------------------------------------------- |
| `options` | `GetEventsOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } |

#### 반환값

`Promise`\<`Response`>

API 응답으로 resolve되는 `Promise` 또는 `requestOptions.raw`가 true인 경우 원시 `Response`

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:1167](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L1167)

▸ **getEvents**(`options?`): `Promise`\<[`Get2DmEventsResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.Get2DmEventsResponse)>

#### 매개변수

| 이름         | Type               |
| :--------- | :----------------- |
| `options?` | `GetEventsOptions` |

#### 반환

`Promise`\<[`Get2DmEventsResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.Get2DmEventsResponse)>

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:1176](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L1176)

***

<div id="geteventsbyid">
  ### getEventsById
</div>

▸ **getEventsById**(`eventId`, `options`): `Promise`\<`Response`>

ID로 DM 이벤트 조회\
특정 다이렉트 메시지 이벤트를 해당 ID로 조회합니다.

#### 매개변수

| Name      | Type                                                                 | Description    |
| :-------- | :------------------------------------------------------------------- | :------------- |
| `eventId` | `string`                                                             | DM 이벤트의 id입니다. |
| `options` | `GetEventsByIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -              |

#### 반환값

`Promise`\<`Response`>

API 응답으로 resolve되는 `Promise`이며, `requestOptions.raw`가 true인 경우 원시 `Response`를 반환합니다

#### 정의 위치

[direct\_messages/client.ts:1433](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L1433)

▸ **getEventsById**(`eventId`, `options?`): `Promise`\<[`Get2DmEventsEventIdResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.Get2DmEventsEventIdResponse)>

#### 매개변수

| 이름         | 유형                     |
| :--------- | :--------------------- |
| `eventId`  | `string`               |
| `options?` | `GetEventsByIdOptions` |

#### 반환값

`Promise`\<[`Get2DmEventsEventIdResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.Get2DmEventsEventIdResponse)>

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:1446](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L1446)

***

<div id="deleteevents">
  ### deleteEvents
</div>

▸ **deleteEvents**(`eventId`, `options`): `Promise`\<`Response`>

DM 이벤트 삭제
인증된 사용자가 소유한 특정 다이렉트 메시지 이벤트를 해당 ID를 사용해 삭제합니다.

#### 매개변수

| Name                         | Type     | Description                   |
| :--------------------------- | :------- | :---------------------------- |
| `eventId`                    | `string` | 삭제할 다이렉트 메시지 이벤트의 식별자(id)입니다. |
| `options`                    | `Object` | -                             |
| `options.requestOptions`     | `Object` | -                             |
| `options.requestOptions.raw` | `true`   | -                             |

<div id="returns">
  #### 반환 값
</div>

`Promise`\<`Response`>

API 응답으로 resolve되는 Promise입니다. requestOptions.raw가 true인 경우에는 원시 Response를 반환합니다

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:1656](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L1656)

▸ **deleteEvents**(`eventId`): `Promise`\<[`DeleteDmResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.DeleteDmResponse)>

#### 매개변수

| 이름        | Type     |
| :-------- | :------- |
| `eventId` | `string` |

<div id="returns">
  #### 반환 값
</div>

`Promise`\<[`DeleteDmResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.DeleteDmResponse)>

#### 정의 위치

[direct\_messages/client.ts:1669](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L1669)

***

<div id="createbyparticipantid">
  ### createByParticipantId
</div>

▸ **createByParticipantId**(`participantId`, `options`): `Promise`\<`Response`>

참가자 ID로 DM 메시지 생성
지정된 참가자의 ID를 사용해 새로운 DM 메시지를 전송합니다.

<div id="parameters">
  #### Parameters
</div>

| Name            | Type                                                                         | Description        |
| :-------------- | :--------------------------------------------------------------------------- | :----------------- |
| `participantId` | `string`                                                                     | DM을 수신할 사용자 ID입니다. |
| `options`       | `CreateByParticipantIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                  |

#### 반환

`Promise`\<`Response`>

API 응답으로 resolve되는 Promise이며, requestOptions.raw가 true인 경우 원시 Response

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:1760](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L1760)

▸ **createByParticipantId**(`participantId`, `options?`): `Promise`\<[`CreateDmEventResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.CreateDmEventResponse)>

#### 매개변수

| 이름              | 타입                             |
| :-------------- | :----------------------------- |
| `participantId` | `string`                       |
| `options?`      | `CreateByParticipantIdOptions` |

#### 반환

`Promise`\<[`CreateDmEventResponse`](/ko/xdks/typescript/reference/interfaces/Schemas.CreateDmEventResponse)>

<div id="defined-in">
  #### 정의된 위치
</div>

[direct\_messages/client.ts:1773](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/direct_messages/client.ts#L1773)
