Sending a Video

Post Data AttributePost Data Attribute Value TypeDescriptionRequired
channel_idStringChannel ID by which the message template would be sent.Yes
contact_idStringFacebook and Instagram don't have phone number so you need to send the contact id. Contact id can be received from the webhooks or contacts api.NO
facebook_psidStringFacebook and Instagram don't have phone number so you need to send the contact id. Contact id can be received from the webhooks or contacts api.NO
instagram_psidStringFacebook and Instagram don't have phone number so you need to send the contact id. Contact id can be received from the webhooks or contacts api.

Either of contact_id/facebook_psid/instagram_psid is mandatory
NO
facebook_payloadJSONA JSON compatible with facebook official API documentation https://developers.facebook.com/docs/messenger-platform/instagram/features/generic-templateYes
curl --location --request POST '<baseAPIURl>/api/messages/send' \
--header 'X-API-Key: <API KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "channel_id": "<Channel ID>",
    "contact_id": "<contact id>",
    "facebook_payload": {
        "attachment": {
            "type": "video/image/audio",
            "payload": {
                "url": "<public URL of file>"
            }
        }
    }
}'

Sending a Image with Button cards

curl --location --request POST '<baseAPIURl>/api/messages/send' \
--header 'X-API-Key: <API KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "channel_id": "<Channel ID>",
    "contact_id": "<contact id>",
    "facebook_payload": {
        "attachment": {
            "type": "template",
            "payload": {
                "elements": [
                    {
                        "title":"Card Title 1 (Required)",
                        "image_url": "<Image URL> (Optional)",
                        "buttons": [
                            {
                                "type": "web_url",
                                "url": "<URL>",
                                "title": "View Website"
                            },
                            {
                                "type": "postback",
                                "title": "Start Chatting",
                                "payload": "DEVELOPER_DEFINED_PAYLOAD"
                            }
                        ]
                    },
                    {
                        "title":"Card Title 2",
                        "image_url": "<Image URL>",
                        "buttons": [
                            {
                                "type": "web_url",
                                "url": "<URL>",
                                "title": "View Website"
                            }
                        ]
                    }

                ],
                "template_type": "generic"
            }
        }
    }
}'

Sending a text with Quick replies

curl --location --request POST '<baseAPIURl>/api/messages/send' \
--header 'X-API-Key: <API KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "channel_id": "<Channel ID>",
    "contact_id": "<contact id>",
    "facebook_payload": {
        "text": "<SOME_TEXT>",
        "quick_replies": [
            {
                "content_type": "text",
                "title": "<TITLE_1>",
                "payload": "<POSTBACK_PAYLOAD_1>"
            },
            {
                "content_type": "text",
                "title": "<TITLE_2>",
                "payload": "<POSTBACK_PAYLOAD_2>"
            }
        ]
    }
}'

Note: Either of Contact_id or facebook_psid or instagram_psid is mandatory