Skip to content

Whatsapp Interactive Messages

Interactive messages give your users a simpler way to find and select what they want from your business on WhatsApp. These messages enable two-way communication where users can interact with the message by selecting options, providing input, or taking specific actions within the message itself.

Image Alt Text
Interactive Message with
Call-to-Action URL Button Messages
Image Alt Text
Interactive Message with
Reply Buttons
Image Alt Text
Interactive Message with
List

Interactive Object

Parameter Type Description
*type String The type of interactive message you want to send. Supported values: button, list
*body Object The body object contains text parameter. Its required if body is present. The content of the message. Emojis and markdown are supported. Maximum length: 1024 characters.
footer Object The footer object contains text field. Required if footer is present. The footer content. Emojis, markdown, and links are supported. Maximum length: 60 characters.
header Object Optional. Header content displayed on top of a message. See Header Object.
*action Object Action you want the user to perform after reading the message. See Action Object.

Header Object

Parameter Type Description
type String The header type you would like to use. Supported values: text- Used for List Messages & Reply Buttons, video- Used for Reply Buttons, image- Used for Reply Buttons, document- Used for Reply Buttons.
document Object Required if type is set to document. Contains two parameters filename and link.
image Object Required if type is set to image. Contains only link parameter.
text String Required if type is set to text. Text for the header. Formatting allows emojis, but not markdown. Maximum length: 60 characters.
video Object Required if type is set to video. Contains only link parameter.
  "header": {
                "type": "text",
                "text": "Payment$ for D7 Whatsapp Service"
            }
    "header": {
                "type": "image",
                "image": {
                    "link": "https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg"
                }
            }
  "header": {
                "type": "video",
                "video": {
                    "link": "http://www.onirikal.com/videos/mp4/nestlegold.mp4"
                }
            }
    "header": {
                "type": "document",
                "document": {
                    "filename": "faq.pdf",
                    "link": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
                }
            }
"interactive": {
              "type": "cta_url",

              /* Header optional */
              "header": {
                "type": "text",
                "text": "<HEADER_TEXT>"
              },

              /* Body optional */
              "body": {
                "text": "<BODY_TEXT>"
              },

              /* Footer optional */
              "footer": {
                "text": "<FOOTER_TEXT>"
              },
              "action": {
                "name": "cta_url",
                "parameters": {
                  "display_text": "<BUTTON_TEXT>",
                  "url": "<BUTTON_URL>"
                }
              }
            }

Action Object

Interactive messages can be categorized into three, based on action object as follows:

Note:

The Interactive message with type list can only have header type: text.

CTA URL button messages allow you to map any URL to a button so you don't have to include the raw URL in the message body.

Image Alt Text

CTA Action objects:

Parameter Type Description
parameters Array(Object) Required for Call-to-Action Buttons. You can have up to one button. See Parameters Object

Parameters Object

Parameter Type Description Value / Pattern
*display_text String CTA Button text. See Dates
*url String URL to load in the device's default web browser when tapped by the WhatsApp user. https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4
"action": {
        "name": "cta_url",
        "parameters": {
          "display_text": "<BUTTON_TEXT>",
          "url": "<BUTTON_URL>"
        }
      }

Programing Examples:

curl --location 'https://apialpha.d7networks.com/whatsapp/v2/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc' \
--data '{
    "messages": [
        {
            "originator": "{registered phone_number}",
            "content": {
                "message_type": "INTERACTIVE",
            "interactive": {
                "type": "cta_url",
                "header": {
                    "type": "text",
                    "text": "Payment$ for D7 Whatsapp Service"
                },
                "body": {
                    "text": "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers."
                },
                "footer": {
                    "text": "Thank You"
                },
                "action": {
                    "parameters": {
                      "display_text": "Visit Alpha",
                      "url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
                    }
                }
            }
            },
            "recipients": [{
                "recipient": "{recipient}",
                "recipient_type": "individual"
            }],
            "report_url": "https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f"
        }
    ]
}'
npm i direct7
const Client = require('direct7')

const client = new Client(apiToken="Your API token")

let parameters = {
  "display_text": "Visit Us",
  "url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
}

const response = await client.whatsapp.sendWhatsAppInteractiveMessage({
    originator: "{registered_phone_number}",
    recipient: "{recipient}",
    interactive_type: "cta_url",
    header_type: "text",
    header_text: "Payment$ for D7 Whatsapp Service",
    body_text: "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
    footer_text: "Thank You", 
    parameters: parameters
});

