# 토큰

## Request

인증용 토큰 발급/갱신 API 목록입니다. 마스터, 매니저, 대행사의 계정 ID와 API KEY로 인증 발급됩니다. 발급된 token은 모든 API의 header에 삽입되어야 합니다.

## Access 토큰을 발급 요청합니다.<br>

> Access 토큰을 발급 요청합니다.  \
> \
> RCS Biz Center 웹에서 가입 시 등록한 ID(마스터 또는 매니저, 대행사)와 계정 가입 시 자동 생성되는 API\
> Key(RCS Biz Center 내 계정관리에서 확인)를 이용하여 토큰 발급을 요청합니다.  \
> \
> response로 전달되는 expiresIn 시간이 초과하면 토큰을 새로 발급 받아야 합니다.          \
> \
> &#x20; \+ \*\*API 사용 Client의 IP는 RCS Biz Center에서 등록하여야 합니다. Client IP 등록은 내 계정관리에서 ID별 최대 10개까지 등록할 수 있습니다.\*\*          \
> &#x20; \+ \*\*계정 권한 : 마스터, 매니저, 대행사\*\*<br>

```json
{"openapi":"3.0.0","info":{"title":"RCS Biz Center API 규격","version":"1.1.15"},"servers":[{"description":"RCS Biz Center API for Staging","url":"https://api-qa.rcsbizcenter.com/api/1.1"},{"description":"RCS Biz Center API for Production","url":"https://api.rcsbizcenter.com/api/1.1"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"인증방식은 JWT인증을 사용합니다. 토큰의 갱신은 없으며 토큰 만료 시 항상 재발급 받아야 합니다.\n"}}},"paths":{"/token":{"post":{"summary":"Access 토큰을 발급 요청합니다.\n","description":"Access 토큰을 발급 요청합니다.  \n\nRCS Biz Center 웹에서 가입 시 등록한 ID(마스터 또는 매니저, 대행사)와 계정 가입 시 자동 생성되는 API\nKey(RCS Biz Center 내 계정관리에서 확인)를 이용하여 토큰 발급을 요청합니다.  \n\nresponse로 전달되는 expiresIn 시간이 초과하면 토큰을 새로 발급 받아야 합니다.          \n\n  + **API 사용 Client의 IP는 RCS Biz Center에서 등록하여야 합니다. Client IP 등록은 내 계정관리에서 ID별 최대 10개까지 등록할 수 있습니다.**          \n  + **계정 권한 : 마스터, 매니저, 대행사**\n","requestBody":{"description":"required: true\n","content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","description":"RCS Biz Center에 계정 가입시 등록한 ID 입니다.\n","maxLength":20},"clientSecret":{"type":"string","description":"RCS Biz Center 내 계정관리 > 서비스 정보 : API Key 에서 확인 가능합니다.\n","maxLength":18}},"required":["clientId","clientSecret"]}}}},"responses":{"200":{"description":"페이지 내 Response 섹션 참조"}}}}}}
```

### ❖ request body sample

{% tabs %}
{% tab title="토큰발급요청" %}

```
{
  "clientId": "myMemberId",
  "clientSecret": "SK.atIs4g04r6PJepf"
}
```

{% endtab %}
{% endtabs %}

## Response

<table data-full-width="true"><thead><tr><th width="185">필드명</th><th width="154">타입</th><th width="85" align="center">길이</th><th width="113" align="center">필수여부</th><th width="84">기본값</th><th>설명</th></tr></thead><tbody><tr><td><code>accessToken</code></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td>엑세스토큰</td></tr><tr><td><code>expiresIn</code></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td>유효기간</td></tr></tbody></table>

### ❖ response body sample

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

```
{
    "expiresIn": "1717138601944",
    "accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWJBZ25jeUlkIjoiIiwiaXNTdWJBZ2VuY3kiOiJuIiwiZXhwaXJlRGF0ZSI6IjIwMjQtMDUtMzEgMTU6NTY6NDEiLCJ1c2VySWQiOiJzd2plb25nMzExNyIsImFsbG93SXAiOiIyMTEuMTY5LjE1My4xNzAiLCJjcmVhdGVEYXRlIjoiMjAyNC0wNS0zMSAxNDo1Njo0MSJ9.TPpsOjjA51Snw5p5r6kabWeYH73Gr2PXFENBIVR6ovI"
}
```

{% endtab %}

{% tab title="401" %}

```
{
    "error": {
        "code": "61006",
        "message": "Invalid secret key"
    },
    "status": 401
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
error code는 [RCS Biz Center - Response body error code](/rbc-api/error_code.md#rcs-biz-center-response-body-error-code) 참조
{% endhint %}


---

# 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://apidocs.rcsbizcenter.com/rbc-api/token.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.
