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

# v1에서 v2로

<div id="standard-v11-compared-to-x-api-v2">
  ## 표준 v1.1과 X API v2 비교
</div>

표준 v1.1 [POST statuses/update](https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update) 및 [POST statuses/destroy/:id](https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-destroy-id) 엔드포인트를 사용해 오셨다면, 이 가이드의 목적은 표준 엔드포인트와 X API v2 포스트 관리 엔드포인트 간의 유사점과 차이점을 이해하는 데 도움을 주는 것입니다.

* **유사점**
  * 인증
* **차이점**
  * 엔드포인트 URL

  * App 및 Project 요구 사항

  * 요청 매개변수

<div id="similarities">
  ### 유사점
</div>

**인증**

표준 v1.1과 X API v2의 포스트([POST statuses/update](https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update) 및 [POST statuses/destroy/:id](https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-destroy-id)) 엔드포인트는 모두 [OAuth 1.0a User Context](https://developer.x.com/content/developer-twitter/resources/fundamentals/authentication)를 사용합니다. 따라서 이전에 표준 v1.1 엔드포인트 중 하나를 사용하고 있었다면, X API v2 버전으로 마이그레이션하더라도 동일한 인증 방식을 계속 사용할 수 있습니다.

<div id="differences">
  ### 차이점
</div>

**엔드포인트 URL**

* Standard v1.1 엔드포인트:
  * [https://api.x.com/1.1/statuses/update.json](https://api.x.com/1.1/statuses/update.json)
    (게시물 생성)
  * `https://api.x.com/1.1/statuses/destroy/:id.json`
    (게시물 삭제)
* X API v2 엔드포인트:
  * [https://api.x.com/2/tweets](https://api.x.com/2/tweets)
    (게시물 생성)
  * [https://api.x.com/2/tweets/:id](https://api.x.com/2/tweets/:id)
    (지정된 게시물 삭제)

<div id="app-and-project-requirements">
  ### App 및 Project 요구 사항
</div>

X API v2 엔드포인트를 사용하려면, 요청을 인증할 때 [developer App](/ko/resources/fundamentals/developer-apps)에서 발급되었으며 [Project](/ko/resources/fundamentals/developer-apps)에 연결된 자격 증명을 사용해야 합니다. X API v1.1의 모든 엔드포인트는 Project에 연결되지 않은 App이든 Project에 연결된 App이든, App에서 발급된 자격 증명이라면 모두 사용할 수 있습니다.

<div id="request-parameters">
  ### 요청 매개변수
</div>

다음 표준 v1.1 요청 매개변수는 두 개의 쿼리 매개변수(`user_id` 또는 `screen_name`)를 지원했습니다. X API v2는 DELETE 엔드포인트에서는 숫자형 게시물 ID만 허용하며, 이는 엔드포인트 경로의 일부로 전달되어야 합니다.

POST 엔드포인트의 경우, 추가 매개변수는 요청의 JSON 본문을 통해 전달해야 합니다. 사용 가능한 매개변수에 대한 자세한 내용은 [API 참조 문서](/ko/x-api/posts/manage-tweets/introduction)에서 확인할 수 있습니다.

***

<div id="code-examples">
  ## 코드 예제
</div>

<div id="create-a-post-v2">
  ### 게시물 생성 (v2)
</div>

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl -X POST "https://api.x.com/2/tweets" \
    -H "Authorization: OAuth ..." \
    -H "Content-Type: application/json" \
    -d '{"text": "Hello world!"}'
  ```

  ```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.posts.create(text="Hello world!")
  print(f"Created Post: ${response.data.id}")
  ```

  ```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.posts.create({ text: "Hello world!" });
  console.log(`Created Post: ${response.data?.id}`);
  ```
</CodeGroup>

<div id="delete-a-post-v2">
  ### 게시물 삭제 (v2)
</div>

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.x.com/2/tweets/1234567890" \
    -H "Authorization: OAuth ..."
  ```

  ```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.posts.delete("1234567890")
  print(f"Deleted: {response.data.deleted}")
  ```

  ```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.posts.delete("1234567890");
  console.log(`Deleted: ${response.data?.deleted}`);
  ```
</CodeGroup>
