Send Whatsapp Video Message
curl --request POST \
--url https://api.example.com/api/v1/campaign/whatsapp/message/send \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"phoneId": "<string>",
"type": "<string>",
"video": {
"link": "<string>",
"caption": "<string>"
},
"source": "<string>",
"linkWithRecord": true,
"reportURL": "<string>",
"submissionStatus": true
}
'import requests
url = "https://api.example.com/api/v1/campaign/whatsapp/message/send"
payload = {
"to": "<string>",
"phoneId": "<string>",
"type": "<string>",
"video": {
"link": "<string>",
"caption": "<string>"
},
"source": "<string>",
"linkWithRecord": True,
"reportURL": "<string>",
"submissionStatus": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
phoneId: '<string>',
type: '<string>',
video: {link: '<string>', caption: '<string>'},
source: '<string>',
linkWithRecord: true,
reportURL: '<string>',
submissionStatus: true
})
};
fetch('https://api.example.com/api/v1/campaign/whatsapp/message/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/campaign/whatsapp/message/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'phoneId' => '<string>',
'type' => '<string>',
'video' => [
'link' => '<string>',
'caption' => '<string>'
],
'source' => '<string>',
'linkWithRecord' => true,
'reportURL' => '<string>',
'submissionStatus' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/campaign/whatsapp/message/send"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"video\": {\n \"link\": \"<string>\",\n \"caption\": \"<string>\"\n },\n \"source\": \"<string>\",\n \"linkWithRecord\": true,\n \"reportURL\": \"<string>\",\n \"submissionStatus\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/campaign/whatsapp/message/send")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"video\": {\n \"link\": \"<string>\",\n \"caption\": \"<string>\"\n },\n \"source\": \"<string>\",\n \"linkWithRecord\": true,\n \"reportURL\": \"<string>\",\n \"submissionStatus\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/campaign/whatsapp/message/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"video\": {\n \"link\": \"<string>\",\n \"caption\": \"<string>\"\n },\n \"source\": \"<string>\",\n \"linkWithRecord\": true,\n \"reportURL\": \"<string>\",\n \"submissionStatus\": true\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Message sent successfully"
}
{
"status": false,
"message": "Invalid data Provided"
}
{
"status": false,
"message": "Unauthorised"
}
Free-Form / Direct Messages
Send Whatsapp Video Message
POST
/
api
/
v1
/
campaign
/
whatsapp
/
message
/
send
Send Whatsapp Video Message
curl --request POST \
--url https://api.example.com/api/v1/campaign/whatsapp/message/send \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"phoneId": "<string>",
"type": "<string>",
"video": {
"link": "<string>",
"caption": "<string>"
},
"source": "<string>",
"linkWithRecord": true,
"reportURL": "<string>",
"submissionStatus": true
}
'import requests
url = "https://api.example.com/api/v1/campaign/whatsapp/message/send"
payload = {
"to": "<string>",
"phoneId": "<string>",
"type": "<string>",
"video": {
"link": "<string>",
"caption": "<string>"
},
"source": "<string>",
"linkWithRecord": True,
"reportURL": "<string>",
"submissionStatus": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
phoneId: '<string>',
type: '<string>',
video: {link: '<string>', caption: '<string>'},
source: '<string>',
linkWithRecord: true,
reportURL: '<string>',
submissionStatus: true
})
};
fetch('https://api.example.com/api/v1/campaign/whatsapp/message/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/campaign/whatsapp/message/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'phoneId' => '<string>',
'type' => '<string>',
'video' => [
'link' => '<string>',
'caption' => '<string>'
],
'source' => '<string>',
'linkWithRecord' => true,
'reportURL' => '<string>',
'submissionStatus' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/campaign/whatsapp/message/send"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"video\": {\n \"link\": \"<string>\",\n \"caption\": \"<string>\"\n },\n \"source\": \"<string>\",\n \"linkWithRecord\": true,\n \"reportURL\": \"<string>\",\n \"submissionStatus\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/campaign/whatsapp/message/send")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"video\": {\n \"link\": \"<string>\",\n \"caption\": \"<string>\"\n },\n \"source\": \"<string>\",\n \"linkWithRecord\": true,\n \"reportURL\": \"<string>\",\n \"submissionStatus\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/campaign/whatsapp/message/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"video\": {\n \"link\": \"<string>\",\n \"caption\": \"<string>\"\n },\n \"source\": \"<string>\",\n \"linkWithRecord\": true,\n \"reportURL\": \"<string>\",\n \"submissionStatus\": true\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Message sent successfully"
}
{
"status": false,
"message": "Invalid data Provided"
}
{
"status": false,
"message": "Unauthorised"
}
You can send messages only if the user session is already active; otherwise, the messages will fail. We recommend sending a approved template message the first time you contact users. Once the session is open, you can send unlimited messages via these APIs. For more info click here
Body
string
required
Specifies the recipient’s phone number in international format (e.g.,
“1xxxxxxxxxx”).
string
required
This is the unique identifier associated with the sender’s phone number given
by WhatsApp. Find the Phone ID on the Zixflow WhatsApp Settings page next to
the number. Whatsapp
Settings
string
default:"video"
required
To send video messages keep message type as “video”
object
required
A Video Object consists of the following fields and formatting options:
Hide video
Hide video
string
required
Required when type is audio, document, image, sticker, or video and you are not using an uploaded media ID.The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.
string
Optional.Describes the specified image, document, or video. Do not use it with audio or sticker media.
string
default:"API"
If the “linkWithRecord” is set to true, the source from which the WhatsApp
message is sent should be mentioned; otherwise, it defaults to API.
boolean
Specify whether to associate the current message with a record and display it
in the inbox. Set it to “true” for linking with a record; otherwise, it
defaults to “false.”
string
(Optional) Specify the URL where the user’s report and deliveries should be
delivered.
boolean
Indicates whether to wait for the submission status. Set it to “true” if you
want to wait for the submission status; otherwise, it defaults to “false.”
Response
boolean
Indicates whether the call was successful. true if successful, false if not.
string
success or error response message
{
"status": true,
"message": "Message sent successfully"
}
{
"status": false,
"message": "Invalid data Provided"
}
{
"status": false,
"message": "Unauthorised"
}