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
Image Alt Text
Interactive Message with
Location Request Button
Image Alt Text
Interactive Message with
Address Message(India)
Image Alt Text
Interactive Message with
Address Message(Singapore)

Interactive Object

Parameter Type Description
*type String The type of interactive message you want to send. Supported values: button, list, location_request_message, address_message
*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.

Header and Footer are not allowed for Interactive location request messages.

Interactive address messages are only supported in India and Singapore.

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://api.d7networks.com/whatsapp/v2/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{api_token}}' \
--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 Site",
                      "url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
                    }
                }
            }
            },
            "recipients": [{
                "recipient": "{recipient}",
                "recipient_type": "individual"
            }],
            "report_url": "{{webhook_url}}"
        }
    ]
}'
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}",
    recipients: [{"recipient": "{recipient}", "recipient_type": "individual"}],
    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}",
                                                  recipients=[{"recipient": "{recipient}", "recipient_type": "individual"}],
                                                  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}", 
  recipients: [["recipient" => "{recipient}", "recipient_type" => "individual"]], 
  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}"
recipients := []map[string]string{
    "recipient": "{recipient}",
    "recipient_type": "individual",
}
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, recipients, 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 Site\",\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\": \"{{webhook_url}}\"\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://api.d7networks.com/whatsapp/v2/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {{api_token}}")
  .build();
Response response = client.newCall(request).execute();
  var headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer {{api_token}}'
  };
  var request = http.Request('POST', Uri.parse('https://api.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 Site",
                "url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
              }
            }
          }
        },
        "recipients": [
          {
            "recipient": "{recipient}",
            "recipient_type": "individual"
          }
        ],
        "report_url": "{{webhook_url}}"
      }
    ]
  });
  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 {{api_token}}")

