> For the complete documentation index, see [llms.txt](https://apidocs.rcsbizcenter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.rcsbizcenter.com/rbc-api/bidirect_chatbot/post_bidirect_chatbot_pmenu.md).

# 대화방 메뉴 등록

## Request

## 대화방에 대화방메뉴를 등록합니다.<br>

> 대화방에 대화방메뉴를 등록합니다.\
> \
> 대화방 메뉴 개편으로 상위 메뉴, 하위 메뉴 구분 없이 최대 5개까지 메뉴를 지정할 수 있습니다.    \
> \
> 대화방 메뉴 등록 시 대화방메뉴 정보는 등록하지만 대화방에서의 사용여부를 미사용으로 설정할 수 있습니다.  \
> \
> ※  대표번호 문자서비스가 설정된 대화방에는 대화방메뉴를 등록할 수 없습니다. 즉, rcsReply 값이 1인 대화방에만 대화방메뉴를 설정할 수 있습니다.\
> \
> &#x20; \+ \*\*계정 권한 : 마스터, 매니저, 대행사\*\*  \
> &#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"}},"parameters":{"BrandKey":{"name":"X-RCS-Brandkey","in":"header","schema":{"type":"string","maxLength":18},"description":"maxLength: 18 - RCS Biz Center에서 브랜드 등록 시 자동 생성되는 Key 입니다.  \n\n대행사가 해당 브랜드에 대한 권한 여부를 판단하는데 사용됩니다.\n따라서, 대행사 계정으로 브랜드 내 정보를 조회/등록/수정 API 연동 시 Header에 설정되어야 합니다.\n"},"BrandId":{"name":"brandId","in":"path","schema":{"type":"string","maxLength":13},"required":true,"description":"maxLength: 13 - 브랜드 내 정보 접근시 사용되는 브랜드ID Path Parameter 입니다.\n"},"ChatbotId":{"name":"chatbotId","in":"path","description":"브랜드 내 대화방 정보 접근시 사용되는 대화방ID Path Parameter 입니다.\n","schema":{"type":"string"},"required":true}},"schemas":{"RegPersistentMenu":{"type":"object","properties":{"menu":{"type":"array","items":{"$ref":"#/components/schemas/RegPersistentMenu_L1"}}}},"RegPersistentMenu_L1":{"description":"대화방메뉴 버튼 정보입니다.","type":"object","properties":{"type":{"type":"string","description":"대화방 메뉴를 구성하는 메뉴 버튼의 유형입니다.\n\n  - reply : 응답 메뉴 버튼(챗봇응답 or 자동메시지)\n  - feed : 브랜드 소식 연결 버튼\n  - action : RCS 액션 지정 버튼 \n","enum":["reply","feed","action"]},"title":{"type":"string","description":"maxLength: 25 - 메뉴버튼에 표시되는 메뉴명입니다.\n","maxLength":25},"ordNo":{"type":"number","description":"메뉴버튼 순서 값입니다.\n"},"autoReplyMsgId":{"type":"string","description":"type이 'reply' 인 경우, 자동응답메시지 ID 지정 시 자동응답메시지가 할당됩니다. 자동응답메시지 ID를 지정하지 않은 경우에는 챗봇응답으로 할당됩니다.\n"},"feedId":{"type":"string","description":"type이 'feed' 인 경우, 브랜드 소식 ID 지정 시 해당 소식이 연결됩니다.  \n"},"actionType":{"type":"string","description":"type이 'action'인 경우, 사용할 RCS 액션 유형을 지정합니다.  \n\n  - dialerAction : 전화연결  \n  - urlAction : 웹사이트 연결\n","enum":["dialerAction","urlAction"]},"action":{"type":"object","oneOf":[{"$ref":"#/components/schemas/urlAction"},{"$ref":"#/components/schemas/dialerAction"}]}},"required":["type","title","ordNo"]},"urlAction":{"description":"Suggested actions to interact a website or deep app link.","properties":{"urlAction":{"type":"object","oneOf":[{"properties":{"openUrl":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}},"required":["openUrl"]}]}},"required":["urlAction"]},"dialerAction":{"description":"Suggested actions for interacting with a phone number.","properties":{"dialerAction":{"type":"object","oneOf":[{"properties":{"dialPhoneNumber":{"type":"object","properties":{"phoneNumber":{"type":"string"},"fallbackUrl":{"type":"string","format":"uri"}},"required":["phoneNumber"]}},"required":["dialPhoneNumber"]}]}},"required":["dialerAction"]}}},"paths":{"/brand/{brandId}/bidirectional/chatbot/{chatbotId}/persistentmenu":{"post":{"summary":"대화방에 대화방메뉴를 등록합니다.\n","description":"대화방에 대화방메뉴를 등록합니다.\n\n대화방 메뉴 개편으로 상위 메뉴, 하위 메뉴 구분 없이 최대 5개까지 메뉴를 지정할 수 있습니다.    \n\n대화방 메뉴 등록 시 대화방메뉴 정보는 등록하지만 대화방에서의 사용여부를 미사용으로 설정할 수 있습니다.  \n\n※  대표번호 문자서비스가 설정된 대화방에는 대화방메뉴를 등록할 수 없습니다. 즉, rcsReply 값이 1인 대화방에만 대화방메뉴를 설정할 수 있습니다.\n\n  + **계정 권한 : 마스터, 매니저, 대행사**  \n  + **브랜드 권한 : 브랜드 대표운영자, 운영자**\n","parameters":[{"$ref":"#/components/parameters/BrandKey"},{"$ref":"#/components/parameters/BrandId"},{"$ref":"#/components/parameters/ChatbotId"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"psMenuUse":{"type":"boolean","description":"대화방메뉴 사용 여부입니다.  \n\n  + true : 사용  \n  + false : 미사용\n","default":true},"persistentMenu":{"$ref":"#/components/schemas/RegPersistentMenu"}}}}}},"responses":{"200":{"description":"페이지 내 Response 섹션 참조"}}}}}}
```

### ❖ request body sample

{% tabs %}
{% tab title="양방향대화방메뉴" %}

```
{
    "psMenuUse": false,
    "persistentMenu": {
        "menu": [
            {
                "type": "action",
                "title": "119연락",
                "ordNo": 0,
                "actionType": "dialerAction",
                "action": {
                    "dialerAction": {
                        "dialPhoneNumber": {
                            "phoneNumber": "119"
                        }
                    }
                }
            },
            {
                "ordNo": "1",
                "title": "API버튼1",
                "type": "feed",
                "feedId": "BR.vt0HGdJXG0.cUmR1s689n"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## Response

<table data-full-width="true"><thead><tr><th width="147">필드명</th><th width="141">타입</th><th width="68" align="center">길이</th><th width="108" align="center">필수여부</th><th width="120">기본값</th><th>설명</th></tr></thead><tbody><tr><td><a href="#result-array-less-than-object-greater-than"><mark style="color:blue;"><strong><code>result</code></strong></mark></a></td><td>array&#x3C;object></td><td align="center"></td><td align="center">O</td><td></td><td>대화방메뉴 버튼 정보입니다.</td></tr><tr><td><strong><code>code</code></strong></td><td>string</td><td align="center">5</td><td align="center">O</td><td>20000000</td><td></td></tr><tr><td><strong><code>status</code></strong></td><td>integer</td><td align="center">3</td><td align="center">O</td><td>200</td><td></td></tr><tr><td><strong><code>desc</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td></td></tr></tbody></table>

### <mark style="color:blue;">**`result`**</mark> - array\<object>

<table data-full-width="true"><thead><tr><th width="192">필드명</th><th width="141">타입</th><th width="68" align="center">길이</th><th width="108" align="center">필수여부</th><th width="120">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>type</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td><p>대화방 메뉴를 구성하는 메뉴 버튼의 유형입니다.</p><ul><li>reply : 응답 메뉴 버튼(챗봇응답 or 자동메시지)</li><li>feed : 브랜드 소식 연결 버튼</li><li>action : RCS 액션 지정 버튼</li></ul></td></tr><tr><td><strong><code>title</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td>메뉴버튼에 표시되는 메뉴명입니다.</td></tr><tr><td><strong><code>ordNo</code></strong></td><td>number</td><td align="center"></td><td align="center">O</td><td></td><td>메뉴버튼 순서 값입니다.</td></tr><tr><td><strong><code>autoReplyMsgId</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td>type이 'reply' 인 경우, 자동응답메시지 ID 지정 시 자동응답메시지가 할당됩니다. 자동응답메시지 ID를 지정하지 않은 경우에는 챗봇응답으로 할당됩니다.</td></tr><tr><td><strong><code>feedId</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td>type이 'feed' 인 경우, 브랜드 소식 ID 지정 시 해당 소식이 연결됩니다.</td></tr><tr><td><strong><code>actionType</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td><p>type이 'action'인 경우, 사용할 RCS 액션 유형을 지정합니다.</p><ul><li>dialerAction : 전화연결</li><li>urlAction : 웹사이트 연결</li></ul></td></tr><tr><td><strong><code>action</code></strong></td><td>object</td><td align="center"></td><td align="center"></td><td></td><td></td></tr></tbody></table>

{% hint style="info" %}
[**버튼 Action 목록 Link (2023.12.14)**](https://file.rcsbizcenter.com/231214143124234/TS-231214143124234-fVDQnA_1.xlsx)
{% endhint %}

### ❖ response body sample

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

```
{
    "code": "20000000",
    "desc": null,
    "result": [
        {
            "postbackId": "P7r9Gr5W0XM6RyQ",
            "upPostbackId": "",
            "type": "action",
            "title": "119연락",
            "ordNo": "10",
            "autoReplyMsgId": "",
            "actionType": "dialerAction",
            "action": {
                "dialerAction": {
                    "dialPhoneNumber": {
                        "phoneNumber": "119"
                    }
                }
            },
            "chatbotId": "07082245290",
            "armIdName": null
        }, 
        {
            "postbackId": "PObF8R4XtopwoW2",
            "upPostbackId": "",
            "type": "feed",
            "title": "API버튼1",
            "ordNo": "20",
            "autoReplyMsgId": "",
            "actionType": "urlAction",
            "action": {
                "urlAction": {
                    "openUrl": {
                        "url": "https://biz-qa.chatplus.co.kr/brand/BR.vt0HGdJXG0/feed/BR.vt0HGdJXG0.cUmR1s689n"
                    }
                }
            },
            "chatbotId": "07082245290",
            "armIdName": null
        }
    ],
    "status": 200
}
```

{% endtab %}

{% tab title="400" %}

```
{
    "error": {
        "code": "64002",
        "message": "Invalid Brand Key"
    },
    "status": 400
}
```

{% endtab %}

{% tab title="401" %}

```
{
    "error": {
        "code": "61003",
        "message": "Invalid token"
    },
    "status": 401
}
```

{% endtab %}

{% tab title="403" %}

```
{
    "error": {
        "code": "63001",
        "message": "No Brand Permission"
    },
    "status": 403
}
```

{% 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 %}
