POST/bots/{botId}/richmenus

봇의 리치 메뉴를 생성한다.

  • 하나의 봇에 최대 1000개의 리치 메뉴를 등록할 수 있다.
  • 각 동작(action)의 label 항목은 데스크톱 환경에서 사용된다. 만약 지정하지 않으면 기본 문구가 표시된다.

생성한 리치 메뉴를 사용하는 순서는 아래와 같다.

  1. 리치 메뉴로 사용할 이미지 업로드
  2. 업로드된 이미지를 리치 메뉴에 설정
  3. 기본 리치 메뉴를 설정하거나 사용자별 리치 메뉴 설정
  • 기본 리치 메뉴는 봇 수정 또는 봇 부분 수정의 defaultRichMenuId로도 지정할 수 있다.

Authorization

oauth2

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

Scope

bot.message
bot

HTTP Request

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

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
richmenuName string 

리치 메뉴의 이름. 리치 메뉴 관리에 사용되며 사용자에게는 표시되지 않는다.


required
maxLength : 300 
areas array (RichmenuArea) 

리치 메뉴 동작을 설정하는 영역 목록


required
minItems : 1
maxItems : 20 
size object (size) 

봇 리치 메뉴의 크기 객체


required 

RichmenuArea

PropertyTypeDescription
action object (action) 

영역을 눌렀을 때 동작


required 
bounds object (bounds) 

리치 메뉴 버튼의 범위 객체


required 

action

PropertyTypeDescription
type string 

Action 종류


required
Allowed values : postback, message, uri, copy 
label string 

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

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

postback.data 속성의 callback으로 반환되는 문자열


maxLength : 300 
displayText string 

사용자가 보낸 메시지로 채팅에 표시되는 텍스트. 입력하지 않으면 텍스트가 표시되지 않는다.
단, 빠른 답장에서는 필숫값이다.


maxLength : 300 
postback string 

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


maxLength : 1000 
text string 

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


maxLength : 300 
uri string 

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


maxLength : 1000 
copyText string 

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


maxLength : 1000 
i18nDisplayTexts array (i18nDisplayTexts) 

다국어 디스플레이 텍스트 목록


minItems : 0 
i18nLabels array (i18nLabels) 

다국어 레이블 목록


minItems : 0 
i18nTexts array (i18nTexts) 

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


minItems : 0 

i18nDisplayTexts

PropertyTypeDescription
language string 

다국어 언어 코드


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

사용자가 보낸 메시지로 채팅에 표시되는 텍스트


required
maxLength : 300 

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 

bounds

PropertyTypeDescription
x integer 

영역 왼쪽으로부터의 수평 위치


required
minimum : 0
maximum : 2500
format : int64 
y integer 

영역 위쪽으로부터의 수직 위치


required
minimum : 0
maximum : 1686
format : int64 
width integer 

영역의 너비


required
minimum : 0
maximum : 2500
format : int64 
height integer 

영역의 높이


required
minimum : 0
maximum : 1686
format : int64 

size

PropertyTypeDescription
width integer 

리치 메뉴의 너비


required
Allowed values : 2500
format : int64 
height integer 

리치 메뉴의 높이


required
Allowed values : 843, 1686
format : int64 

Request Example

example

1{2  "richmenuName": "Example Richmenu",3  "areas": [4    {5      "action": {6        "type": "postback",7        "label": "Example label",8        "data": "Example data",9        "displayText": "Example displayText",10        "i18nDisplayTexts": [11          {12            "language": "en_US",13            "displayText": "Example display text"14          }15        ],16        "i18nLabels": [17          {18            "language": "en_US",19            "label": "Example label"20          }21        ]22      },23      "bounds": {24        "x": 0,25        "y": 0,26        "width": 2500,27        "height": 84328      }29    }30  ],31  "size": {32    "width": 2500,33    "height": 84334  }35}

Response

HTTP 201

OK

PropertyTypeDescription
richmenuId string 

리치 메뉴의 ID


readOnly : true 
richmenuName string 

리치 메뉴의 이름. 리치 메뉴 관리에 사용되며 사용자에게는 표시되지 않는다.


required
maxLength : 300 
areas array (RichmenuArea) 

리치 메뉴 동작을 설정하는 영역 목록


required
minItems : 1
maxItems : 20 
size object (size) 

봇 리치 메뉴의 크기 객체


required 

RichmenuArea

PropertyTypeDescription
action object (action) 

영역을 눌렀을 때 동작


required 
bounds object (bounds) 

리치 메뉴 버튼의 범위 객체


required 

action

PropertyTypeDescription
type string 

Action 종류


required
Allowed values : postback, message, uri, copy 
label string 

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

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

postback.data 속성의 callback으로 반환되는 문자열


maxLength : 300 
displayText string 

사용자가 보낸 메시지로 채팅에 표시되는 텍스트. 입력하지 않으면 텍스트가 표시되지 않는다.
단, 빠른 답장에서는 필숫값이다.


maxLength : 300 
postback string 

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


maxLength : 1000 
text string 

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


maxLength : 300 
uri string 

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


maxLength : 1000 
copyText string 

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


maxLength : 1000 
i18nDisplayTexts array (i18nDisplayTexts) 

다국어 디스플레이 텍스트 목록


minItems : 0 
i18nLabels array (i18nLabels) 

다국어 레이블 목록


minItems : 0 
i18nTexts array (i18nTexts) 

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


minItems : 0 

i18nDisplayTexts

PropertyTypeDescription
language string 

다국어 언어 코드


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

사용자가 보낸 메시지로 채팅에 표시되는 텍스트


required
maxLength : 300 

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 

bounds

PropertyTypeDescription
x integer 

영역 왼쪽으로부터의 수평 위치


required
minimum : 0
maximum : 2500
format : int64 
y integer 

영역 위쪽으로부터의 수직 위치


required
minimum : 0
maximum : 1686
format : int64 
width integer 

영역의 너비


required
minimum : 0
maximum : 2500
format : int64 
height integer 

영역의 높이


required
minimum : 0
maximum : 1686
format : int64 

size

PropertyTypeDescription
width integer 

리치 메뉴의 너비


required
Allowed values : 2500
format : int64 
height integer 

리치 메뉴의 높이


required
Allowed values : 843, 1686
format : int64 

Response Example

example

1{2  "richmenuId": "40001",3  "richmenuName": "Example Richmenu",4  "areas": [5    {6      "action": {7        "type": "postback",8        "label": "Example label",9        "data": "Example data",10        "displayText": "Example displayText",11        "i18nDisplayTexts": [12          {13            "language": "en_US",14            "displayText": "Example display text"15          }16        ],17        "i18nLabels": [18          {19            "language": "en_US",20            "label": "Example label"21          }22        ]23      },24      "bounds": {25        "x": 0,26        "y": 0,27        "width": 2500,28        "height": 84329      }30    }31  ],32  "size": {33    "width": 2500,34    "height": 84335  }36}