$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 Site`",
`"url`": `"https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4`"
}
}
}
},
`"recipients`": [{
`"recipient`": `"{recipient}`",
`"recipient_type`": `"individual`"
}],
`"report_url`": `"{{webhook_url}}`"
}
]
}
"@

$response = Invoke-RestMethod 'https://api.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}', 
    recipients=[{ "recipient" => "{recipient}", "recipient_type" => "individual"}],
    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://api.d7networks.com/whatsapp/v2/send");
request.Headers.Add("Authorization", "Bearer {{api_token}}");
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 Site\",\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\": \"{{webhook_url}}\"\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://api.d7networks.com/whatsapp/v2/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{api_token}}' \
--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}",
    recipients: [{"recipient": "{recipient}", "recipient_type": "individual"}],
    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}",
                                                  recipients=[{"recipient": "{recipient}", "recipient_type": "individual"}],
                                                  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}", 
  recipients:[["recipient" => "{recipient}", "recipient_type" => "individual"]],
  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}"
recipients := []map[string]string{
    "recipient": "{recipient}",
    "recipient_type": "individual",
}
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://api.d7networks.com/whatsapp/v2/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {{api_token}}")
  .build();
Response response = client.newCall(request).execute();
  var headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer {{api_token}}'
  };
  var request = http.Request('POST', Uri.parse('https://api.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 {{api_token}}")

$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://api.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}', 
    recipients=[{'recipient' => '{recipient}', 'recipient_type' => 'individual'}],
    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://api.d7networks.com/whatsapp/v2/send");
request.Headers.Add("Authorization", "Bearer {{api_token}}");
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://api.d7networks.com/whatsapp/v2/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{api_token}}' \
--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": "{{webhook_url}}"
        }
    ]
}'
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}",
  recipients: [{"recipient": "{recipient}", "recipient_type": "individual"}],
  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}",
                                                  recipients=[{"recipient": "{recipient}", "recipient_type": "individual"}],
                                                  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}", 
  recipients:[["recipient" => "{recipient}", "recipient_type" => "individual"]],
  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}"
recipients := []map[string]string{
    "recipient": "{recipient}",
    "recipient_type": "individual",
}
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\": \"{{webhook_url}}\"\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://api.d7networks.com/whatsapp/v2/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {{api_token}}")
  .build();
Response response = client.newCall(request).execute();
var headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{api_token}}'
};
var request = http.Request('POST', Uri.parse('https://api.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": "{{webhook_url}}"
    }
  ]
});
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 {{api_token}}")

$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`": `"{{webhook_url}}`"
}
]
}
"@

$response = Invoke-RestMethod 'https://api.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}', 
    recipients=[{ "recipient" => "{recipient}", "recipient_type" => "individual"}],
    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://api.d7networks.com/whatsapp/v2/send");
request.Headers.Add("Authorization", "Bearer {{api_token}}");
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\": \"{{webhook_url}}\"\n        }\n    ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Location request messages display body text and a send location button. When a WhatsApp user taps the button, a location sharing screen appears which the user can then use to share their location.

Image Alt Text

Reply Buttons Action objects

Parameter Type Description
name string value should be send_location
"action": {
        "name": "send_location"
          }

Programing Examples:

curl --location 'https://api.d7networks.com/whatsapp/v2/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{api_token}}' \
--data '{
    "messages": [
        {
            "originator": "{registered phone_number}",
            "content": {
                "message_type": "INTERACTIVE",
            "interactive": {
                "type": "location_request_message",
                "body": {
                    "text": "Let's Start with your pickup"
                },
                "action": {
                    "name": "send_location"
                }
            }
            },
            "recipients": [{
                "recipient": "{recipient}",
                "recipient_type": "individual"
            }],
            "report_url": "{{webhook_url}}"
        }
    ]
}'
npm i direct7
const Client = require('direct7')

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

const response = await client.whatsapp.sendWhatsAppInteractiveMessage({
  originator: "{originator}",
  recipients: [{"recipient": "{recipient}", "recipient_type": "individual"}],
  interactive_type: "location_request_message",
  body_text: "Let's Start with your pickup"
  });

console.log(response);
pip install direct7
1
2
3
4
5
6
7
8
from direct7 import Client

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

client.whatsapp.send_whatsapp_interactive_message(originator="{registered_phonenumber}",
                                                  recipients=[{"recipient": "{recipient}", "recipient_type": "individual"}],
                                                  interactive_type="location_request_message",
                                                  body_text="Let's Start with your pickup")

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")

$response = $direct7->whatsapp->sendWhatsAppInteractiveMessage(
  originator:"{originator}", 
  recipients:[["recipient" => "{recipient}", "recipient_type" => "individual"]],
  interactive_type:"location_request_message",
  body_text:"Let's Start with your pickup",
);
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}"
recipients := []map[string]string{
    "recipient": "{recipient}",
    "recipient_type": "individual",
}
interactiveType := "location_request_message"
optParams := &OptionalParams{
  bodyText: "Let's Start with your pickup"
}
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\": \"location_request_message\",\n               \"body\": {\n                    \"text\": \"Let's Start with your pickup\"\n                },\n              },\n                \"action\": {\n                    \"name\": \"send_location\",\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{recipient}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"{{webhook_url}}\"\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://api.d7networks.com/whatsapp/v2/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {{api_token}}")
  .build();
Response response = client.newCall(request).execute();
var headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{api_token}}'
};
var request = http.Request('POST', Uri.parse('https://api.d7networks.com/whatsapp/v2/send'));
request.body = json.encode({
  "messages": [
    {
      "originator": "{registered phone_number}",
      "content": {
        "message_type": "INTERACTIVE",
        "interactive": {
          "type": "location_request_message",
          "body": {
            "text": "Let's Start with your pickup"
          },
          "action": {
            "name": "send_location"
          }
        }
      },
      "recipients": [
        {
          "recipient": "{recipient}",
          "recipient_type": "individual"
        }
      ],
      "report_url": "{{webhook_url}}"
    }
  ]
});
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 {{api_token}}")

$body = @"
{
`"messages`": [
{
`"originator`": `"{registered phone_number}`",
`"content`": {
`"message_type`": `"INTERACTIVE`",
`"interactive`": {
`"type`": `"location_request_message`",
`"header`": {
`"type`": `"text`",
`"text`": `"Direct7 Networks`"
},
`"body`": {
`"text`": `"Let's Start with your pickup`"
},
`"footer`": {
`"text`": `"Thank you`"
},
`"action`": {
`"name`": `"send_location`",
}
}
},
`"recipients`": [{
`"recipient`": `"{recipient}`",
`"recipient_type`": `"individual`"
}],
`"report_url`": `"{{webhook_url}}`"
}
]
}
"@

$response = Invoke-RestMethod 'https://api.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')
client.whatsapp.send_whatsapp_interactive_message(
    originator='{originator}', 
    recipients=[{ "recipient" => "{recipient}", "recipient_type" => "individual"}],
    interactive_type= "location_request_message",
    header_link=nil, header_file_name=nil,
    body_text= "Let's Start with your pickup",
    parameters= nil
)
1
2
3
4
5
6
7
8
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.d7networks.com/whatsapp/v2/send");
request.Headers.Add("Authorization", "Bearer {{api_token}}");
var content = new StringContent("{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"location_request_message\",\n       \"body\": {\n                    \"text\": \"Let's Start with your pickup\"\n                },\n                        \"recipients\": [{\n                \"recipient\": \"{recipient}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"{{webhook_url}}\"\n        }\n    ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Address messages give your users a simpler way to share the shipping address with the business on WhatsApp. Currently address messages are supported in the following two countries: India and Singapore.

Image Alt Text Image Alt Text

Reply Buttons Action objects

Parameter Type Description Supported Countries
name string value should be address_message India, Singapore
phone_number string Phone Number. Valid phone numbers only India, Singapore
in_pin_code string Pin Code India
sg_post_code number Post Code Singapore
house_number string Flat/House Number India
floor_number string Floor Number India
tower_number string Tower Number India
building_name string Building/Apartment Name India
address string Address India, Singapore
landmark_area string Landmark/Area India
unit_number string Unit number Singapore
city string City India, Singapore
state string State India
"action": {
   "parameters": {
      "country": "IN",
      "values": {
         "name": "Steni Mariya",
         "phone_number": "+97156965xxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      },
    "saved_addresses": [
        {
        "id": "address1",
         "value": {
         "name": "Lifiya Mariya",
         "phone_number": "+971569xxxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        },
        {
        "id": "address1",
         "value": {
         "name": "Mariya",
         "phone_number": "+971569658xxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        }
    ]
   }
}

Programing Examples:

curl --location 'https://api.d7networks.com/whatsapp/v2/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{api_token}}' \
--data '{
    "messages": [
        {
            "originator": "{registered phone_number}",
            "content": {
                "message_type": "INTERACTIVE",
            "interactive": {
                "type": "address_message",
                "header": {
                    "type": "text",
                    "text": "Direct7 Networks"
                },
                "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": {
                       "country": "IN",
                       "values": {
                          "name": "Steni Mariya",
                          "phone_number": "+97156965xxxx",
                          "in_pin_code": 680026,
                          "house_number": "45",
                          "floor_number": "3",
                         "tower_number": 34,
                         "building_name": "Excel",
                         "address": "House name",
                         "landmark_area": "Near Mobile Tower",
                         "city": "Thrissur",
                         "state": "Kerala"
                       },
                     "saved_addresses": [
                         {
                         "id": "address1",
                          "value": {
                          "name": "Lifiya Mariya",
                          "phone_number": "+971569xxxxx",
                          "in_pin_code": 680026,
                          "house_number": "45",
                          "floor_number": "3",
                         "tower_number": 34,
                         "building_name": "Excel",
                         "address": "House name",
                         "landmark_area": "Near Mobile Tower",
                         "city": "Thrissur",
                         "state": "Kerala"
                       }
                         },
                         {
                         "id": "address1",
                          "value": {
                          "name": "Mariya",
                          "phone_number": "+971569658xxx",
                          "in_pin_code": 680026,
                          "house_number": "45",
                          "floor_number": "3",
                         "tower_number": 34,
                         "building_name": "Excel",
                         "address": "House name",
                         "landmark_area": "Near Mobile Tower",
                         "city": "Thrissur",
                         "state": "Kerala"
                       }
                         }
                     ]
                    }
                }
            }
            },
            "recipients": [{
                "recipient": "{recipient}",
                "recipient_type": "individual"
            }],
            "report_url": "{{webhook_url}}"
        }
    ]
}'
npm i direct7
const Client = require('direct7')

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

let parameters =  {
      "country": "IN",
      "values": {
         "name": "Steni Mariya",
         "phone_number": "+97156965xxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      },
    "saved_addresses": [
        {
        "id": "address1",
         "value": {
         "name": "Lifiya Mariya",
         "phone_number": "+971569xxxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        },
        {
        "id": "address1",
         "value": {
         "name": "Mariya",
         "phone_number": "+971569658xxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        }
    ]
   }


const response = await client.whatsapp.sendWhatsAppInteractiveMessage({
  originator: "{originator}",
  recipients: [{"recipient": "{recipient}", "recipient_type": "individual"}],
  interactive_type: "address_message",
  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 = {
      "country": "IN",
      "values": {
         "name": "Steni Mariya",
         "phone_number": "+97156965xxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      },
    "saved_addresses": [
        {
        "id": "address1",
         "value": {
         "name": "Lifiya Mariya",
         "phone_number": "+971569xxxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        },
        {
        "id": "address1",
         "value": {
         "name": "Mariya",
         "phone_number": "+971569658xxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        }
    ]
   }

client.whatsapp.send_whatsapp_interactive_message(originator="{registered_phonenumber}",
                                                  recipients=[{"recipient": "{recipient}", "recipient_type": "individual"}],
                                                  interactive_type="address_message",
                                                  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 = {
      "country": "IN",
      "values": {
         "name": "Steni Mariya",
         "phone_number": "+97156965xxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      },
    "saved_addresses": [
        {
        "id": "address1",
         "value": {
         "name": "Lifiya Mariya",
         "phone_number": "+971569xxxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        },
        {
        "id": "address1",
         "value": {
         "name": "Mariya",
         "phone_number": "+971569658xxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        }
    ]
   };

$response = $direct7->whatsapp->sendWhatsAppInteractiveMessage(
  originator:"{originator}", 
  recipients:[["recipient" => "{recipient}", "recipient_type" => "individual"]],
  interactive_type:"address_message",
  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}"
recipients := []map[string]string{
    "recipient": "{recipient}",
    "recipient_type": "individual",
}
interactiveType := "address_message"
parameters := []map[string]interface{}{
  {
    "country": "IN",
      "values": {
         "name": "Steni Mariya",
         "phone_number": "+97156965xxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      },
    "saved_addresses": []map[string]interface{}{
        {
        "id": "address1",
         "value": {
         "name": "Lifiya Mariya",
         "phone_number": "+971569xxxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        },
        {
        "id": "address1",
         "value": {
         "name": "Mariya",
         "phone_number": "+971569658xxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        }
  }
}
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\": \"{{originator}}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"address_message\",\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              \"country\": \"IN\",\n              \"values\": {\n                 \"name\": \"Steni Mariya\",\n                 \"phone_number\": \"+9715696xxxx3\",\n                 \"in_pin_code\": 680026,\n                 \"house_number\": \"45\",\n                 \"floor_number\": \"3\",\n                \"tower_number\": 34,\n                \"building_name\": \"Excel\",\n                \"address\": \" House\",\n                \"landmark_area\": \"Near Mobile Tower\",\n                \"city\": \"Thrissur\",\n                \"state\": \"Kerala\"\n              },\n            \"saved_addresses\": [\n                {\n                \"id\": \"address1\",\n                 \"value\": {\n                 \"name\": \"Lifiya Mariya\",\n                 \"phone_number\": \"+9715696585xx\",\n                 \"in_pin_code\": 680026,\n                 \"house_number\": \"45\",\n                 \"floor_number\": \"3\",\n                \"tower_number\": 34,\n                \"building_name\": \"Excel\",\n                \"address\": \" House\",\n                \"landmark_area\": \"Near Mobile Tower\",\n                \"city\": \"Thrissur\",\n                \"state\": \"Kerala\"\n              }\n                },\n                {\n                \"id\": \"address1\",\n                 \"value\": {\n                 \"name\": \"Shiji Mariya\",\n                 \"phone_number\": \"+971569xx543\",\n                 \"in_pin_code\": 680026,\n                 \"house_number\": \"45\",\n                 \"floor_number\": \"3\",\n                \"tower_number\": 34,\n                \"building_name\": \"Excel\",\n                \"address\": \" House\",\n                \"landmark_area\": \"Near Mobile Tower\",\n                \"city\": \"Thrissur\",\n                \"state\": \"Kerala\"\n              }\n                }\n            ]\n           }\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{{recipient}}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"{{report_url}}\"\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://api.d7networks.com/whatsapp/v2/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {{api_token}}")
  .build();
Response response = client.newCall(request).execute();
var headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{api_token}}'
};
var request = http.Request('POST', Uri.parse('https://api.d7networks.com/whatsapp/v2/send'));
request.body = json.encode({
  "messages": [
    {
      "originator": "{registered phone_number}",
      "content": {
        "message_type": "INTERACTIVE",
        "interactive": {
          "type": "address_message",
          "header": {
            "type": "text",
            "text": "Direct7 Networks"
          },
          "body": {
            "text": "Choose one of our service"
          },
          "footer": {
            "text": "Thank you"
          },
          "action": {
            "parameters": {
                  "country": "IN",
                  "values": {
                     "name": "Steni Mariya",
                     "phone_number": "+97156965xxxx",
                     "in_pin_code": 680026,
                     "house_number": "45",
                     "floor_number": "3",
                    "tower_number": 34,
                    "building_name": "Excel",
                    "address": "House name",
                    "landmark_area": "Near Mobile Tower",
                    "city": "Thrissur",
                    "state": "Kerala"
                  },
                "saved_addresses": [
                    {
                    "id": "address1",
                     "value": {
                     "name": "Lifiya Mariya",
                     "phone_number": "+971569xxxxx",
                     "in_pin_code": 680026,
                     "house_number": "45",
                     "floor_number": "3",
                    "tower_number": 34,
                    "building_name": "Excel",
                    "address": "House name",
                    "landmark_area": "Near Mobile Tower",
                    "city": "Thrissur",
                    "state": "Kerala"
                  }
                    },
                    {
                    "id": "address1",
                     "value": {
                     "name": "Mariya",
                     "phone_number": "+971569658xxx",
                     "in_pin_code": 680026,
                     "house_number": "45",
                     "floor_number": "3",
                    "tower_number": 34,
                    "building_name": "Excel",
                    "address": "House name",
                    "landmark_area": "Near Mobile Tower",
                    "city": "Thrissur",
                    "state": "Kerala"
                  }
                    }
                ]
               }
          }
        }
      },
      "recipients": [
        {
          "recipient": "{recipient}",
          "recipient_type": "individual"
        }
      ],
      "report_url": "{{webhook_url}}"
    }
  ]
});
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 {{api_token}}")

$body = @"
{
`"messages`": [
{
`"originator`": `"{registered phone_number}`",
`"content`": {
`"message_type`": `"INTERACTIVE`",
`"interactive`": {
`"type`": `"address_message`",
`"header`": {
`"type`": `"text`",
`"text`": `"Direct7 Networks`"
},
`"body`": {
`"text`": `"Choose one of our service`"
},
`"footer`": {
`"text`": `"Thank you`"
},
`"action`": {
`"parameters`": {
      `"country"`: `"IN"`,
      `"values"`: {
         `"name"`: `"Steni Mariya"`,
         `"phone_number"`: `"+97156965xxxx"`,
         `"in_pin_code"`: 680026,
         `"house_number"`: `"45"`,
         `"floor_number"`: "`3"`,
        `"tower_number"`: 34,
        `"building_name"`: `"Excel"`,
        `"address"`: `"House name"`,
        `"landmark_area"`: `"Near Mobile Tower"`,
        `"city"`: `"Thrissur"`,
        `"state"`: `"Kerala"`
      },
    `"saved_addresses"`: [
        {
        `"id"`: `"address1"`,
         `"value"`: {
         `"name"`: `"Lifiya Mariya"`,
         `"phone_number"`: `"+971569xxxxx"`,
         `"in_pin_code"`: 680026,
         `"house_number"`: `"45"`,
         `"floor_number"`: `"3"`,
        `"tower_number"`: 34,
        `"building_name"`: `"Excel"`,
        `"address"`: `"House name"`,
        `"landmark_area"`: `"Near Mobile Tower"`,
        `"city"`: `"Thrissur"`,
        `"state"`: `"Kerala"`
      }
        },
        {
        `"id"`: `"address1"`,
         `"value"`: {
         `"name"`: `"Mariya"`,
         `"phone_number"`: `"+971569658xxx"`,
         `"in_pin_code"`: 680026,
         `"house_number"`: `"45"`,
         `"floor_number"`: `"3"`,
        `"tower_number"`: 34,
        `"building_name"`: `"Excel"`,
        `"address"`: `"House name"`,
        `"landmark_area"`: `"Near Mobile Tower"`,
        `"city"`: `"Thrissur"`,
        `"state"`: `"Kerala"`
      }
        }
    ]
   }
}
}
},
`"recipients`": [{
`"recipient`": `"{recipient}`",
`"recipient_type`": `"individual`"
}],
`"report_url`": `"{{webhook_url}}`"
}
]
}
"@

$response = Invoke-RestMethod 'https://api.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 = {
      "country": "IN",
      "values": {
         "name": "Steni Mariya",
         "phone_number": "+97156965xxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      },
    "saved_addresses": [
        {
        "id": "address1",
         "value": {
         "name": "Lifiya Mariya",
         "phone_number": "+971569xxxxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        },
        {
        "id": "address1",
         "value": {
         "name": "Mariya",
         "phone_number": "+971569658xxx",
         "in_pin_code": 680026,
         "house_number": "45",
         "floor_number": "3",
        "tower_number": 34,
        "building_name": "Excel",
        "address": "House name",
        "landmark_area": "Near Mobile Tower",
        "city": "Thrissur",
        "state": "Kerala"
      }
        }
    ]
   }
client.whatsapp.send_whatsapp_interactive_message(
    originator='{originator}', 
    recipients=[{ "recipient" => "{recipient}", "recipient_type" => "individual"}],
    interactive_type= "address_message",
    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, sections=nil, 
    buttons=nil, list_button_text=nil
)
1
2
3
4
5
6
7
8
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.d7networks.com/whatsapp/v2/send");
request.Headers.Add("Authorization", "Bearer {{api_token}}");
var content = new StringContent("{\n    \"messages\": [\n        {\n            \"originator\": \"{{originator}}\",\n            \"content\": {\n                \"message_type\": \"INTERACTIVE\",\n            \"interactive\": {\n                \"type\": \"address_message\",\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              \"country\": \"IN\",\n              \"values\": {\n                 \"name\": \"Steni Mariya\",\n                 \"phone_number\": \"+9715696xxxx3\",\n                 \"in_pin_code\": 680026,\n                 \"house_number\": \"45\",\n                 \"floor_number\": \"3\",\n                \"tower_number\": 34,\n                \"building_name\": \"Excel\",\n                \"address\": \" House\",\n                \"landmark_area\": \"Near Mobile Tower\",\n                \"city\": \"Thrissur\",\n                \"state\": \"Kerala\"\n              },\n            \"saved_addresses\": [\n                {\n                \"id\": \"address1\",\n                 \"value\": {\n                 \"name\": \"Lifiya Mariya\",\n                 \"phone_number\": \"+9715696585xx\",\n                 \"in_pin_code\": 680026,\n                 \"house_number\": \"45\",\n                 \"floor_number\": \"3\",\n                \"tower_number\": 34,\n                \"building_name\": \"Excel\",\n                \"address\": \" House\",\n                \"landmark_area\": \"Near Mobile Tower\",\n                \"city\": \"Thrissur\",\n                \"state\": \"Kerala\"\n              }\n                },\n                {\n                \"id\": \"address1\",\n                 \"value\": {\n                 \"name\": \"Shiji Mariya\",\n                 \"phone_number\": \"+971569xx543\",\n                 \"in_pin_code\": 680026,\n                 \"house_number\": \"45\",\n                 \"floor_number\": \"3\",\n                \"tower_number\": 34,\n                \"building_name\": \"Excel\",\n                \"address\": \" House\",\n                \"landmark_area\": \"Near Mobile Tower\",\n                \"city\": \"Thrissur\",\n                \"state\": \"Kerala\"\n              }\n                }\n            ]\n           }\n                }\n            }\n            },\n            \"recipients\": [{\n                \"recipient\": \"{{recipient}}\",\n                \"recipient_type\": \"individual\"\n            }],\n            \"report_url\": \"{{report_url}}\"\n        }\n    ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());