API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

{endpoint}whatsapp/message/send
Name Description Limits Required
name Template Alias Name N/A yes
language Language to send the template in. Default en N/A No
header_params Only one header replace variable value. N/A Yes incase template contain having the header variable
header_params.type Replacing the header media type : text, image, video or document. If image, video or document type value then payload inside required the url parameter, else text parameter Yes incase template contain having the header variable
body_params Up to 1024 characters for all parameters that are predefined template text, if authentication template has only one replace variable value. Up to 1024 characters for all parameters and predefined template text Yes incase only template contain having the body variables
components This block contains header, body, footer sections payload as per predefined template. Up to 1024 characters for all parameters and predefined template text Yes incase Template contain headers and footers
ttl Time to live of the template message. If the receiver has not opened the template message before the time to live expires, the message will be deleted. Default 30 Days. Need to specify in Seconds Can be more than 1 day i.e 86400 sec No
cURL - cURL
curl --location --globoff '{endpoint}/api/v2/whatsapp/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "channels": [
        {
            "name": "whatsapp",
            "from": "{from}"
        }
    ],
    "recipient": {
        "to": "{receiver}"
    },
    "message": {
        "type": "template",
        "payload": {
            "name": "template_alias_name",
            "language": "en"
        }
    }
}'
cURL - cURL
curl --location --globoff '{endpoint}/api/v2/whatsapp/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "channels": [
        {
            "name": "whatsapp",
            "from": "{from}"
        }
    ],
    "recipient": {
        "to": [
            "{receiver}"
        ]
    },
    "message": {
        "type": "template",
        "payload": {
            "name": "template_alias_name",
            "language": "en",
            "header_params": {
                "type": "text",
                "payload": {
                    "text": "replace-header-variable-value"
                }
            },
            "body_params": ["variable-1", "variable-2"]
        }
    }
}'
cURL - cURL
curl --location --globoff '{endpoint}/api/v2/whatsapp/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "channels": [
        {
            "name": "whatsapp",
            "from": "{from}"
        }
    ],
    "recipient": {
        "to": [
            "{receiver}"
        ]
    },
    "message": {
        "type": "template",
        "payload": {
            "name": "template_alias_name",
            "language": "en",
            "header_params": {
                "type": "image",
                "payload": {
                    "url": "https://picsum.photos/id/237/200/300"
                }
            },
            "body_params": []
        }
    }
}'
cURL - cURL
curl --location --globoff '{endpoint}/api/v2/whatsapp/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "channels": [
        {
            "name": "whatsapp",
            "from": "{from}"
        }
    ],
    "recipient": {
        "to": [
            "{receiver}"
        ]
    },
    "message": {
        "type": "template",
        "payload": {
            "name": "template_alias_name",
            "language": "en",
            "header_params": {
                "type": "document",
                "payload": {
                    "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
                    "filename": "Sample PDF file"
                }
            },
            "body_params": []
        }
    }
}'
cURL - cURL
curl --location --globoff '{endpoint}/api/v2/whatsapp/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "channels": [
        {
            "name": "whatsapp",
            "from": "{from}"
        }
    ],
    "recipient": {
        "to": [
            "{receiver}"
        ]
    },
    "message": {
        "type": "template",
        "payload": {
            "name": "template_alias_name",
            "language": "en",
            "header_params": {
                "type": "video",
                "payload": {
                    "url": "https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4"
                }
            },
            "body_params": []
        }
    }
}'
cURL - cURL
curl --location --globoff '{endpoint}/api/v2/whatsapp/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "channels": [
        {
            "name": "whatsapp",
            "from": "{from}"
        }
    ],
    "recipient": {
        "to": [
            "{receiver}"
        ]
    },
    "message": {
        "type": "template",
        "payload": {
            "name": "auth_template_alias_name",
            "language": "en",
            "body_params" : ["replace-variable-code"]
        }
    }
}'