How to create own custom payload?

Hi there,

I am trying to display list of hyperlinks as bot response. For which I need to have a custom payload according to my need. So is there any way that I can implement it.

Hi @prashant_kamble, what front-end do you use? How links are rendered and their payloads sent depends on the channel.

Yeah thanks @erohmensing for your prompt reply. I managed to work it out. and it worked :blush: . I just created my custom json payload and uttered it through custom action using utter_custom_json method. And rendered it through my normal html front-end.

Below is the screenshot:

Capture1

Custom payload through custom action:

class ActionCustomPayloadOne(Action):

    def name(self) -> Text:
        return "action_custom_payload"

    def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        gt = {
            "type" : "Hyperlink",
            "level": "first_level",
            "title": "I am here to help you with the following services:",
            "links":[
                {
                    "payload":"Register to fly a drone or model aircraft",
                    "link_text": "Register for drones or model aircrafts"
                },
                {
                    "payload": "our roles",
                    "link_text": "Our roles"
                },
                {
                    "payload": "recreational unmanned aircraft",
                    "link_text": "Recreational unmanned aircraft"
                }
                ,
                {
                    "payload": "model aircraft",
                    "link_text": "Model aircraft"
                }
                 ,
                {
                    "payload": "commercial unmanned aircraft and drone operations",
                    "link_text": "Commercial unmanned aircraft and drone operations"
                }
                 ,
                {
                    "payload": "larger unmannned aircraft",
                    "link_text": "Larger unmannned aircraft"
                }
                 ,
                {
                    "payload": "information for public",
                    "link_text": "Information for public"
                }
                
            ]
        }
        print("Inside custom action payload")
        dispatcher.utter_custom_json(gt)

        return []

Hello,

Am also having difficulty with implementing a custom payload. I would like to display images with buttons and a small text description below the image. Please advise