Add a Persistent Menu

    Adds a persistent menu to be used in the client software.

    It is added as a button, for which you can set a message and uri as a callback type.

    By adding the postback parameter to a message using the button, the server can receive the message as a callback. For message types, refer to Receive Messages - Callback Type.

    The structure of a persistent menu is as follows:

    Note

    • You can add up to 4 buttons.
    • A new line character in text is substituted with a blank space.

    Caution

    • A persistent menu is deleted if rich menus are added.
    • A persistent menu cannot be added to a bot with rich menus added.

    API Type

    Server API

    Request URL

    https://apis.worksmobile.com/r/{API ID}/message/v1/bot/{botNo}/persistentmenu

    HTTP Method

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

    Path Parameters

    Parameter Required Description
    botNo Y Bot number for which you want to add a persistent menu.

    Request

    Parameter Type Required Description
    content object N Persistent menu to add (It is disabled if this parameter is not specified.)
    content.actions array<Action Object> Y Buttons to be added to the persistent menu.

    Request Example

    
    POST https://apis.worksmobile.com/r/apiid/message/v1/bot/123/persistentmenu
    
    {
        "content": {
            "actions": [{
                "type": "uri",
                "label": "WorksMobile's Homepage",
                "uri": "https://line.worksmobile.com"
            }, {
                "type": "message",
                "label": "FAQ",
                "postback": "PersistentMenu_FAQ"
            }]
        }
    }
    

    Response

    It returns HTTP status 200 with no response if successful.

    Error Code

    If the API call fails, it returns an error code and message.
    For error codes, refer to Message Bot REST API Error Codes.