All pages
Powered by GitBook
1 of 1

Loading...

Suggested Action

SMS, LMS, MMS 등에서 사용가능한 button/Chip 버튼에서의 suggested Action 예제입니다.

버튼은 위에서 아래로, 좌에서 우로 순서대로 작성합니다.

카드별, 컴포넌트 단위별로 묶을 수 있습니다.

Action 예제

    "action": {
        "urlAction": {
            "openUrl": {
                "url": "https://www.google.com"
            }
        },
        "displayText": "버튼명",    
        "postback": {
            "data": "set_by_chatbot_open_url"
        }
    }
}
{
    "action": {
        "dialerAction": {
            "dialPhoneNumber": {
                "phoneNumber": "+1650253000"
            }
        },
        "displayText": "버튼명",
        "postback": {
            "data": "set_by_chatbot_dial_phone_number"
        }
    }
}
{
    "action": {
        "composeAction": {
          "composeTextMessage": {
            "phoneNumber": "0212341234",
            "text": "가나다라마바가나다라마바사"
           }
        },
        "displayText": "버튼명",
        "postback": {
            "data": "set_by_chatbot_compose_text_message"
        }
    }
}
{
    "action": {
        "calendarAction": {
            "createCalendarEvent": {
                "startTime": "2017-03-14T00:00:00Z",
                "endTime": "2017-03-14T23:59:59Z",
                "title": "Meeting",
                "description": "GSG review meeting"
            }
        },
        "displayText": "버튼명",
        "postback": {
            "data": "set_by_chatbot_create_calendar_event"
        }
    }
}
{
    "action": {
        "mapAction": {
            "showLocation": {
                "location": {
                    "latitude": 37.4220041,
                    "longitude": -122.0862515,
                    "label": "Googleplex"
                },
                "fallbackUrl": "https://www.google.com/maps/@37.4219162,-122.078063,15z"
            }
        },
        "displayText": "Show location on a map",
        "postback": {
            "data": "set_by_chatbot_show_location"
        }
    }
}
{
    "action": {
        "mapAction": {
            "showLocation": {
                "location": {
                    "query": "restaurants"
                },
                "fallbackUrl": "https://www.google.com/maps/search/restaurants"
            }
        },
        "displayText": "Search location(s) on map",
        "postback": {
            "data": "set_by_chatbot_search_locations"
        }
    }
}
{
    "action": {
        "mapAction": {
            "requestLocationPush": {}
        },
        "displayText": "Request a geo location",
        "postback": {
            "data": "set_by_chatbot_request_location_push"
        }
    }
}

sample code

3개의 버튼 컴포넌트(또는 3장의 Carousle 카드)를 사용하는 메시지, 가운데 버튼 컴포넌트(또는 2번째 카드)를 사용하지 않는 경우


{
    “body” : {
       
    },
    “buttons” : [
        {
            “suggestions” : [
                {
                    “action” : {
                        “urlAction” : {
                            “openUrl” : {
                                “url” : “https://rcsbizcenter.com”
                            }
                        },
                    “displayText” : “버튼 컴포넌트1의 1번 버튼”,
                    "postback" : {
                        "data" : "set_group id 반응 통계 수집 기준입니다. 캠페인별로 구분하여 정의하세요."
                        }
                    }
                },
                { },
                {
                    “action” : {
                        “urlAction” : {
                            “openUrl” : {
                                “url” : “https://rcsbizcenter.com”
                            }
                        },
                    “displayText” : “버튼 컴포넌트3의 1번 버튼”,
                    "postback" : {
                        "data" : "set_group id 반응 통계 수집 기준입니다. 캠페인별로 구분하여 정의하세요.""
                        }
                    }
                }
               
            ]
        }
        ]
}