console.log(response);
pip install direct7
from direct7 import Client

client = Client(api_token="Your API token")

parameters = {
      "display_text": "Visit Us",
      "url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
    }

client.whatsapp.send_whatsapp_interactive_message(originator="{registered_phonenumber}",
                                                  recipient="{recipient}",
                                                  interactive_type="cta_url",
                                                  header_type="text",
                                                  header_text="Payment$ for D7 Whatsapp Service",
                                                  body_text="Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
                                                  footer_text="Thank You", parameters=parameters)

composer require direct7/direct7-php
require_once 'vendor/autoload.php';
require_once __DIR__ . '/vendor/autoload.php';

use direct7\Direct7\Client;

$client = new Client(api_token="Your API token")

$parameters = [
  "display_text" => "Visit Us",
  "url" => "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
];

$response = $direct7->whatsapp->sendWhatsAppInteractiveMessage(
  originator:"{originator}", 
  recipient:"{recipient}", 
  interactive_type:"cta_url",
  header_type:"text",
  header_text:"Payment$ for D7 Whatsapp Service",
  body_text:"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
  footer_text:"Thank You", 
  parameters: $parameters
);
var_dump($response);
go get -u github.com/d7networks/direct7-go-sdk
import (
"github.com/d7networks/direct7-go-sdk/direct7"
)
apiToken := "Your Api Token"
client := direct7.NewClient(apiToken)
whatsapp := direct7.NewWhatsApp(client)
originator := "{registered_phonenumber}"
recipient := "{recipient}"
interactiveType := "cta_url"
parameters := map[string]interface{}{
      "display_text": "Visit Us",
  "url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4",
  }
optParams := &OptionalParams{
  headerType: "text",
  headerText: "Payment$ for D7 Whatsapp Service",
  bodyText: "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
  footerText: "Thank You",
  parameters: parameters,
}
response, err := client.whatsapp.SendWhatsAppInteractiveMessage(originator, recipient, interactiveType, optParams)
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"cta_url\",\n                \"header\": {\n                    \"type\": \"text\",\n                    \"text\": \"Payment$ for D7 Whatsapp Service\"\n                },\n                \"body\": {\n                    \"text\": \"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.\"\n                },\n                \"footer\": {\n                    \"text\": \"Thank You\"\n                },\n                \"action\": {\n                    \"parameters\": {\n                      \"display_text\": \"Visit Alpha\",\n                      \"url\": \"https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4\"\n                    }\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{recipient}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f\"\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://apialpha.d7networks.com/whatsapp/v2/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc")
  .build();
Response response = client.newCall(request).execute();
  var headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc'
  };
  var request = http.Request('POST', Uri.parse('https://apialpha.d7networks.com/whatsapp/v2/send'));
  request.body = json.encode({
    "messages": [
      {
        "originator": "{registered phone_number}",
        "content": {
          "message_type": "INTERACTIVE",
          "interactive": {
            "type": "cta_url",
            "header": {
              "type": "text",
              "text": "Payment$ for D7 Whatsapp Service"
            },
            "body": {
              "text": "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers."
            },
            "footer": {
              "text": "Thank You"
            },
            "action": {
              "parameters": {
                "display_text": "Visit Alpha",
                "url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
              }
            }
          }
        },
        "recipients": [
          {
            "recipient": "{recipient}",
            "recipient_type": "individual"
          }
        ],
        "report_url": "https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f"
      }
    ]
  });
  request.headers.addAll(headers);

  http.StreamedResponse response = await request.send();

  if (response.statusCode == 200) {
    print(await response.stream.bytesToString());
  }
  else {
    print(response.reasonPhrase);
  }
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc")

