> ## 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.

# 다이렉트 메시지 조회

> 다이렉트 메시지 이벤트와 대화를 조회합니다

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

Direct Messages 조회 엔드포인트를 사용하면 인증된 사용자의 DM 이벤트를 조회할 수 있으며, 1:1 및 그룹 대화의 메시지가 모두 포함됩니다.

<div id="overview">
  ## 개요
</div>

<CardGroup cols={2}>
  <Card title="모든 DM 이벤트" icon="messages">
    사용자의 모든 DM 이벤트를 가져옵니다.
  </Card>

  <Card title="1:1" icon="message">
    특정 대화의 이벤트를 가져옵니다.
  </Card>

  <Card title="대화 ID별" icon="comments">
    대화 ID로 이벤트를 가져옵니다.
  </Card>

  <Card title="이벤트 유형" icon="bell">
    메시지, 참여, 나가기
  </Card>
</CardGroup>

***

<div id="endpoints">
  ## 엔드포인트
</div>

| Method | Endpoint                                                                                                               | Description           |
| :----- | :--------------------------------------------------------------------------------------------------------------------- | :-------------------- |
| GET    | [`/2/dm_events`](/ko/x-api/direct-messages/get-dm-events)                                                              | 사용자의 모든 DM 이벤트를 조회합니다 |
| GET    | [`/2/dm_conversations/with/:participant_id/dm_events`](/ko/x-api/direct-messages/get-dm-events-for-a-dm-conversation)  | 일대일 DM 대화의 이벤트를 조회합니다 |
| GET    | [`/2/dm_conversations/:dm_conversation_id/dm_events`](/ko/x-api/direct-messages/get-dm-events-for-a-dm-conversation-1) | 대화 ID로 DM 이벤트를 조회합니다  |

***

<div id="event-types">
  ## 이벤트 type
</div>

| Event               | Description           |
| :------------------ | :-------------------- |
| `MessageCreate`     | 대화에서 메시지가 전송될 때 발생합니다 |
| `ParticipantsJoin`  | 사용자가 대화에 참여할 때 발생합니다  |
| `ParticipantsLeave` | 사용자가 대화에서 나갈 때 발생합니다  |

***

<div id="data-retention">
  ## 데이터 보존
</div>

<Note>
  이 엔드포인트를 통해 **최대 30일 전**까지의 이벤트를 조회할 수 있습니다.
</Note>

***

<div id="getting-started">
  ## 시작하기
</div>

<Note>
  **사전 준비 사항**

  * 승인이 완료된 [개발자 계정](https://developer.x.com/en/portal/petition/essential/basic-info)
  * 개발자 콘솔에서 만든 [Project 및 App](/ko/resources/fundamentals/developer-apps)
  * [3-legged OAuth](/ko/resources/fundamentals/authentication#obtaining-access-tokens-using-3-legged-oauth-flow)를 통해 발급된 사용자 액세스 토큰
</Note>

<CardGroup cols={2}>
  <Card title="빠른 시작" icon="rocket" href="/ko/x-api/direct-messages/lookup/quickstart">
    첫 DM 조회 요청 만들기
  </Card>

  <Card title="연동 가이드" icon="book" href="/ko/x-api/direct-messages/lookup/integrate">
    핵심 개념 및 모범 사례
  </Card>

  <Card title="API 참조 문서" icon="code" href="/ko/x-api/direct-messages/get-dm-events">
    전체 엔드포인트 문서
  </Card>

  <Card title="샘플 코드" icon="github" href="https://github.com/xdevplatform/Twitter-API-v2-sample-code">
    실행 가능한 코드 예제
  </Card>
</CardGroup>
