curl --location --request POST 'https://api.zixflow.com/api/v1/campaign/whatsapp/send' \
--header 'Authorization: Bearer {{zixflow_api_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video":"http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": true
}'
var axios = require("axios");
var data = JSON.stringify({
to: "13023895111",
phoneId: "104898309288724",
templateName: "marketing_sample_2",
language: "en",
variables: {
video: "http://techslides.com/demos/sample-videos/small.mp4",
},
submissionStatus: true,
});
var config = {
method: "post",
url: "https://api.zixflow.com/api/v1/campaign/whatsapp/send",
headers: {
Authorization: "Bearer {{zixflow_api_key}}",
"Content-Type": "application/json",
},
data: data,
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://api.zixflow.com/api/v1/campaign/whatsapp/send"
payload = json.dumps({
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video": "http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": True
})
headers = {
'Authorization': 'Bearer {{zixflow_api_key}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"to\": \"13023895111\",\n \"phoneId\": \"104898309288724\",\n \"templateName\": \"marketing_sample_2\",\n \"language\": \"en\",\n \"variables\": {\n \"video\":\"http://techslides.com/demos/sample-videos/small.mp4\"\n },\n \"submissionStatus\": true\n}");
Request request = new Request.Builder()
.url("https://api.zixflow.com/api/v1/campaign/whatsapp/send")
.method("POST", body)
.addHeader("Authorization", "Bearer {{zixflow_api_key}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var headers = {
'Authorization': 'Bearer {{zixflow_api_key}}',
'Content-Type': 'application/json'
};
var request = http.Request('POST', Uri.parse('https://api.zixflow.com/api/v1/campaign/whatsapp/send'));
request.body = json.encode({
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video": "http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": true
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
{
"status": true,
"message": "Message sent successfully"
}
{
"status": false,
"message": "Invalid data Provided"
}
{
"status": false,
"message": "Unauthorised"
}
Whatsapp Campaign
Send Whatsapp Template Message
POST
/
api
/
v1
/
campaign
/
whatsapp
/
send
curl --location --request POST 'https://api.zixflow.com/api/v1/campaign/whatsapp/send' \
--header 'Authorization: Bearer {{zixflow_api_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video":"http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": true
}'
var axios = require("axios");
var data = JSON.stringify({
to: "13023895111",
phoneId: "104898309288724",
templateName: "marketing_sample_2",
language: "en",
variables: {
video: "http://techslides.com/demos/sample-videos/small.mp4",
},
submissionStatus: true,
});
var config = {
method: "post",
url: "https://api.zixflow.com/api/v1/campaign/whatsapp/send",
headers: {
Authorization: "Bearer {{zixflow_api_key}}",
"Content-Type": "application/json",
},
data: data,
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://api.zixflow.com/api/v1/campaign/whatsapp/send"
payload = json.dumps({
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video": "http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": True
})
headers = {
'Authorization': 'Bearer {{zixflow_api_key}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"to\": \"13023895111\",\n \"phoneId\": \"104898309288724\",\n \"templateName\": \"marketing_sample_2\",\n \"language\": \"en\",\n \"variables\": {\n \"video\":\"http://techslides.com/demos/sample-videos/small.mp4\"\n },\n \"submissionStatus\": true\n}");
Request request = new Request.Builder()
.url("https://api.zixflow.com/api/v1/campaign/whatsapp/send")
.method("POST", body)
.addHeader("Authorization", "Bearer {{zixflow_api_key}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var headers = {
'Authorization': 'Bearer {{zixflow_api_key}}',
'Content-Type': 'application/json'
};
var request = http.Request('POST', Uri.parse('https://api.zixflow.com/api/v1/campaign/whatsapp/send'));
request.body = json.encode({
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video": "http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": true
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
{
"status": true,
"message": "Message sent successfully"
}
{
"status": false,
"message": "Invalid data Provided"
}
{
"status": false,
"message": "Unauthorised"
}
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
required
Refers to the name of the template to be used for the WhatsApp message. In
this case, it is set to “hello_world.” You can obtain it from the template
list screen.
string
required
Specifies the language of the message, with “en_US” representing American
English. You can get it from the template list screen.
object
required
Custom variables used for the template. Please provide a JSON object with the
required data.
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
Variables
To know all required variable and their keys for selected template, use above Get Template Variable API. It will return response as{
"status": true,
"message": "Success",
"data": [
{
"label": "Header Image",
"keyName": "image",
"type": "IMAGE_URL"
},
{
"label": "Body 1",
"keyName": "body_1",
"type": "TEXT"
}
]
}
| type | sample value |
|---|---|
| IMAGE_URL | <image-url> |
| VIDEO_URL | <video-url> |
| DOCUMENT_URL | <document-url> |
| TEXT | <text> |
| OTP | <otp> |
{
variables:{
"image": "<image-url>",
"body_1": "<variable-text>"
....
[keyName]:"<variable-value>"
}
}
curl --location --request POST 'https://api.zixflow.com/api/v1/campaign/whatsapp/send' \
--header 'Authorization: Bearer {{zixflow_api_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video":"http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": true
}'
var axios = require("axios");
var data = JSON.stringify({
to: "13023895111",
phoneId: "104898309288724",
templateName: "marketing_sample_2",
language: "en",
variables: {
video: "http://techslides.com/demos/sample-videos/small.mp4",
},
submissionStatus: true,
});
var config = {
method: "post",
url: "https://api.zixflow.com/api/v1/campaign/whatsapp/send",
headers: {
Authorization: "Bearer {{zixflow_api_key}}",
"Content-Type": "application/json",
},
data: data,
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://api.zixflow.com/api/v1/campaign/whatsapp/send"
payload = json.dumps({
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video": "http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": True
})
headers = {
'Authorization': 'Bearer {{zixflow_api_key}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"to\": \"13023895111\",\n \"phoneId\": \"104898309288724\",\n \"templateName\": \"marketing_sample_2\",\n \"language\": \"en\",\n \"variables\": {\n \"video\":\"http://techslides.com/demos/sample-videos/small.mp4\"\n },\n \"submissionStatus\": true\n}");
Request request = new Request.Builder()
.url("https://api.zixflow.com/api/v1/campaign/whatsapp/send")
.method("POST", body)
.addHeader("Authorization", "Bearer {{zixflow_api_key}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var headers = {
'Authorization': 'Bearer {{zixflow_api_key}}',
'Content-Type': 'application/json'
};
var request = http.Request('POST', Uri.parse('https://api.zixflow.com/api/v1/campaign/whatsapp/send'));
request.body = json.encode({
"to": "13023895111",
"phoneId": "104898309288724",
"templateName": "marketing_sample_2",
"language": "en",
"variables": {
"video": "http://techslides.com/demos/sample-videos/small.mp4"
},
"submissionStatus": true
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
{
"status": true,
"message": "Message sent successfully"
}
{
"status": false,
"message": "Invalid data Provided"
}
{
"status": false,
"message": "Unauthorised"
}
⌘I