# API 플레이그라운드

## 개요

Panther Console의 API Playground에서 GraphQL API와 REST API의 작업을 시험해 볼 수 있습니다.

### Playground에 액세스하는 방법

{% hint style="info" %}
Playground에 액세스하려면 `API 토큰 보기` 권한이 있어야 합니다—방법은 다음을 참조하세요. [Panther의 역할 기반 액세스 제어](/ko/system-configuration/rbac.md) 사용자 역할 수정 방법은 문서를 참조하세요.
{% endhint %}

1. Panther Console의 오른쪽 상단 모서리에서 톱니바퀴 아이콘을 클릭합니다.
2. 드롭다운 메뉴에서 다음을 클릭하세요. **API Playground**.
3. 창 상단의 탭을 사용하여 테스트할 API 세트를 선택합니다: [GraphQL](/ko/panther/api/graphql.md) 또는 [REST](/ko/panther/api/rest.md).
   * 다음에 API Playground를 방문하면 마지막으로 사용하던 API로 이동합니다.\\

     <figure><img src="/files/9070d675872b5f7654f7247ef97990e234c72966" alt="Two tabs are shown: GraphQL and REST." width="204"><figcaption></figcaption></figure>

{% hint style="warning" %}
참고:

* API 토큰을 방금 생성한 경우, 새 토큰이 관련 분산 AWS 서비스에서 사용 가능해질 때까지 30\~60초 정도 기다려 주세요.
* 보안상의 이유로 API 토큰은 **표시되지 않지만** 페이지를 새로고침하거나 다른 페이지로 이동해도 Playground에 유지됩니다. Playground를 사용할 때마다 API 토큰을 다시 입력해야 합니다.
  {% endhint %}

## GraphQL Playground

유효한 API 토큰을 입력한 후, 왼쪽 상단의 "재생" 아이콘을 클릭하여 GraphQL 쿼리가 실행되도록 합니다.

<figure><img src="/files/4887e3494e6335b3e71ce7796194872ddfbf68fd" alt="The API Playground&#x27;s default view shows an example query in a code editor on the left. On the right, there is a column labeled Documentation Explorer."><figcaption></figcaption></figure>

### 문서 탐색기

Panther Console의 문서 탐색기는 Panther API 스키마를 살펴보는 한 가지 방법입니다. 다운로드 가능한 스키마 파일을 포함한 다른 방법을 알아보려면 다음을 참조하세요. [Panther GraphQL 스키마 살펴보기](/ko/panther/api/graphql.md#discover-the-panther-graphql-schema).

다음을 참조하세요. **문서 탐색기** Playground의 오른쪽에 있습니다. 사용 가능한 쿼리와 변이, 그리고 모든 필드와 엔터티의 설명과 유형을 표시합니다:

<figure><img src="/files/ba8ebc1267e58b1c4fa7c9d34440204c1b1cd799" alt="The image shows the Documentation Explorer that appears on the right side of the API Playground. It has a search field at the top, and a header labeled &#x22;Root Types.&#x22; Under &#x22;Root Types,&#x22; it lists &#x22;query: Query&#x22; and &#x22;mutation: Mutation&#x22;." width="375"><figcaption></figcaption></figure>

### 직접 쿼리 작성하기

자동 완성 기능과 문서 탐색기는 직접 쿼리를 작성하는 데 도움이 됩니다. 또한 페이지 상단 근처에는 세 개의 유틸리티 버튼이 있습니다:

* **예쁘게 정리** GraphQL 표준에 맞게 쿼리 형식을 지정하는 데 도움을 줍니다
* **복사** 요청을 보낼 클라이언트에 붙여넣기 위해 쿼리를 복사합니다
* **curl 복사** curl 명령줄 도구가 설치된 모든 UNIX 시스템에 붙여넣을 수 있는 완전한 curl 작업을 복사합니다.

Panther 웹 애플리케이션에서 복사되는 curl 명령의 예:

```
curl 'PANTHER_GRAPHQL_API_URL' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Connection: keep-alive' \
-H 'DNT: 1' \
-H 'Origin: http://{PANTHER_GRAPHQL_API_URL}/public/graphql' \
-H 'X-API-Key: {FAKE_API_KEY_WITH_USER_READ_PERMISSIONS}' \
--data-binary '{"query":"\n # 조직의 사용자를 나열하는 예제 쿼리\n query Users {\n users {\n\t\t\tgivenName\n familyName\n email\n }\n }","variables":{}}' \
--compressed
```

## REST Playground

REST Playground를 사용하여 Panther를 살펴보고 시험해 보세요 [REST API](/ko/panther/api/rest.md).

### API 토큰 설정 방법

1. 오른쪽 상단에서 다음을 클릭하세요. **권한 부여**.\\

   <figure><img src="/files/0218640fca90849611226200f4a862cc8e7349d1" alt="An arrow is drawn to a button labeled &#x22;Authorize.&#x22;"><figcaption></figcaption></figure>
2. 모달에서 API 키를 입력합니다.
3. 다음을 클릭하세요. **권한 부여**의 가장 높은 패치 버전으로 업그레이드한 다음, **닫기**.

### API 그룹 탐색

API 그룹은 먼저 API별 URL 경로에 따라 모아져 나열됩니다. 요청 인수와 예시 반환 페이로드를 포함하여 특정 엔드포인트의 추가 세부 정보를 보려면 엔드포인트 행 오른쪽의 화살표를 클릭합니다.

<figure><img src="/files/6b1a794bd8905e7d65ae59ba9fb989b79350adaa" alt="Under a header reading &#x22;Panther REST API,&#x22; a grouping of data model endpoints is shown. There are GET (list), POST, DELETE, GET, and PUT endpoints."><figcaption></figcaption></figure>

#### 요청 보내기

{% hint style="info" %}
성공적으로 요청하려면 Playground에 API 토큰을 이미 추가해야 합니다. 위의 [API 토큰 설정 방법](#how-to-set-your-api-token)를 참조하세요.
{% endhint %}

Playground에서 요청을 보내려면:

1. 확장된 API 엔드포인트 내에서 **시도해 보기**.
2. 다음에서 **Parameters** 섹션을 클릭한 다음, 필요한 경우 필요한 및 선택적 매개변수에 값을 입력합니다.
3. 다음을 클릭하세요. **실행**.

<figure><img src="/files/c83aa1811cdfc831507050068c1561929594d470" alt="Within a GET /rules section, a &#x22;Try it out&#x22; button is circled. Two parameters are shown: cursor, and limit."><figcaption></figcaption></figure>

### 스키마 보기

API 그룹 아래에는 각 데이터 유형의 스키마가 나열됩니다:

<figure><img src="/files/a7841fbc742d330f0b007acc5d7641af6990387c" alt="The Schema section showing all the data types grouped by name"><figcaption></figcaption></figure>

특정 데이터 유형의 세부 정보를 보려면 해당 행을 클릭하여 확장합니다:

<figure><img src="/files/8e75b4bca3fca9a191484978a07c39af33b07624" alt="A &#x22;RuleAPI.Rule&#x22; entity is shown. Part of the JSON body is expanded, while other parts are closed."><figcaption></figcaption></figure>

이러한 스키마는 다음을 할 때도 볼 수 있습니다 [API 그룹 보기](#exploring-api-groups)의 **응답** 섹션에서 **예시 값**의 오른쪽에서, 다음을 클릭합니다 **스키마**.

<figure><img src="/files/69a4fbd1eb896babaff231f7570e5f1d4b0db4ef" alt="Inline schema block in the Responses portion of an API Group, showing the datatype where it is used."><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.panther.com/ko/panther/api/api-playground.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
