fbbotw.post_list_template

fbbotw.post_list_template(fbid, elements, buttons=None, top_element_style=’large’, sharable=True, messaging_type=’RESPONSE’, tag=None)[source]

Sends a list template for the specified User

Parameters:
  • fbid (str) – User id to send the list template.
  • top_element_style (str) – large/compact (Default ‘large’).
  • elements (list) –

    List view elements (Max 4/Min 2 elements), format :

    >>> elements = [{
        ‘title’: ‘Classic Gray T-Shirt’,
        ‘image_url’: ‘https://app.ngrok.io/img/gray-t-shirt.png’,
        ‘subtitle’: ‘100% Cotton, 200% Comfortable’,
        ‘default_action’: {
            ‘type’: ‘web_url’,
            ‘url’: ‘https://app.ngrok.io/view?item=103’,
            ‘messenger_extensions’: true,
            ‘webview_height_ratio’: ‘tall’,
            ‘fallback_url’: ‘https://peterssendreceiveapp.ngrok.io/’
        },
        ‘buttons’: [
            {
                ‘title’: ‘Buy’,
                ‘type’: ‘web_url’,
                ‘url’: ‘https://app.ngrok.io/shop?item=103’,
                ‘messenger_extensions’: true,
                ‘webview_height_ratio’: ‘tall’,
                ‘fallback_url’: ‘https://app.ngrok.io/’
            }
        ]
    }]
    
  • buttons (list) –

    List of buttons associated on the list template message (Max 1). format :

    >>> buttons = [
        {
            ‘title’: ‘View More’,
            ‘type’: ‘postback’,
            ‘payload’: ‘payload’
        }
    ]
    
  • sharable (bool) – Able/Disable native share button in Messenger for the template message (Default: True).
  • messaging_type (str) – Identifies the message type from: RESPONSE, UPDATE AND MESSAGE_TAG (Default: RESPONSE, if MESSAGE_TAG, tag param is required)
  • tag (str) – Tag classifying the message, must be one of the following tags
Returns:

Response object

Facebook docs:

/list-template