Send a single message
curl --request POST \
--url https://api.vazapay.com/v1/zaap/message \
--header 'Content-Type: application/json' \
--header 'z-api-key: <api-key>' \
--data '
{
"text": "<string>",
"to": {
"whatsapp": "<string>",
"telegram": "<string>",
"sms": "<string>"
}
}
'import requests
url = "https://api.vazapay.com/v1/zaap/message"
payload = {
"text": "<string>",
"to": {
"whatsapp": "<string>",
"telegram": "<string>",
"sms": "<string>"
}
}
headers = {
"z-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'z-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
to: {whatsapp: '<string>', telegram: '<string>', sms: '<string>'}
})
};
fetch('https://api.vazapay.com/v1/zaap/message', 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.vazapay.com/v1/zaap/message",
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([
'text' => '<string>',
'to' => [
'whatsapp' => '<string>',
'telegram' => '<string>',
'sms' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"z-api-key: <api-key>"
],
]);
$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.vazapay.com/v1/zaap/message"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"to\": {\n \"whatsapp\": \"<string>\",\n \"telegram\": \"<string>\",\n \"sms\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("z-api-key", "<api-key>")
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.vazapay.com/v1/zaap/message")
.header("z-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"to\": {\n \"whatsapp\": \"<string>\",\n \"telegram\": \"<string>\",\n \"sms\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vazapay.com/v1/zaap/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["z-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"to\": {\n \"whatsapp\": \"<string>\",\n \"telegram\": \"<string>\",\n \"sms\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "created",
"message_id": "xxxxxxxxxxx",
"created_at": "2023-10-05 02:22:11"
}
message
Send a single message
Use this endpoint to send a single message to one or more messaging channels e.g whatsapp, telegram
POST
/
v1
/
zaap
/
message
Send a single message
curl --request POST \
--url https://api.vazapay.com/v1/zaap/message \
--header 'Content-Type: application/json' \
--header 'z-api-key: <api-key>' \
--data '
{
"text": "<string>",
"to": {
"whatsapp": "<string>",
"telegram": "<string>",
"sms": "<string>"
}
}
'import requests
url = "https://api.vazapay.com/v1/zaap/message"
payload = {
"text": "<string>",
"to": {
"whatsapp": "<string>",
"telegram": "<string>",
"sms": "<string>"
}
}
headers = {
"z-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'z-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
to: {whatsapp: '<string>', telegram: '<string>', sms: '<string>'}
})
};
fetch('https://api.vazapay.com/v1/zaap/message', 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.vazapay.com/v1/zaap/message",
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([
'text' => '<string>',
'to' => [
'whatsapp' => '<string>',
'telegram' => '<string>',
'sms' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"z-api-key: <api-key>"
],
]);
$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.vazapay.com/v1/zaap/message"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"to\": {\n \"whatsapp\": \"<string>\",\n \"telegram\": \"<string>\",\n \"sms\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("z-api-key", "<api-key>")
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.vazapay.com/v1/zaap/message")
.header("z-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"to\": {\n \"whatsapp\": \"<string>\",\n \"telegram\": \"<string>\",\n \"sms\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vazapay.com/v1/zaap/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["z-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"to\": {\n \"whatsapp\": \"<string>\",\n \"telegram\": \"<string>\",\n \"sms\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "created",
"message_id": "xxxxxxxxxxx",
"created_at": "2023-10-05 02:22:11"
}
Body
string
required
This is text that will be sent.
object
required
Each key in this object represents a recipient channel and their identifier.
You can specify one or all channels you have configured.
Response
string
The timestamp this message was sent
string
The refrence id of the message request. This will be used to identify the
message
string
The status of the messageAvailable options:
created, failed, success- created - A message has been created and is wating to be delivered.
- failed - A message failed to be delivered to one or more channels.
- success - A messages was successfully delivered to all channels.
{
"status": "created",
"message_id": "xxxxxxxxxxx",
"created_at": "2023-10-05 02:22:11"
}
⌘I