$body = @"
{
`"messages`": [
{
`"originator`": `"{registered phone_number}`",
`"content`": {
`"message_type`": `"INTERACTIVE`",
`"interactive`": {
`"type`": `"cta_url`",
`"header`": {
`"type`": `"text`",
`"text`": `"Payment`$ for D7 Whatsapp Service`"
},
`"body`": {
`"text`": `"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.`"
},
`"footer`": {
`"text`": `"Thank You`"
},
`"action`": {
`"parameters`": {
`"display_text`": `"Visit Alpha`",
`"url`": `"https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4`"
}
}
}
},
`"recipients`": [{
`"recipient`": `"{recipient}`",
`"recipient_type`": `"individual`"
}],
`"report_url`": `"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f`"
}
]
}
"@

$response = Invoke-RestMethod 'https://apialpha.d7networks.com/whatsapp/v2/send' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
gem install direct7
require 'direct7'

client = Direct7::Client.new('Your API token')

parameters = {
  "display_text": "Visit Us",
  "url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
}
client.whatsapp.send_whatsapp_interactive_message(
    originator='{originator}', 
    recipient='{recipient}',
    interactive_type= "cta_url",
    header_type= "text",
    header_text= "Payment$ for D7 Whatsapp Service",
    header_link=nil, header_file_name=nil,
    body_text= "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
    footer_text= "Thank You",
    parameters= parameters
)
1
2
3
4
5
6
7
8
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://apialpha.d7networks.com/whatsapp/v2/send");
request.Headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc");
var content = new StringContent("{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"cta_url\",\n                \"header\": {\n                    \"type\": \"text\",\n                    \"text\": \"Payment$ for D7 Whatsapp Service\"\n                },\n                \"body\": {\n                    \"text\": \"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.\"\n                },\n                \"footer\": {\n                    \"text\": \"Thank You\"\n                },\n                \"action\": {\n                    \"parameters\": {\n                      \"display_text\": \"Visit Alpha\",\n                      \"url\": \"https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4\"\n                    }\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{recipient}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f\"\n        }\n    ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Interactive reply buttons messages allow you to send up to three predefined replies for users to choose from. Users can respond to a message by selecting one of the predefined buttons, which triggers a messages webhook describing their selection.

Image Alt Text

Reply Buttons Action objects

Parameter Type Description
buttons Array(Object) Required for Reply Buttons. You can have up to 3 buttons. You cannot have leading or trailing spaces when setting the ID. A button object can contain the following parameters:
type: only supported type is reply (for Reply Button)
title: Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.
id: Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters.

Buttons Object

Parameter Type Description Value / Pattern
*type String Only supported type is reply. reply
*title String Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters. Change
*id String Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters. 1
"action": {
        "buttons": [
          {
            "type": "reply",
            "reply": {
              "id": "<BUTTON_ID>",
              "title": "<BUTTON_LABEL_TEXT>"
            }
          }
        ]
      }

Programing Examples:

curl --location 'https://apialpha.d7networks.com/whatsapp/v2/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc' \
--data '{
    "messages": [
        {
            "originator": "{registered phone_number}",
            "content": {
                "message_type": "INTERACTIVE",
            "interactive": {
                "type": "button",
                "header": {
                    "type": "image",
                    "image": {
                        "link": "https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg"
                    }
                },
                "body": {
                    "text": "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers."
                },
                "footer": {
                    "text": "Thank You"
                },
                "action": {
                    "buttons": [
                        {
                            "type": "reply",
                            "reply": {
                                "id": "1",
                                "title": "Debit Card"
                            }
                        },
                        {
                            "type": "reply",
                            "reply": {
                                "id": "2",
                                "title": "Credit Card"
                            }
                        },
                                                {
                            "type": "reply",
                            "reply": {
                                "id": "3",
                                "title": "Cash"
                            }
                        }
                    ]
                }
            }
            },
            "recipients": [{
                "recipient": "{recipient}",
                "recipient_type": "individual"
            }],
            "report_url": "https://webhook.site/e8839c21-2de3-499f-90a9-be31fd0cddb7"
        }
    ]
}'
npm i direct7
const Client = require('direct7')

const client = new Client(apiToken="Your API token")

let buttons = [{"type": "reply", "reply": {"id": "1", "title": "Debit Card"}}, {
    "type": "reply",
    "reply": {"id": "2", "title": "Credit"}
}]

response = await client.whatsapp.sendWhatsAppInteractiveMessage({
    originator: "{originator}",
    recipient: "{recipient}",
    interactive_type: "button",
    header_type: "image",
    header_link: "https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg",
    body_text: "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
    footer_text: "Thank You",
    buttons: buttons
});

console.log(response);
pip install direct7
from direct7 import Client

client = Client(api_token="Your API token")\

buttons = [{"type": "reply", "reply": { "id": "1", "title": "Debit Card"} }, {"type": "reply", "reply": {"id": "2", "title": "Credit"}}]

client.whatsapp.send_whatsapp_interactive_message(originator="{registered_phonenumber}",
                                                  recipient="{recipient}",
                                                  interactive_type="button",
                                                  header_type="image",
                                                  header_link="https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg",
                                                  body_text="Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
                                                  footer_text="Thank You",
                                                  buttons=buttons)

composer require direct7/direct7-php
require_once 'vendor/autoload.php';
require_once __DIR__ . '/vendor/autoload.php';

use direct7\Direct7\Client;

$client = new Client(api_token="Your API token")

$buttons = [
    ["type" => "reply", "reply" => ["id" => "1", "title" => "Debit Card"]],
    ["type" => "reply", "reply" => ["id" => "2", "title" => "Credit"]]
];

$response = $direct7->whatsapp->sendWhatsAppInteractiveMessage(
  originator:"{registered_phonenumber}", 
  recipient:"{recipient}", 
  interactive_type:"button",
  header_type:"image",
  header_link:"https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg",
  body_text:"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
  footer_text:"Thank You",
  buttons: $buttons
);
var_dump($response);
go get -u github.com/d7networks/direct7-go-sdk
import (
"github.com/d7networks/direct7-go-sdk/direct7"
)
apiToken := "Your Api Token"
client := direct7.NewClient(apiToken)
whatsapp := direct7.NewWhatsApp(client)
originator := "{registered_phonenumber}"
recipient := "{recipient}"
interactiveType := "button"
buttons := []map[string]interface{}{
      {
    "type": "reply", 
    "reply": map[string]interface{}{
      "id": "1", 
      "title": "Debit Card",
    },
  }, 
  {
    "type": "reply", 
    "reply": map[string]interface{}{
      "id": "2", 
      "title": "Credit",
    },
  },
  }
optParams := &OptionalParams{
  headerType: "text",
  headerText: "Payment$ for D7 Whatsapp Service",
  bodyText: "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
  footerText: "Thank You",
  buttons: buttons,
}
response, err := client.whatsapp.SendWhatsAppInteractiveMessage(originator, recipient, interactiveType, optParams)
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"button\",\n                \"header\": {\n                    \"type\": \"image\",\n                    \"image\": {\n                        \"link\": \"https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg\"\n                    }\n                },\n                \"body\": {\n                    \"text\": \"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.\"\n                },\n                \"footer\": {\n                    \"text\": \"Thank You\"\n                },\n                \"action\": {\n                    \"buttons\": [\n                        {\n                            \"type\": \"reply\",\n                            \"reply\": {\n                                \"id\": \"1\",\n                                \"title\": \"Debit Card\"\n                            }\n                        },\n                        {\n                            \"type\": \"reply\",\n                            \"reply\": {\n                                \"id\": \"2\",\n                                \"title\": \"Credit Card\"\n                            }\n                        },\n                                                {\n                            \"type\": \"reply\",\n                            \"reply\": {\n                                \"id\": \"3\",\n                                \"title\": \"Cash\"\n                            }\n                        }\n                    ]\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{recipient}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"https://webhook.site/e8839c21-2de3-499f-90a9-be31fd0cddb7\"\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://apialpha.d7networks.com/whatsapp/v2/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc")
  .build();
Response response = client.newCall(request).execute();
  var headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc'
  };
  var request = http.Request('POST', Uri.parse('https://apialpha.d7networks.com/whatsapp/v2/send'));
  request.body = json.encode({
    "messages": [
      {
        "originator": "{registered phone_number}",
        "content": {
          "message_type": "INTERACTIVE",
          "interactive": {
            "type": "button",
            "header": {
              "type": "image",
              "image": {
                "link": "https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg"
              }
            },
            "body": {
              "text": "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers."
            },
            "footer": {
              "text": "Thank You"
            },
            "action": {
              "buttons": [
                {
                  "type": "reply",
                  "reply": {
                    "id": "1",
                    "title": "Debit Card"
                  }
                },
                {
                  "type": "reply",
                  "reply": {
                    "id": "2",
                    "title": "Credit Card"
                  }
                },
                {
                  "type": "reply",
                  "reply": {
                    "id": "3",
                    "title": "Cash"
                  }
                }
              ]
            }
          }
        },
        "recipients": [
          {
            "recipient": "{recipient}",
            "recipient_type": "individual"
          }
        ],
        "report_url": "https://webhook.site/e8839c21-2de3-499f-90a9-be31fd0cddb7"
      }
    ]
  });
  request.headers.addAll(headers);

  http.StreamedResponse response = await request.send();

  if (response.statusCode == 200) {
    print(await response.stream.bytesToString());
  }
  else {
    print(response.reasonPhrase);
  }
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc")

$body = @"
{
    `"messages`": [
        {
            `"originator`": `"{registered phone_number}`",
            `"content`": {
                `"message_type`": `"INTERACTIVE`",
            `"interactive`": {
                `"type`": `"button`",
                `"header`": {
                    `"type`": `"image`",
                    `"image`": {
                        `"link`": `"https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg`"
                    }
                },
                `"body`": {
                    `"text`": `"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.`"
                },
                `"footer`": {
                    `"text`": `"Thank You`"
                },
                `"action`": {
                    `"buttons`": [
                        {
                            `"type`": `"reply`",
                            `"reply`": {
                                `"id`": `"1`",
                                `"title`": `"Debit Card`"
                            }
                        },
                        {
                            `"type`": `"reply`",
                            `"reply`": {
                                `"id`": `"2`",
                                `"title`": `"Credit Card`"
                            }
                        },
                                                {
                            `"type`": `"reply`",
                            `"reply`": {
                                `"id`": `"3`",
                                `"title`": `"Cash`"
                            }
                        }
                    ]
                }
            }
            },
            `"recipients`": [{
                `"recipient`": `"{recipient}`",
                `"recipient_type`": `"individual`"
            }],
            `"report_url`": `"https://webhook.site/e8839c21-2de3-499f-90a9-be31fd0cddb7`"
        }
    ]
}
"@

$response = Invoke-RestMethod 'https://apialpha.d7networks.com/whatsapp/v2/send' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
gem install direct7
require 'direct7'

client = Direct7::Client.new('Your API token')

buttons = [{"type": "reply", "reply": {"id": "1", "title": "Debit Card"}}, {"type": "reply", "reply": {"id": "2", "title": "Credit"}}]
client.whatsapp.send_whatsapp_interactive_message(
    originator='{originator}', 
    recipient='{recipient}',
    interactive_type= "button",
    header_type= "text",
    header_text= "Payment$ for D7 Whatsapp Service",
    header_link=nil, header_file_name=nil,
    body_text= "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
    footer_text= "Thank You",
    parameters= nil, sections=nil, 
    buttons=buttons
)
1
2
3
4
5
6
7
8
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://apialpha.d7networks.com/whatsapp/v2/send");
request.Headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc");
var content = new StringContent("{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"button\",\n                \"header\": {\n                    \"type\": \"image\",\n                    \"image\": {\n                        \"link\": \"https://karix.s3.ap-south-1.amazonaws.com/English-4.jpg\"\n                    }\n                },\n                \"body\": {\n                    \"text\": \"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.\"\n                },\n                \"footer\": {\n                    \"text\": \"Thank You\"\n                },\n                \"action\": {\n                    \"buttons\": [\n                        {\n                            \"type\": \"reply\",\n                            \"reply\": {\n                                \"id\": \"1\",\n                                \"title\": \"Debit Card\"\n                            }\n                        },\n                        {\n                            \"type\": \"reply\",\n                            \"reply\": {\n                                \"id\": \"2\",\n                                \"title\": \"Credit Card\"\n                            }\n                        },\n                                                {\n                            \"type\": \"reply\",\n                            \"reply\": {\n                                \"id\": \"3\",\n                                \"title\": \"Cash\"\n                            }\n                        }\n                    ]\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{recipient}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"https://webhook.site/e8839c21-2de3-499f-90a9-be31fd0cddb7\"\n        }\n    ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Interactive list messages allow you to present WhatsApp users with a list of options to choose. When a user taps the button in the message, it displays a modal that lists the options available. Users can then choose one option and their selection will be sent as a reply.

Image Alt Text
Image Alt Text
Image Alt Text

List Action objects

Parameter Type Description
button String Required. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.
sections Array(Object) Required. Array of section objects. Minimum of 1, maximum of 10

Sections Object

Parameter Type Description Value / Pattern
*title String Required if the message has more than one section. Title of the section. Maximum length: 24 characters. See Dates
*rows List Contains a list of rows object. You can have a total of 10 rows across your sections.

Each row must have a
*title: Maximum length: 24 characters
*id: Maximum length: 200 characters
description: Maximum length: 72 characters
"action": {
        "sections": [
          {
            "title": "<SECTION_TITLE_TEXT>",
            "rows": [
              {
                "id": "<ROW_ID>",
                "title": "<ROW_TITLE_TEXT>",
                "description": "<ROW_DESCRIPTION_TEXT>"
              }
              /* Additional rows would go here*/
            ]
          }
          /* Additional sections would go here */
        ],
        "button": "<BUTTON_TEXT>",
      }

Programing Examples:

curl --location 'https://apialpha.d7networks.com/whatsapp/v2/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc' \
--data '{
    "messages": [
        {
            "originator": "{registered phone_number}",
            "content": {
                "message_type": "INTERACTIVE",
            "interactive": {
                "type": "list",
                "header": {
                    "type": "text",
                    "text": "Direct7 Networks"
                },
                "body": {
                    "text": "Choose one of our service"
                },
                "footer": {
                    "text": "Thank you"
                },
                "action": {
                    "button": "Choose Service",
                    "sections": [
                        {
                            "title": "SMS Messaging",
                            "rows": [
                                {
                                    "id": "1",
                                    "title": "Normal SMS",
                                    "description": "Signup for free at the D7 platform to use our Messaging APIs."
                                },
                                {
                                    "id": "2",
                                    "title": "Verify",
                                    "description": "D7 Verify API is to applications requires SMS based OTP authentications."
                                }
                            ]
                        },
                        {
                            "title": "Whatsapp",
                            "rows": [
                                {
                                    "id": "3",
                                    "title": "WhatsApp Messages",
                                    "description": "D7 Whatsapp API is to applications requires pre-registration."
                                }
                            ]
                        }
                    ]
                }
            }
            },
            "recipients": [{
                "recipient": "{recipient}",
                "recipient_type": "individual"
            }],
            "report_url": "https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f"
        }
    ]
}'
npm i direct7
const Client = require('direct7')

const client = new Client(apiToken="Your API token")

let sections = [
    {
        "title": "SMS Messaging",
        "rows": [
            {
                "id": "1",
                "title": "Normal SMS",
                "description": "Signup for free at the D7 platform to use our Messaging APIs."
            },
            {
                "id": "2",
                "title": "Verify",
                "description": "D7 Verify API is to applications requires SMS based OTP authentications."
            }
        ]
    },
    {
        "title": "Whatsapp",
        "rows": [
            {
                "id": "3",
                "title": "WhatsApp Messages",
                "description": "D7 Whatsapp API is to applications requires pre-registration."
            }
        ]
    }
]

const response = await client.whatsapp.sendWhatsAppInteractiveMessage({
  originator: "{originator}",
  recipient: "{recipient}",
  interactive_type: "list",
  header_type: "text",
  header_text: "Payment$ for D7 Whatsapp Service",
  body_text: "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
  footer_text: "Thank You",
  sections: sections,
  list_button_text: "Choose Service"
  });

console.log(response);
pip install direct7
from direct7 import Client

client = Client(api_token="Your API token")

sections = [
        {
            "title": "SMS Messaging",
            "rows": [
                {
                    "id": "1",
                    "title": "Normal SMS",
                    "description": "Signup for free at the D7 platform to use our Messaging APIs."
                },
                {
                    "id": "2",
                    "title": "Verify",
                    "description": "D7 Verify API is to applications requires SMS based OTP authentications."
                }
            ]
        },
        {
            "title": "Whatsapp",
            "rows": [
                {
                    "id": "3",
                    "title": "WhatsApp Messages",
                    "description": "D7 Whatsapp API is to applications requires pre-registration."
                }
            ]
        }
    ]

client.whatsapp.send_whatsapp_interactive_message(originator="{registered_phonenumber}",
                                                  recipient="{recipient}",
                                                  interactive_type="list",
                                                  header_type="text",
                                                  header_text="Payment$ for D7 Whatsapp Service",
                                                  body_text="Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
                                                  footer_text="Thank You",
                                                  list_button_text="Choose Service",
                                                  sections=sections)

composer require direct7/direct7-php
require_once 'vendor/autoload.php';
require_once __DIR__ . '/vendor/autoload.php';

use direct7\Direct7\Client;

$client = new Client(api_token="Your API token")

$sections = [
    [
        "title" => "SMS Messaging",
        "rows" => [
            [
                "id" => "1",
                "title" => "Normal SMS",
                "description" => "Signup for free at the D7 platform to use our Messaging APIs."
            ],
            [
                "id" => "2",
                "title" => "Verify",
                "description" => "D7 Verify API is to applications requires SMS based OTP authentications."
            ]
        ]
    ],
    [
        "title" => "Whatsapp",
        "rows" => [
            [
                "id" => "3",
                "title" => "WhatsApp Messages",
                "description" => "D7 Whatsapp API is to applications requires pre-registration."
            ]
        ]
    ]
];

$response = $direct7->whatsapp->sendWhatsAppInteractiveMessage(
  originator:"{originator}", 
  recipient:"{recipient}", 
  interactive_type:"list",
  header_type:"text",
  header_text:"Payment$ for D7 Whatsapp Service",
  body_text:"Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
  footer_text:"Thank You",
  list_button_text:"Choose Service",
  sections: $sections
);
var_dump($response);
go get -u github.com/d7networks/direct7-go-sdk
import (
"github.com/d7networks/direct7-go-sdk/direct7"
)
apiToken := "Your Api Token"
client := direct7.NewClient(apiToken)
whatsapp := direct7.NewWhatsApp(client)
originator := "{registered_phonenumber}"
recipient := "{recipient}"
interactiveType := "list"
sections := []map[string]interface{}{
  {
    "title": "SMS Messaging",
    "rows": []map[string]interface{}{
      {
        "id":          "1",
        "title":       "Normal SMS",
        "description": "Signup for free at the D7 platform to use our Messaging APIs.",
      },
      {
        "id":          "2",
        "title":       "Verify",
        "description": "D7 Verify API is to applications requires SMS based OTP authentications.",
      },
    },
  },
  {
    "title": "Whatsapp",
    "rows": []map[string]interface{}{
      {
        "id":          "3",
        "title":       "WhatsApp Messages",
        "description": "D7 Whatsapp API is to applications requires pre-registration.",
      },
    },
  },
}
optParams := &OptionalParams{
  headerType: "text",
  headerText: "Payment$ for D7 Whatsapp Service",
  bodyText: "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
  footerText: "Thank You",
  sections: sections,
  listButtonText: "Choose Service",
}
response, err := client.whatsapp.SendWhatsAppInteractiveMessage(originator, recipient, interactiveType, optParams)
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"list\",\n                \"header\": {\n                    \"type\": \"text\",\n                    \"text\": \"Direct7 Networks\"\n                },\n                \"body\": {\n                    \"text\": \"Choose one of our service\"\n                },\n                \"footer\": {\n                    \"text\": \"Thank you\"\n                },\n                \"action\": {\n                    \"button\": \"Choose Service\",\n                    \"sections\": [\n                        {\n                            \"title\": \"SMS Messaging\",\n                            \"rows\": [\n                                {\n                                    \"id\": \"1\",\n                                    \"title\": \"Normal SMS\",\n                                    \"description\": \"Signup for free at the D7 platform to use our Messaging APIs.\"\n                                },\n                                {\n                                    \"id\": \"2\",\n                                    \"title\": \"Verify\",\n                                    \"description\": \"D7 Verify API is to applications requires SMS based OTP authentications.\"\n                                }\n                            ]\n                        },\n                        {\n                            \"title\": \"Whatsapp\",\n                            \"rows\": [\n                                {\n                                    \"id\": \"3\",\n                                    \"title\": \"WhatsApp Messages\",\n                                    \"description\": \"D7 Whatsapp API is to applications requires pre-registration.\"\n                                }\n                            ]\n                        }\n                    ]\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{recipient}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f\"\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://apialpha.d7networks.com/whatsapp/v2/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc")
  .build();
Response response = client.newCall(request).execute();
var headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc'
};
var request = http.Request('POST', Uri.parse('https://apialpha.d7networks.com/whatsapp/v2/send'));
request.body = json.encode({
  "messages": [
    {
      "originator": "{registered phone_number}",
      "content": {
        "message_type": "INTERACTIVE",
        "interactive": {
          "type": "list",
          "header": {
            "type": "text",
            "text": "Direct7 Networks"
          },
          "body": {
            "text": "Choose one of our service"
          },
          "footer": {
            "text": "Thank you"
          },
          "action": {
            "button": "Choose Service",
            "sections": [
              {
                "title": "SMS Messaging",
                "rows": [
                  {
                    "id": "1",
                    "title": "Normal SMS",
                    "description": "Signup for free at the D7 platform to use our Messaging APIs."
                  },
                  {
                    "id": "2",
                    "title": "Verify",
                    "description": "D7 Verify API is to applications requires SMS based OTP authentications."
                  }
                ]
              },
              {
                "title": "Whatsapp",
                "rows": [
                  {
                    "id": "3",
                    "title": "WhatsApp Messages",
                    "description": "D7 Whatsapp API is to applications requires pre-registration."
                  }
                ]
              }
            ]
          }
        }
      },
      "recipients": [
        {
          "recipient": "{recipient}",
          "recipient_type": "individual"
        }
      ],
      "report_url": "https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f"
    }
  ]
});
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
  print(await response.stream.bytesToString());
}
else {
  print(response.reasonPhrase);
}
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc")

