> ## 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>;
};

이 가이드는 사용자를 차단하고 차단을 해제하는 방법과, 자신의 차단 목록을 조회하는 방법을 안내합니다.

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

  시작하기 전에 다음이 필요합니다:

  * 승인된 App이 있는 [개발자 계정](https://developer.x.com/en/portal/petition/essential/basic-info)
  * 사용자 액세스 토큰 (OAuth 1.0a 또는 OAuth 2.0 PKCE)
</Note>

***

<div id="get-blocked-users">
  ## 차단한 사용자 가져오기
</div>

<Steps>
  <Step title="내 사용자 ID 가져오기">
    차단 목록을 가져오려면 인증된 사용자의 ID가 필요합니다. `/2/users/me` 엔드포인트에서 가져오거나 토큰에 포함된 ID를 사용할 수 있습니다.
  </Step>

  <Step title="차단 목록 요청하기">
    <CodeGroup dropdown>
      ```bash cURL theme={null}
      curl "https://api.x.com/2/users/123456789/blocking?\
      user.fields=username,verified,created_at&\
      max_results=100" \
        -H "Authorization: Bearer $USER_ACCESS_TOKEN"
      ```

      ```python Python SDK theme={null}
      from xdk import Client

      client = Client(bearer_token="YOUR_USER_ACCESS_TOKEN")

      # 페이지네이션을 사용하여 차단한 사용자 가져오기
      for page in client.users.get_blocking(
          "123456789",
          user_fields=["username", "verified", "created_at"],
          max_results=100
      ):
          for user in page.data:
              print(f"{user.username} - Created: {user.created_at}")
      ```

      ```javascript JavaScript SDK theme={null}
      import { Client } from "@xdevplatform/xdk";

      const client = new Client({ accessToken: "YOUR_USER_ACCESS_TOKEN" });

      // 페이지네이션을 사용하여 차단한 사용자 가져오기
      const paginator = client.users.getBlocking("123456789", {
        userFields: ["username", "verified", "created_at"],
        maxResults: 100,
      });

      for await (const page of paginator) {
        page.data?.forEach((user) => {
          console.log(`${user.username} - Created: ${user.created_at}`);
        });
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="응답 확인하기">
    ```json theme={null}
    {
      "data": [
        {
          "id": "17874544",
          "name": "Example User",
          "username": "example_user",
          "verified": false,
          "created_at": "2008-12-04T18:51:57.000Z"
        }
      ],
      "meta": {
        "result_count": 1,
        "next_token": "abc123"
      }
    }
    ```
  </Step>
</Steps>

***

<div id="block-a-user">
  ## 사용자 차단
</div>

<Steps>
  <Step title="대상 사용자 식별">
    차단하려는 계정의 사용자 ID를 확인합니다.
  </Step>

  <Step title="차단 요청 보내기">
    <CodeGroup dropdown>
      ```bash cURL theme={null}
      curl -X POST "https://api.x.com/2/users/123456789/blocking" \
        -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{"target_user_id": "9876543210"}'
      ```

      ```python Python SDK theme={null}
      from xdk import Client
      from xdk.oauth1_auth import OAuth1

      oauth1 = OAuth1(
          api_key="YOUR_API_KEY",
          api_secret="YOUR_API_SECRET",
          access_token="YOUR_ACCESS_TOKEN",
          access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
      )

      client = Client(auth=oauth1)

      # 사용자 차단
      response = client.users.block(
          source_user_id="123456789",
          target_user_id="9876543210"
      )
      print(f"Blocking: {response.data.blocking}")
      ```

      ```javascript JavaScript SDK theme={null}
      import { Client, OAuth1 } from "@xdevplatform/xdk";

      const oauth1 = new OAuth1({
        apiKey: "YOUR_API_KEY",
        apiSecret: "YOUR_API_SECRET",
        accessToken: "YOUR_ACCESS_TOKEN",
        accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
      });

      const client = new Client({ oauth1 });

      // 사용자 차단
      const response = await client.users.block("123456789", {
        targetUserId: "9876543210",
      });
      console.log(`Blocking: ${response.data?.blocking}`);
      ```
    </CodeGroup>
  </Step>

  <Step title="차단 확인">
    ```json theme={null}
    {
      "data": {
        "blocking": true
      }
    }
    ```
  </Step>
</Steps>

***

<div id="unblock-a-user">
  ## 사용자 차단 해제
</div>

<Steps>
  <Step title="차단 해제 요청 보내기">
    <CodeGroup dropdown>
      ```bash cURL theme={null}
      curl -X DELETE "https://api.x.com/2/users/123456789/blocking/9876543210" \
        -H "Authorization: Bearer $USER_ACCESS_TOKEN"
      ```

      ```python Python SDK theme={null}
      from xdk import Client
      from xdk.oauth1_auth import OAuth1

      oauth1 = OAuth1(
          api_key="YOUR_API_KEY",
          api_secret="YOUR_API_SECRET",
          access_token="YOUR_ACCESS_TOKEN",
          access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
      )

      client = Client(auth=oauth1)

      # 사용자 차단을 해제합니다.
      response = client.users.unblock(
          source_user_id="123456789",
          target_user_id="9876543210"
      )
      print(f"Blocking: {response.data.blocking}")
      ```

      ```javascript JavaScript SDK theme={null}
      import { Client, OAuth1 } from "@xdevplatform/xdk";

      const oauth1 = new OAuth1({
        apiKey: "YOUR_API_KEY",
        apiSecret: "YOUR_API_SECRET",
        accessToken: "YOUR_ACCESS_TOKEN",
        accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
      });

      const client = new Client({ oauth1 });

      // 사용자 차단을 해제합니다.
      const response = await client.users.unblock("123456789", "9876543210");
      console.log(`Blocking: ${response.data?.blocking}`);
      ```
    </CodeGroup>
  </Step>

  <Step title="차단 해제 확인하기">
    ```json theme={null}
    {
      "data": {
        "blocking": false
      }
    }
    ```
  </Step>
</Steps>

***

<div id="next-steps">
  ## 다음 단계
</div>

<CardGroup cols={2}>
  <Card title="뮤트" icon="volume-xmark" href="/ko/x-api/users/mutes/introduction">
    차단 대신 사용자를 뮤트하세요
  </Card>

  <Card title="팔로우" icon="user-plus" href="/ko/x-api/users/follows/introduction">
    팔로우를 관리하세요
  </Card>

  <Card title="통합 가이드" icon="book" href="/ko/x-api/users/blocks/integrate">
    핵심 개념과 모범 사례
  </Card>

  <Card title="API 참조 문서" icon="code" href="/ko/x-api/users/get-blocking">
    전체 엔드포인트 문서
  </Card>
</CardGroup>
