How to send WhatsApp message using REST API - QuickReply.ai

After your account on QuickReply.ai is active, you can send template message to users.

Below are the details of REST API

  1. Method: POST

  2. Headers: client-id: {client_id} secret-key: {secret_key} Content-Type: application/json

  3. Body: {

    "to": "{{recipient_phone in international format}}",

    "name": "{{recipient_name}}",

    "email": "{{recipient_email}}",

    "link": "{{media_url}}",

    "params": [ {{params}} ],

    "button_params": [ {{button_params}} ],

    "hook_with_playbook":"{{playbook_id}}"

    }'

Below is the explanation of each parameter (Please remove { } while making API calls)

ParameterExplaination

template_id

id of template message. you can get it from Templates tab

client-id

client id of your account. You can get it from settings -> API credentials

client-secret

client secret key of your account. You can get it from settings -> API credentials

to

receivers phone number in international format (eg +919876543210 )

name (optional)

name of receiver. If supplied, it will be displayed on your account next to phone number

email (optional)

email of receiver. If supplied, it will be displayed on your account next to phone number

link (required for media template only)

link to media, if you supplied media template. Link should be a direct link, not google drive or any website's link. Media type should match with the template. For example if template requires video, the link should point to a valid video

params (required only if template has variables)

Array of parameters for the template body. It should match with the number of parameters required in the template. For example if template body contains 2 parameters: {{1}} and {{2}} then you need to supply array of 2 strings.

button_params (required only if template has dynamic link as cta button)

If link in the template was dynamic, you need to supply dynamic part of the URL as a button_params

playbook_id (required only if template has quick reply buttons)

id of playbook(chatbot), if template has quickreply buttons to start chatbot. playbook_id can be found from AI builder.

Sample curl request for template with dynamic URL as a cta button

  1. --header 'client-id: <client id> \

  2. --header 'secret-key: <secret key> \

  3. --header 'Content-Type: application/json' \

  4. --data-raw '{

  5. "to": "+911231231231",

  6. "name": "Iticks",

  7. "params": [

  8. "param1",

  9. "param2"

  10. ],

  11. "button_params": [

  12. "param1"

  13. ],

  14. }'

Last updated