Send WhatsApp Template

POST https://app.alaaqat.com/api/broadcasts/{id}/send

Where id is the template ID you would like to send.

Header

{
    "Accept": "application/json"
}

Body

{
    contact_id: string,
    header?: {
        file?: File
    },
    components?: [
        {
            type: string,
            sub_type: string,
            index: number,
            parameters: [
                {
                    type: string,
                    payload: string,
                }
            ],
        }
    ]
}
Field Required Validation Description
contact_id Required string The contact id of the contact that will receive the template
header.file Required only if the template header type is media Maximum size is 10MB.
Must be of the following types: 'application/pdf', 'image/jpeg', 'image/jpg', 'image/png', 'video/mp4'
The header media if the template has one.
components Required only if the template has offer code array Components manipulations, currently only support offer code
components.*.type Required only if the template has offer code button button is the only supported type for now
components.*.sub_type Required only if the template has offer code copy_code copy_code is the only supported value for now
components.*.index Required only if the template has offer code integer The order of the button
components..parameters..type Required only if the template has offer code payload Must be payload
components..parameters..payload Required only if the template has offer code string The offer code

Response

Return Message object

{
    "data": {
        "id": "wamidf91071ec-29ef-353c-9f34-dc2c47452e6f",
        "contact_channel_id": "5eaf5ba9-3d63-3cfe-ab10-f4b97f7033bd",
        "platform_type": "Modules\Conversations\Inbox\Models\WabaNumber",
        "platform_third_party_id": "6516633",
        "sender_third_party_id": "651663",
        "receiver_third_party_id": "5eaf5ba9-3d63-3cfe-ab10-f4b97f7033bd",
        "status": "sent",
        "broadcast_id": 53,
        "attachments": [],
        "updated_at": "2024-09-30T18:35:46.668000Z",
        "created_at": "2024-09-30T18:35:46.668000Z",
        "_id": "66faef8227545300c4059c84",
        "is_sent_by_the_business": true,
        "broadcast": {
            "id": 53,
            "name": "عربي",
            "language": "ar",
            "account_id": 1,
            "template_type": "Modules\Conversations\Broadcasts\Models\WhatsappTemplate",
            "template_id": 55,
            "platform_type": "Modules\Conversations\Inbox\Models\WabaNumber",
            "platform_id": 9,
            "status": "APPROVED",
            "created_at": "2024-02-27T20:13:49.000000Z",
            "updated_at": "2024-02-27T20:13:49.000000Z",
            "reason": null,
            "provider": "whatsapp_number",
            "template": {
                "id": 55,
                "header": {
                    "format": "TEXT",
                    "text": "عنوان أول",
                    "type": "HEADER"
                },
                "body": {
                    "text": "اي شي",
                    "type": "BODY"
                },
                "footer": {
                    "text": "نص",
                    "type": "FOOTER"
                },
                "buttons": null,
                "created_at": "2024-02-27T20:13:49.000000Z",
                "updated_at": "2024-02-27T20:13:49.000000Z",
                "external_id": "9e0ef969-336d-352b-9323-aeb79c32cbe6",
                "name": "alaaqat_1709064829",
                "category": "UTILITY"
            },
            "platform": {
                "id": 9,
                "verified_name": "Loma Kihn",
                "code_verification_status": "VERIFIED",
                "display_phone_number": "1-458-673-2034",
                "quality_rating": "GREEN",
                "phone_id": "651663395",
                "waba_id": 5,
                "created_at": "2023-11-24T21:06:10.000000Z",
                "updated_at": "2023-11-24T21:06:10.000000Z",
                "about": null,
                "address": null,
                "description": null,
                "email": null,
                "profile_picture": null,
                "vertical": null,
                "websites": null,
                "name": "Loma Kihn",
                "image": "https://ui-avatars.com/api/?rounded=true&bold=true&name=Loma Kihn"
            }
        }
    }
}