getPersistentMenu
    • PDF

    getPersistentMenu

    • PDF

    Article summary

    Available in Classic and VPC

    Get the list of persistent menus for a chatbot.

    Note

    The following three types of response components are available for chatbot answers.

    Request

    The following describes the request format for the endpoint. The request format is as follows:

    MethodURI
    POSTAPI Gateway's unique invoke URL created in CLOVA Chatbot Builder

    Request headers

    For headers common to all CLOVA Chatbot Custom APIs, see Common CLOVA Chatbot Custom API headers.

    Request body

    The following describes the request body.

    • If persistent menus are enabled in the console, the PersistentMenu component will respond to the persistMenu field when requested, even if no local cache exists.
    FieldTypeRequiredDescription
    versionStringOptionalChatbot version
    • v1 | v2 (default)
      • Set to v1 when not entered
    userIdStringRequiredUnique chatbot user ID
    • Any input up to 256 characters
    userIpStringOptionalUser IP address
    timestampLongRequiredArbitrary timestamp value (timestamp)
    bubblesArrayRequiredSet to an empty array value
    • <e.g.> []
    eventStringRequiredEvent value
    • Set to getPersistentMenu

    Request example

    The following is a sample request.

    {
    "version": "v2",
    "userId": "{userId}",
    "userIp": "{userIp}",
    "timestamp": 12345678,
    "bubbles": [],
    "event": "getPersistentMenu"
    }
    

    Response

    The following describes the response format.

    Response body

    The following describes the response body.

    FieldTypeRequiredDescription
    versionStringOptionalChatbot version
    userIdStringRequiredUnique chatbot user ID
    • Same as the value set on request
    timestampLongRequiredTimestamp value (timestamp)
    bubblesArrayOptionalEmpty array value
    • <e.g.> []
    entitiesArrayOptionalChatbot entity analysis results that matched the user's query
    persistentMenuObjectOptionalPersistent menu configuration information
    persistentMenu.typeStringConditionalPersistent menu type
    persistentMenu.titleStringConditionalFixed menu name
    persistentMenu.dataObjectConditionalPersistent menu configuration information
    persistentMenu.data.contentTableArrayConditionalcontentTable details
    keywordsArrayOptionalkeywords details
    • exactMatch | contain
      • exactMatch: User input matches keywords exactly
      • contain: User input contains keywords
    conversationObjectOptionalConversation information
    conversation.scenarioNameStringConditionalScenario name
    conversation.chatUtteranceSetIdStringConditionalConversation utterance ID
    conversation.typesArrayConditionalConversation type
    slotNormalizerObject<Array>OptionalSystem entity that matched the user's query
    • Date, Time, People, Name
    normalizerStringOptionalSystem entity that matched the user's query
    eventStringRequiredEvent value

    contentTable

    The following describes persistentMenu.data.contentTable.

    FieldTypeRequiredDescription
    rowSpanIntegerRequiredNumber of rows occupied by cells in the table (span)
    colSpanIntegerRequiredNumber of columns occupied by cells in the table (span)
    dataObjectRequiredComponent configuration information
    data.typeStringRequiredComponent type
    data.titleStringOptionalComponent name
    data.subTitleStringOptionalSubcomponent name
    data.dataObjectOptionalSubcomponent configuration information
    data.data.typeStringRequiredSubcomponent type
    data.data.iconUrlStringOptionalIcon URL address
    data.data.actionObjectOptionalComponent action information
    data.data.action.typeStringConditionalComponent action type
    data.data.action.dataObjectConditionalComponent action details
    data.data.action.data.utteranceIdLongRequiredUtterance ID
    data.data.action.data.textStringRequiredText that appears as user input in the chat
    data.data.action.data.postbackStringRequiredPostback text to send to the chatbot

    keywords

    The following describes keywords.

    FieldTypeRequiredDescription
    keywordStringConditionalKeywords
    groupStringConditionalKeyword group
    typeStringConditionalKeyword type

    Response status codes

    For response status codes common to all CLOVA Chatbot Custom APIs, see Common CLOVA Chatbot Custom API response status codes.

    Response example

    The following is a sample example.

    {
      "version": "v2",
      "userId": "{userId}",
      "timestamp": 1665041597003,
      "bubbles": [],
      "persistentMenu": {
        "type": "template",
        "title": "3by2",
        "data": {
          "contentTable": [
            [
              {
                "rowSpan": 1,
                "colSpan": 1,
                "data": {
                  "type": "button",
                  "title": "",
                  "subTitle": "",
                  "data": {
                    "type": "imageButton",
                    "iconUrl": "https://clovachatbot.ncloud.com/i48103278ci6f6-9f51-4d08-a947-1c8acc992629",
                    "action": {
                      "type": "link",
                      "data": {
                        "url": "https://ncloud.com",
                        "mobileUrl": "https://ncloud.com"
                      }
                    }
                  }
                }
              }
            ]
          ]
        }
      },
      "keywords": [],
      "conversation": {
        "scenarioName": null,
        "chatUtteranceSetId": null,
        "types": []
      },
      "slotNormalizer": {},
      "normalizer": "",
      "event": "send"
    }
    

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.