This API will soon be deprecated. Please use another API.

    Add a PersistentMenu

    Adds a message PersistentMenu to be used by the client.

    It is added as a button form, for which either a link or a postback can be set.

    For the postback type that the server can receive as a callback, refer to Receive Messages - Callback Type.

    Note

    • You can add up to 4 buttons.
    • A new line character in text is substituted with a blank space.
    • PersistentMenu is available in the client version 2.2 or later.

    API Type

    Server API

    Request URL

    https://apis.worksmobile.com/{API ID}/message/setPersistentMenu

    HTTP Method

    POST(Content-Type: application/json; charset=UTF-8)

    Request

    Parameter Type Required Description
    botNo number Y Message bot number for which you want to add a PersistentMenu
    content object N PersistentMenu to add (PersistentMenu is disabled if this parameter is not specified.)
    content.buttons array<object> Y Buttons to be added to the PersistentMenu
    content.buttons[].text string Y Text to be displayed on the button
    Max: 1000 characters
    content.buttons[].i18nTexts[] array N Multilingual button text list
    content.buttons[].i18nTexts[].language string Y Language code
    ●ko_KR
    ●ja_JP
    ●zh_CN
    ●zh_TW
    ●en_US
    content.buttons[].i18nTexts[].text string Y Button text in the language
    Max: 1000 characters
    content.buttons[].link string N Link to go to when the button is clicked. (Either a link or a postback must be specified.)
    Max: 1000 characters
    content.buttons[].postback string N Postback to be passed as a callback when the button is clicked. (Either a link or a postback must be specified.)
    Max: 1000 characters

    Request Example - Register/Modify

    메시지 PersistentMenu 등록 예시

    {
        "botNo": 123,
        "content": {
            "buttons": [{
                "text": "WorksMobile's Homepage",
                "link": "https://line.worksmobile.com"
            }, {
                "text": "FAQ",
                "postback": "PersistentMenu_FAQ"
            }]
        }
    }
    

    Request Example - Remove

    {
        "botNo": 123
    }
    

    Response

    It returns code 200 when the API call is successful.

    Property Type Description
    code number ● 200: Success
    ● 4xx: Client request errors
    ● 5xx: Unexpected errors and server internal errors
    message string Description about the code

    Response Example

    {"code": 200, "message": "OK"}