POST/bots/{botId}/persistentmenu

클라이언트에서 사용할 메시지 고정 메뉴(persistent menu)를 등록한다.

버튼 형식으로 등록되며 callback type으로 message와 uri를 설정할 수 있다.

버튼을 이용해 메시지에 postback 파라미터를 추가하여 callback으로 서버에서 수신할 수 있다. 메시지 형식은 메시지 수신 - Callback 형태를 참고한다.

고정 메뉴의 구조는 다음과 같다.

참고

  • 버튼은 최대 4개까지 등록할 수 있다.
  • 텍스트 항목에 개행 문자를 입력하면 공백으로 치환된다.

주의

  • 리치 메뉴를 등록하면 등록된 고정 메뉴는 삭제된다.
  • 리치 메뉴가 등록된 봇에는 고정 메뉴 등록이 제한된다.

Authorization

oauth2

OAuth 2.0 인증.
자세한 인증 방식은 인가·인증을 참고한다.

Scope

bot.message
bot

HTTP Request

POSThttps://www.worksapis.com/v1.0/bots/{botId}/persistentmenu

Path Parameters

ParameterTypeDescription
botId integer 

봇 ID


required
example : 2000001
format : int64 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
content object (content) 

설정할 고정 메뉴


required 

content

PropertyTypeDescription
actions array (PersistentMenuActionStruct) 

고정 메뉴에 추가할 버튼 목록


required
maxItems : 4 

PersistentMenuActionStruct

PropertyTypeDescription
type string 

Action 종류


required
Allowed values : message, uri, copy 
label string 

항목에 표시되는 레이블.
리치 메뉴와 캐러셀의 'defaultAction' 항목을 제외하고 필숫값이다.
리치 메뉴는 값을 지정하지 않으면 데스크톱 환경에서 기본 메시지가 출력된다.

  • 이미지 캐러셀 최대 글자 수: 12자
  • 고정 메뉴 최대 글자 수: 1000자
  • 위 항목 이외 최대 문자 수: 20자
 
postback string 

message.postback 속성으로 반환되는 문자열


maxLength : 1000 
text string 

항목을 누르면 전송되는 텍스트. 캐러셀, 이미지 캐러셀, 리치 메뉴, 빠른 답장에서 필숫값으로 사용되며, 버튼 템플릿, 리스트 템플릿, 고정 메뉴에서는 label로 대체된다.


maxLength : 300 
uri string 

항목을 누르면 열리는 URI. 'http', 'https' 스키마를 지원한다.


maxLength : 1000 
copyText string 

항목을 누르면 클립보드에 복사되는 문자열


maxLength : 1000 
i18nLabels array (i18nLabels) 

다국어 레이블 목록


minItems : 0 
i18nTexts array (i18nTexts) 

항목을 누를 때 전송되는 텍스트 목록


minItems : 0 

i18nLabels

PropertyTypeDescription
language string 

다국어 언어 코드


required
Allowed values : ko_KR, ja_JP, en_US, zh_CN, zh_TW 
label string 

항목에 표시되는 레이블

  • 이미지 캐러셀 최대 글자 수: 12자
  • 고정 메뉴 최대 글자 수: 1000자
  • 위 항목 이외 최대 문자 수: 20자

required 

i18nTexts

PropertyTypeDescription
language string 

다국어 언어 코드


required
Allowed values : ko_KR, ja_JP, en_US, zh_CN, zh_TW 
text string 

항목을 누를 때 전송되는 텍스트. 캐러셀, 이미지 캐러셀, 리치 메뉴, 빠른 답장에서 필숫값으로 사용되며, 버튼 템플릿, 리스트 템플릿, 고정 메뉴에서는 label로 대체된다.


required
maxLength : 300 

Request Example

example

1{2  "content": {3    "actions": [4      {5        "type": "message",6        "label": "Example label",7        "text": "Example text",8        "postback": "Example postback",9        "i18nLabels": [10          {11            "language": "en_US",12            "label": "Example label"13          }14        ],15        "i18nTexts": [16          {17            "language": "en_US",18            "text": "Example text"19          }20        ]21      },22      {23        "type": "uri",24        "label": "Example Homepage",25        "uri": "https://example.com",26        "i18nLabels": [27          {28            "language": "en_US",29            "label": "Example label"30          }31        ]32      }33    ]34  }35}

Response

HTTP 201

OK

PropertyTypeDescription
content object (content) 

설정할 고정 메뉴


required 

content

PropertyTypeDescription
actions array (PersistentMenuActionStruct) 

고정 메뉴에 추가할 버튼 목록


required
maxItems : 4 

PersistentMenuActionStruct

PropertyTypeDescription
type string 

Action 종류


required
Allowed values : message, uri, copy 
label string 

항목에 표시되는 레이블.
리치 메뉴와 캐러셀의 'defaultAction' 항목을 제외하고 필숫값이다.
리치 메뉴는 값을 지정하지 않으면 데스크톱 환경에서 기본 메시지가 출력된다.

  • 이미지 캐러셀 최대 글자 수: 12자
  • 고정 메뉴 최대 글자 수: 1000자
  • 위 항목 이외 최대 문자 수: 20자
 
postback string 

message.postback 속성으로 반환되는 문자열


maxLength : 1000 
text string 

항목을 누르면 전송되는 텍스트. 캐러셀, 이미지 캐러셀, 리치 메뉴, 빠른 답장에서 필숫값으로 사용되며, 버튼 템플릿, 리스트 템플릿, 고정 메뉴에서는 label로 대체된다.


maxLength : 300 
uri string 

항목을 누르면 열리는 URI. 'http', 'https' 스키마를 지원한다.


maxLength : 1000 
copyText string 

항목을 누르면 클립보드에 복사되는 문자열


maxLength : 1000 
i18nLabels array (i18nLabels) 

다국어 레이블 목록


minItems : 0 
i18nTexts array (i18nTexts) 

항목을 누를 때 전송되는 텍스트 목록


minItems : 0 

i18nLabels

PropertyTypeDescription
language string 

다국어 언어 코드


required
Allowed values : ko_KR, ja_JP, en_US, zh_CN, zh_TW 
label string 

항목에 표시되는 레이블

  • 이미지 캐러셀 최대 글자 수: 12자
  • 고정 메뉴 최대 글자 수: 1000자
  • 위 항목 이외 최대 문자 수: 20자

required 

i18nTexts

PropertyTypeDescription
language string 

다국어 언어 코드


required
Allowed values : ko_KR, ja_JP, en_US, zh_CN, zh_TW 
text string 

항목을 누를 때 전송되는 텍스트. 캐러셀, 이미지 캐러셀, 리치 메뉴, 빠른 답장에서 필숫값으로 사용되며, 버튼 템플릿, 리스트 템플릿, 고정 메뉴에서는 label로 대체된다.


required
maxLength : 300 

Response Example

example

1{2  "content": {3    "actions": [4      {5        "type": "message",6        "label": "Example label",7        "text": "Example text",8        "postback": "Example postback",9        "i18nLabels": [10          {11            "language": "en_US",12            "label": "Example label"13          }14        ],15        "i18nTexts": [16          {17            "language": "en_US",18            "text": "Example text"19          }20        ]21      },22      {23        "type": "uri",24        "label": "Example Homepage",25        "uri": "https://example.com",26        "i18nLabels": [27          {28            "language": "en_US",29            "label": "Example label"30          }31        ]32      }33    ]34  }35}