> For the complete documentation index, see [llms.txt](https://docs.bizspring.co.kr/bizspring-air-tm-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bizspring.co.kr/bizspring-air-tm-api/bizspring-air-tm-api-spec./auth-token.md).

# Auth Token(인증 토큰) 발행

## 인증 토큰 발행하기

인증 토큰은 Growth Platform™ API를 사용하기 위해 먼저 발행해야 하는 항목입니다.

* 토큰은 API 요청을 보낼 때 클라이언트를 인증하는데 사용되며, 각 요청 시 헤더에 포함되어야 합니다.
* 요청 성공 시 응답은 토큰과 토큰 정보를 포함합니다.

{% hint style="info" %}
API 사용을 위해서는 활성화된 API 사용 권한을 보유한 Growth Platform™ 계정이 필요합니다.

계정 생성 또는 API 사용 권한이 있는지 확인이 필요한 경우 [Growth Platform™ 계정 생성](/bizspring-air-tm-api/getting-started/growth-platform-tm.md)을 참고합니다.
{% endhint %}

### 인증 방식

모든 API 요청 헤더에 포함:

http

```http
Authorization: Bearer {ACCESS_TOKEN}
```

### **요청 URL**

아래 요청 URL로 계정 정보를 함께 요청하는 것으로서 인증 토큰을 발행 받고 획득하게 됩니다.

<pre class="language-http"><code class="lang-http"><strong>https://growthplatform.ai/auth/signin
</strong></code></pre>

### 프로토콜

HTTPS

### **HTTP 메서드**

POST

### Request Body

Request Body를 JSON 형식으로 전달(요청) 합니다.

<table><thead><tr><th width="210" align="center">키</th><th width="113" align="center">타입</th><th>설명</th></tr></thead><tbody><tr><td align="center">username</td><td align="center">string</td><td>사용자 계정의 고유 아이디를 의미합니다.</td></tr><tr><td align="center">password</td><td align="center">string</td><td>사용자 계정의 고유 비밀번호를 의미합니다.</td></tr></tbody></table>

### 요청 예

```http
POST /auth/signin
HEADER
Content-Type: application/json

BODY
{
  "username": "{ADMIN_ID}",
  "password": "{ADMIN_PW}"
}


# JavaScript JQuery 
const sendData = {
  'username': "{username}",
  'password': "{password}"
};

let token;
$.ajax({
  url: 'https://growthplatform.ai/auth/signin',
  method: 'POST',
  contentType: 'application/json; charset=utf-8',
  data: JSON.stringify(sendData),
  success: function (data) {
    // success
    token = data.token;
  },
  error: function (error) {
    // error
  }
});
```

### 응답 결과  데이터&#x20;

응답에 성공하면 JSON 형식으로 결과값이 반환됩니다.

<table><thead><tr><th width="169" align="center">파라미터</th><th width="153" align="center">타입</th><th>설명</th></tr></thead><tbody><tr><td align="center">token_type</td><td align="center">string</td><td>발행된 토큰의 타입. Bearer 로 고정</td></tr><tr><td align="center">token</td><td align="center">string</td><td>리포트 데이터 요청 시 사용되는 만료 기간이 있는 토큰</td></tr></tbody></table>

### 응답 예

<pre class="language-http"><code class="lang-http"><strong>HTTP/1.1 200 OK
</strong>Content-Type: application/json;charset=UTF-8

<strong>{
</strong>  "token_type": "Bearer",
  "token": "eyJraWQiOiI0ZGE2YmYxNy0wYTZmL....SrYiSAX7lZhc-rxKbrooQ8KQ-Dq7CV1tA"
}
</code></pre>

{% hint style="info" %}
HTTP Request에 대한 200 OK 응답이 아닌 경우는 username 및 password의 오류가 아닌,  클라이언트-API서버와의 통신문제이거나 기타 문제입니다.

이 경우에는 HTTP 표준 응답 코드를 참고하시기 바랍니다.
{% endhint %}

### 오류 코드

| HTTP | 오류 코드               | 설명                   |
| ---- | ------------------- | -------------------- |
| 400  | invalid\_request    | 필수 파라미터 누락           |
| 401  | invalid\_client     | client\_id/secret 오류 |
| 403  | access\_denied      | 접근 권한 없음             |
| 429  | too\_many\_requests | 요청 한도 초과             |

***

### 추가 예시

#### 토큰 발행 — cURL

{% tabs %}
{% tab title="bash" %}

```bash
curl -X POST https://api.bizspring.co.kr/air/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "your_client_id",
    "client_secret": "your_client_secret",
    "grant_type": "client_credentials"
  }'
```

{% endtab %}

{% tab title="python" %}

```python
import requests

def get_access_token(client_id: str, client_secret: str) -> str:
    url = "https://api.bizspring.co.kr/air/v1/auth/token"
    payload = {
        "client_id": client_id,
        "client_secret": client_secret,
        "grant_type": "client_credentials"
    }
    response = requests.post(url, json=payload)
    response.raise_for_status()
    return response.json()["access_token"]

token = get_access_token("your_client_id", "your_client_secret")
```

{% endtab %}

{% tab title="javascript" %}

```javascript
async function getAccessToken(clientId, clientSecret) {
  const response = await axios.post(
    'https://api.bizspring.co.kr/air/v1/auth/token',
    { client_id: clientId, client_secret: clientSecret, grant_type: 'client_credentials' }
  );
  return response.data.access_token;
}
```

{% endtab %}
{% endtabs %}

#### 응답 예시

json

```json
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 86400
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.bizspring.co.kr/bizspring-air-tm-api/bizspring-air-tm-api-spec./auth-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
