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

# 통합 가이드

> 이 페이지는 manage Posts 엔드포인트를 시스템에 통합하기 위한 도구와 핵심 개념을 다룹니다. manage tweets를 다루는 X API v2 standard 티어 레퍼런스입니다.

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <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>;
};

이 페이지는 manage Posts 엔드포인트를 시스템에 통합하기 위한 도구와 핵심 개념을 다룹니다.

## 유용한 도구

이 엔드포인트를 통합하는 데 도움이 될 핵심 개념을 살펴보기 전에, 다음 항목들에 익숙해지시길 권장합니다:

### Postman

Postman은 엔드포인트를 테스트할 때 사용할 수 있는 훌륭한 도구입니다. 각 Postman 요청에는 모든 path 및 body 파라미터가 포함되어 있어 사용 가능한 옵션을 빠르게 파악할 수 있습니다. Postman 컬렉션에 대해 자세히 알아보려면 ["Using Postman"](/tutorials/postman-getting-started) 페이지를 참고하세요.

### 코드 샘플

원하는 프로그래밍 언어의 코드로 이 엔드포인트 사용을 시작하고 싶으신가요? 시작점으로 활용할 수 있는 다양한 코드 샘플을 [Github 페이지](https://github.com/xdevplatform/Twitter-API-v2-sample-code)에서 제공합니다.

### 서드파티 라이브러리

시작에 도움이 되도록 커뮤니티의 [서드파티 라이브러리](/tools-and-libraries)를 활용해 보세요. 적절한 버전 태그를 확인하여 v2 엔드포인트와 호환되는 라이브러리를 찾을 수 있습니다.

## 핵심 개념

### 인증

모든 X API v2 엔드포인트는 keys and tokens라고도 부르는 자격 증명 세트로 요청을 인증해야 합니다.

이 엔드포인트들은 [OAuth 1.0a User Context](/resources/fundamentals/authentication) 사용이 필요합니다. 즉, 요청을 성공적으로 보내려면 API keys 세트와 user Access Token을 사용해야 합니다. Access Token은 요청을 대신하는 사용자와 연결되어 있어야 합니다. 다른 사용자를 위한 Access Token 세트를 생성하려면, 해당 사용자가 [3-legged OAuth 흐름](/resources/fundamentals/authentication#obtaining-access-tokens-using-3-legged-oauth-flow)을 사용하여 App을 승인하거나 인증해야 합니다.

OAuth 1.0a는 사용이 까다로울 수 있다는 점에 유의하세요. 이 인증 방식에 익숙하지 않다면 [라이브러리](/tools-and-libraries) 또는 Postman과 같은 도구를 사용하거나, OAuth 2.0으로 요청을 인증하는 것을 권장합니다.

[OAuth 2.0 Authorization Code with PKCE](/resources/fundamentals/authentication#oauth-2-0-authorization-code-flow-with-pkce-2)를 사용하면 애플리케이션 스코프를 더 세밀하게 제어하고 여러 기기에 걸친 승인 흐름을 사용할 수 있습니다. OAuth 2.0에서는 사용자를 대신해 특정 권한을 부여하는 세분화된 스코프를 선택할 수 있습니다.

App에서 OAuth 2.0을 사용하려면 Developer Console의 App settings 섹션에서 App의 authentication settings에서 활성화해야 합니다.

### Developer Console, Projects, developer Apps

X API v2 엔드포인트에서 동작하는 인증 자격 증명 세트를 얻으려면 [developer account](/resources/fundamentals/developer-portal)를 보유하고, 해당 계정 내에서 [Project](/resources/fundamentals/developer-apps)를 설정하고, 그 Project 내에서 [developer App](/resources/fundamentals/developer-apps)을 생성해야 합니다. 그런 다음 developer App에서 keys and tokens를 확인할 수 있습니다.

### 게시물 생성 제한 (self-serve)

다음 제한은 self-serve(Pay Per Use) API 고객에게만 적용됩니다. Enterprise API 고객은 이 제한을 받지 않습니다.

**답글 제한**

API를 통한 답글은 답글을 다는 계정이 원본 게시물 작성자에 의해 명시적으로 소환된 경우에만 허용됩니다. 즉, 다음 중 하나가 반드시 참이어야 합니다:

* 원본 작성자가 답글을 다는 사용자/계정을 @멘션합니다.
* 원본 작성자가 답글을 다는 사용자/계정의 게시물을 인용합니다.

두 조건 중 어느 것도 충족되지 않으면 답글 요청은 거부됩니다.

**Cashtag 제한**

API를 통해 생성된 게시물은 게시물당 최대 1개의 cashtag(예: `$TICKER`)로 제한됩니다. cashtag가 1개보다 많이 포함된 요청은 거부됩니다.

### Rate limit

매일 수천 명의 개발자가 X API에 요청을 보냅니다. 이러한 대량의 요청을 관리하기 위해 각 엔드포인트에 [rate limit](https://developer.x.com/x-api/fundamentals/rate-limits)이 설정되어 있으며, 이는 앱이나 인증된 사용자를 대신하여 만들 수 있는 요청 수를 제한합니다.

이 엔드포인트들은 사용자 수준에서 rate limit이 설정되어 있으므로, 요청을 대신 수행하는 인증된 사용자는 모든 developer App에서 이 엔드포인트를 정해진 횟수만큼만 호출할 수 있습니다. POST 메서드의 경우 사용자당 15분당 200 요청의 rate limit이 있습니다. DELETE 메서드는 15분당 50 요청의 rate limit이 있습니다. 또한 manage Posts 또는 manage Retweets로 생성된 게시물을 포함해 [3시간당 300 요청](https://blog.x.com/developer/en_us/topics/tools/2018/new-developer-requirements-to-protect-our-platform) 제한이 있습니다.

### Source 레이블

App 이름과 웹사이트 URL은 애플리케이션에서 프로그래밍 방식으로 생성된 모든 게시물의 메타데이터 내 [source 레이블](https://help.x.com/en/using-twitter/how-to-tweet#source-labels)로 표시됩니다. X App의 사용 사례를 변경하는 경우 [Developer Terms](https://developer.x.com/content/developer-twitter/en/developer-terms/agreement-and-policy)를 준수하도록 이 설정에서 사용 사례를 반드시 업데이트하세요.

### 프로필 설정

프로필 설정에서 geo가 활성화되어 있는 경우에만 게시물에 위치를 추가할 수 있습니다. geo가 활성화되어 있지 않다면, 요청 본문에 여전히 location 파라미터를 추가할 수 있지만 게시물에 부착되지 않습니다. 이미지에 사용자를 태그하는 것도 마찬가지입니다. 태그하려는 사용자가 사진 태깅을 활성화하지 않은 경우, 게시물이 성공적으로 생성되더라도 그들의 이름이 태그된 사용자 목록에 표시되지 않습니다.

### 게시물에 미디어 추가

현재 X API의 v2를 사용해 미디어를 완전히 업로드하는 방법은 없습니다. 그러나 이전에 업로드한 미디어를 게시물에 첨부할 수 있습니다. [media upload 엔드포인트를 사용해 이미 업로드된 미디어 ID](/x-api/media/upload-media)나 [X Media Studio](https://media.x.com/en/articles/products/2018/media-studio)로 업로드된 미디어 ID를 사용할 수 있습니다. 이 미디어 ID는 본인 또는 인증된 사용자의 것이어야 합니다.

***

## 코드 예시

### 게시물 생성

<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 title="Python SDK" lines wrap icon="python" 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)

  # Create a Post
  response = client.posts.create(text="Hello world!")
  print(f"Created Post: {response.data.id}")
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" 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 });

  // Create a Post
  const response = await client.posts.create({ text: "Hello world!" });
  console.log(`Created Post: ${response.data?.id}`);
  ```
</CodeGroup>

### 답글 생성

<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": "This is a reply!", "reply": {"in_reply_to_tweet_id": "1234567890"}}'
  ```

  ```python title="Python SDK" lines wrap icon="python" 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)

  # Create a reply
  response = client.posts.create(
      text="This is a reply!",
      reply={"in_reply_to_tweet_id": "1234567890"}
  )
  print(f"Created reply: {response.data.id}")
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" 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 });

  // Create a reply
  const response = await client.posts.create({
    text: "This is a reply!",
    reply: { inReplyToTweetId: "1234567890" },
  });
  console.log(`Created reply: ${response.data?.id}`);
  ```
</CodeGroup>

### 게시물 삭제

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

  ```python title="Python SDK" lines wrap icon="python" 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)

  # Delete a Post
  response = client.posts.delete("1234567890")
  print(f"Deleted: {response.data.deleted}")
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" 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 });

  // Delete a Post
  const response = await client.posts.delete("1234567890");
  console.log(`Deleted: ${response.data?.deleted}`);
  ```
</CodeGroup>

**다음 단계**

[API 레퍼런스](/x-api/posts/manage-tweets#manage-tweets-api-reference-index)