$body = @"
{
`"messages`": [
{
`"originator`": `"{registered phone_number}`",
`"content`": {
`"message_type`": `"INTERACTIVE`",
`"interactive`": {
`"type`": `"list`",
`"header`": {
`"type`": `"text`",
`"text`": `"Direct7 Networks`"
},
`"body`": {
`"text`": `"Choose one of our service`"
},
`"footer`": {
`"text`": `"Thank you`"
},
`"action`": {
`"button`": `"Choose Service`",
`"sections`": [
{
`"title`": `"SMS Messaging`",
`"rows`": [
{
`"id`": `"1`",
`"title`": `"Normal SMS`",
`"description`": `"Signup for free at the D7 platform to use our Messaging APIs.`"
},
{
`"id`": `"2`",
`"title`": `"Verify`",
`"description`": `"D7 Verify API is to applications requires SMS based OTP authentications.`"
}
]
},
{
`"title`": `"Whatsapp`",
`"rows`": [
{
`"id`": `"3`",
`"title`": `"WhatsApp Messages`",
`"description`": `"D7 Whatsapp API is to applications requires pre-registration.`"
}
]
}
]
}
}
},
`"recipients`": [{
`"recipient`": `"{recipient}`",
`"recipient_type`": `"individual`"
}],
`"report_url`": `"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f`"
}
]
}
"@

$response = Invoke-RestMethod 'https://apialpha.d7networks.com/whatsapp/v2/send' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
gem install direct7
require 'direct7'

client = Direct7::Client.new('Your API token')

sections = [
  {
      "title": "SMS Messaging",
      "rows": [
          {
              "id": "1",
              "title": "Normal SMS",
              "description": "Signup for free at the D7 platform to use our Messaging APIs."
          },
          {
              "id": "2",
              "title": "Verify",
              "description": "D7 Verify API is to applications requires SMS based OTP authentications."
          }
      ]
  },
  {
      "title": "Whatsapp",
      "rows": [
          {
              "id": "3",
              "title": "WhatsApp Messages",
              "description": "D7 Whatsapp API is to applications requires pre-registration."
          }
      ]
  }
]
client.whatsapp.send_whatsapp_interactive_message(
    originator='{originator}', 
    recipient='{recipient}',
    interactive_type= "list",
    header_type= "text",
    header_text= "Payment$ for D7 Whatsapp Service",
    header_link=nil, header_file_name=nil,
    body_text= "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
    footer_text= "Thank You",
    parameters= nil, sections=sections, 
    buttons=nil, list_button_text='Choose Service'
)
1
2
3
4
5
6
7
8
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://apialpha.d7networks.com/whatsapp/v2/send");
request.Headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc");
var content = new StringContent("{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"list\",\n                \"header\": {\n                    \"type\": \"text\",\n                    \"text\": \"Direct7 Networks\"\n                },\n                \"body\": {\n                    \"text\": \"Choose one of our service\"\n                },\n                \"footer\": {\n                    \"text\": \"Thank you\"\n                },\n                \"action\": {\n                    \"button\": \"Choose Service\",\n                    \"sections\": [\n                        {\n                            \"title\": \"SMS Messaging\",\n                            \"rows\": [\n                                {\n                                    \"id\": \"1\",\n                                    \"title\": \"Normal SMS\",\n                                    \"description\": \"Signup for free at the D7 platform to use our Messaging APIs.\"\n                                },\n                                {\n                                    \"id\": \"2\",\n                                    \"title\": \"Verify\",\n                                    \"description\": \"D7 Verify API is to applications requires SMS based OTP authentications.\"\n                                }\n                            ]\n                        },\n                        {\n                            \"title\": \"Whatsapp\",\n                            \"rows\": [\n                                {\n                                    \"id\": \"3\",\n                                    \"title\": \"WhatsApp Messages\",\n                                    \"description\": \"D7 Whatsapp API is to applications requires pre-registration.\"\n                                }\n                            ]\n                        }\n                    ]\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{recipient}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f\"\n        }\n    ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());