Send Whatsapp Image Message
curl --request POST \
--url https://api.zixflow.com/api/v1/campaign/whatsapp/message/send \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"phoneId": "<string>",
"type": "<string>",
"image": {
"link": "<string>",
"caption": "<string>"
},
"source": "<string>",
"linkWithRecord": true,
"reportURL": "<string>",
"submissionStatus": true
}
'import requests
url = "https://api.zixflow.com/api/v1/campaign/whatsapp/message/send"
payload = {
"to": "<string>",
"phoneId": "<string>",
"type": "<string>",
"image": {
"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>',
image: {link: '<string>', caption: '<string>'},
source: '<string>',
linkWithRecord: true,
reportURL: '<string>',
submissionStatus: true
})
};
fetch('https://api.zixflow.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.zixflow.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>',
'image' => [
'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.zixflow.com/api/v1/campaign/whatsapp/message/send"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"image\": {\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.zixflow.com/api/v1/campaign/whatsapp/message/send")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"image\": {\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.zixflow.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 \"image\": {\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 Image Message
POST
/
api
/
v1
/
campaign
/
whatsapp
/
message
/
send
Send Whatsapp Image Message
curl --request POST \
--url https://api.zixflow.com/api/v1/campaign/whatsapp/message/send \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"phoneId": "<string>",
"type": "<string>",
"image": {
"link": "<string>",
"caption": "<string>"
},
"source": "<string>",
"linkWithRecord": true,
"reportURL": "<string>",
"submissionStatus": true
}
'import requests
url = "https://api.zixflow.com/api/v1/campaign/whatsapp/message/send"
payload = {
"to": "<string>",
"phoneId": "<string>",
"type": "<string>",
"image": {
"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>',
image: {link: '<string>', caption: '<string>'},
source: '<string>',
linkWithRecord: true,
reportURL: '<string>',
submissionStatus: true
})
};
fetch('https://api.zixflow.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.zixflow.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>',
'image' => [
'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.zixflow.com/api/v1/campaign/whatsapp/message/send"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"image\": {\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.zixflow.com/api/v1/campaign/whatsapp/message/send")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"phoneId\": \"<string>\",\n \"type\": \"<string>\",\n \"image\": {\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.zixflow.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 \"image\": {\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
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
If the “linkWithRecord” is set to true, the source from which the WhatsApp message is sent should be mentioned; otherwise, it defaults to API.
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.”
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
{
"status": true,
"message": "Message sent successfully"
}
{
"status": false,
"message": "Invalid data Provided"
}
{
"status": false,
"message": "Unauthorised"
}