Messages
Send up to 100 WhatsApp messages
Queues up to 100 messages in one call. Each item has the same shape as the single-send body and can go to a different recipient, with different content. The response lists one result per item, in order.
POST
/
devapi
/
accounts
/
{accountId}
/
messages
/
whatsapp
/
bulk
Send up to 100 WhatsApp messages
curl --request POST \
--url https://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--header 'apiSecret: <api-key>' \
--data '
{
"bulk": [
{
"channelId": "6650a1b2c3d4e5f6a7b8c9d0",
"recipient": {
"phone": "<string>",
"identifier": "<string>",
"name": "<string>",
"tags": [
{
"name": "<string>"
}
]
},
"whatsapp": {
"image": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"video": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"audio": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"document": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"sticker": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"contacts": [
{}
]
},
"localMessageId": "<string>",
"botId": "6650a1b2c3d4e5f6a7b8c9d0",
"context": {},
"replyTo": {
"assigneeId": "6650a1b2c3d4e5f6a7b8c9d0"
},
"retryConfig": {
"smart": {
"maxDate": "2023-11-07T05:31:56Z"
},
"manual": {
"timestamps": [
"2023-11-07T05:31:56Z"
]
}
}
}
]
}
'import requests
url = "https://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk"
payload = { "bulk": [
{
"channelId": "6650a1b2c3d4e5f6a7b8c9d0",
"recipient": {
"phone": "<string>",
"identifier": "<string>",
"name": "<string>",
"tags": [{ "name": "<string>" }]
},
"whatsapp": {
"image": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"video": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"audio": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"document": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"sticker": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"contacts": [{}]
},
"localMessageId": "<string>",
"botId": "6650a1b2c3d4e5f6a7b8c9d0",
"context": {},
"replyTo": { "assigneeId": "6650a1b2c3d4e5f6a7b8c9d0" },
"retryConfig": {
"smart": { "maxDate": "2023-11-07T05:31:56Z" },
"manual": { "timestamps": ["2023-11-07T05:31:56Z"] }
}
}
] }
headers = {
"apiKey": "<api-key>",
"apiSecret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
apiKey: '<api-key>',
apiSecret: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bulk: [
{
channelId: '6650a1b2c3d4e5f6a7b8c9d0',
recipient: {
phone: '<string>',
identifier: '<string>',
name: '<string>',
tags: [{name: '<string>'}]
},
whatsapp: {
image: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
video: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
audio: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
document: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
sticker: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
contacts: [{}]
},
localMessageId: '<string>',
botId: '6650a1b2c3d4e5f6a7b8c9d0',
context: {},
replyTo: {assigneeId: '6650a1b2c3d4e5f6a7b8c9d0'},
retryConfig: {
smart: {maxDate: '2023-11-07T05:31:56Z'},
manual: {timestamps: ['2023-11-07T05:31:56Z']}
}
}
]
})
};
fetch('https://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk', 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://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk",
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([
'bulk' => [
[
'channelId' => '6650a1b2c3d4e5f6a7b8c9d0',
'recipient' => [
'phone' => '<string>',
'identifier' => '<string>',
'name' => '<string>',
'tags' => [
[
'name' => '<string>'
]
]
],
'whatsapp' => [
'image' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'video' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'audio' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'document' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'sticker' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'contacts' => [
[
]
]
],
'localMessageId' => '<string>',
'botId' => '6650a1b2c3d4e5f6a7b8c9d0',
'context' => [
],
'replyTo' => [
'assigneeId' => '6650a1b2c3d4e5f6a7b8c9d0'
],
'retryConfig' => [
'smart' => [
'maxDate' => '2023-11-07T05:31:56Z'
],
'manual' => [
'timestamps' => [
'2023-11-07T05:31:56Z'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apiKey: <api-key>",
"apiSecret: <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://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk"
payload := strings.NewReader("{\n \"bulk\": [\n {\n \"channelId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"recipient\": {\n \"phone\": \"<string>\",\n \"identifier\": \"<string>\",\n \"name\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\"\n }\n ]\n },\n \"whatsapp\": {\n \"image\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"video\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"audio\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"document\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"sticker\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"contacts\": [\n {}\n ]\n },\n \"localMessageId\": \"<string>\",\n \"botId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"context\": {},\n \"replyTo\": {\n \"assigneeId\": \"6650a1b2c3d4e5f6a7b8c9d0\"\n },\n \"retryConfig\": {\n \"smart\": {\n \"maxDate\": \"2023-11-07T05:31:56Z\"\n },\n \"manual\": {\n \"timestamps\": [\n \"2023-11-07T05:31:56Z\"\n ]\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apiKey", "<api-key>")
req.Header.Add("apiSecret", "<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://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk")
.header("apiKey", "<api-key>")
.header("apiSecret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"bulk\": [\n {\n \"channelId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"recipient\": {\n \"phone\": \"<string>\",\n \"identifier\": \"<string>\",\n \"name\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\"\n }\n ]\n },\n \"whatsapp\": {\n \"image\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"video\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"audio\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"document\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"sticker\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"contacts\": [\n {}\n ]\n },\n \"localMessageId\": \"<string>\",\n \"botId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"context\": {},\n \"replyTo\": {\n \"assigneeId\": \"6650a1b2c3d4e5f6a7b8c9d0\"\n },\n \"retryConfig\": {\n \"smart\": {\n \"maxDate\": \"2023-11-07T05:31:56Z\"\n },\n \"manual\": {\n \"timestamps\": [\n \"2023-11-07T05:31:56Z\"\n ]\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apiKey"] = '<api-key>'
request["apiSecret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bulk\": [\n {\n \"channelId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"recipient\": {\n \"phone\": \"<string>\",\n \"identifier\": \"<string>\",\n \"name\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\"\n }\n ]\n },\n \"whatsapp\": {\n \"image\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"video\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"audio\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"document\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"sticker\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"contacts\": [\n {}\n ]\n },\n \"localMessageId\": \"<string>\",\n \"botId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"context\": {},\n \"replyTo\": {\n \"assigneeId\": \"6650a1b2c3d4e5f6a7b8c9d0\"\n },\n \"retryConfig\": {\n \"smart\": {\n \"maxDate\": \"2023-11-07T05:31:56Z\"\n },\n \"manual\": {\n \"timestamps\": [\n \"2023-11-07T05:31:56Z\"\n ]\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"bulk": [
{
"id": "order-1042-confirmation",
"meta": {
"phone": "919876543210"
},
"status": "QUEUED",
"message": "Message queued and being sent to recipient"
}
]
}Authorizations
Path Parameters
Body
application/json
⌘I
Send up to 100 WhatsApp messages
curl --request POST \
--url https://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--header 'apiSecret: <api-key>' \
--data '
{
"bulk": [
{
"channelId": "6650a1b2c3d4e5f6a7b8c9d0",
"recipient": {
"phone": "<string>",
"identifier": "<string>",
"name": "<string>",
"tags": [
{
"name": "<string>"
}
]
},
"whatsapp": {
"image": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"video": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"audio": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"document": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"sticker": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"contacts": [
{}
]
},
"localMessageId": "<string>",
"botId": "6650a1b2c3d4e5f6a7b8c9d0",
"context": {},
"replyTo": {
"assigneeId": "6650a1b2c3d4e5f6a7b8c9d0"
},
"retryConfig": {
"smart": {
"maxDate": "2023-11-07T05:31:56Z"
},
"manual": {
"timestamps": [
"2023-11-07T05:31:56Z"
]
}
}
}
]
}
'import requests
url = "https://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk"
payload = { "bulk": [
{
"channelId": "6650a1b2c3d4e5f6a7b8c9d0",
"recipient": {
"phone": "<string>",
"identifier": "<string>",
"name": "<string>",
"tags": [{ "name": "<string>" }]
},
"whatsapp": {
"image": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"video": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"audio": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"document": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"sticker": {
"link": "<string>",
"id": "<string>",
"caption": "<string>",
"filename": "<string>"
},
"contacts": [{}]
},
"localMessageId": "<string>",
"botId": "6650a1b2c3d4e5f6a7b8c9d0",
"context": {},
"replyTo": { "assigneeId": "6650a1b2c3d4e5f6a7b8c9d0" },
"retryConfig": {
"smart": { "maxDate": "2023-11-07T05:31:56Z" },
"manual": { "timestamps": ["2023-11-07T05:31:56Z"] }
}
}
] }
headers = {
"apiKey": "<api-key>",
"apiSecret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
apiKey: '<api-key>',
apiSecret: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bulk: [
{
channelId: '6650a1b2c3d4e5f6a7b8c9d0',
recipient: {
phone: '<string>',
identifier: '<string>',
name: '<string>',
tags: [{name: '<string>'}]
},
whatsapp: {
image: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
video: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
audio: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
document: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
sticker: {link: '<string>', id: '<string>', caption: '<string>', filename: '<string>'},
contacts: [{}]
},
localMessageId: '<string>',
botId: '6650a1b2c3d4e5f6a7b8c9d0',
context: {},
replyTo: {assigneeId: '6650a1b2c3d4e5f6a7b8c9d0'},
retryConfig: {
smart: {maxDate: '2023-11-07T05:31:56Z'},
manual: {timestamps: ['2023-11-07T05:31:56Z']}
}
}
]
})
};
fetch('https://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk', 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://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk",
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([
'bulk' => [
[
'channelId' => '6650a1b2c3d4e5f6a7b8c9d0',
'recipient' => [
'phone' => '<string>',
'identifier' => '<string>',
'name' => '<string>',
'tags' => [
[
'name' => '<string>'
]
]
],
'whatsapp' => [
'image' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'video' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'audio' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'document' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'sticker' => [
'link' => '<string>',
'id' => '<string>',
'caption' => '<string>',
'filename' => '<string>'
],
'contacts' => [
[
]
]
],
'localMessageId' => '<string>',
'botId' => '6650a1b2c3d4e5f6a7b8c9d0',
'context' => [
],
'replyTo' => [
'assigneeId' => '6650a1b2c3d4e5f6a7b8c9d0'
],
'retryConfig' => [
'smart' => [
'maxDate' => '2023-11-07T05:31:56Z'
],
'manual' => [
'timestamps' => [
'2023-11-07T05:31:56Z'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apiKey: <api-key>",
"apiSecret: <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://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk"
payload := strings.NewReader("{\n \"bulk\": [\n {\n \"channelId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"recipient\": {\n \"phone\": \"<string>\",\n \"identifier\": \"<string>\",\n \"name\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\"\n }\n ]\n },\n \"whatsapp\": {\n \"image\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"video\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"audio\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"document\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"sticker\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"contacts\": [\n {}\n ]\n },\n \"localMessageId\": \"<string>\",\n \"botId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"context\": {},\n \"replyTo\": {\n \"assigneeId\": \"6650a1b2c3d4e5f6a7b8c9d0\"\n },\n \"retryConfig\": {\n \"smart\": {\n \"maxDate\": \"2023-11-07T05:31:56Z\"\n },\n \"manual\": {\n \"timestamps\": [\n \"2023-11-07T05:31:56Z\"\n ]\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apiKey", "<api-key>")
req.Header.Add("apiSecret", "<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://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk")
.header("apiKey", "<api-key>")
.header("apiSecret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"bulk\": [\n {\n \"channelId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"recipient\": {\n \"phone\": \"<string>\",\n \"identifier\": \"<string>\",\n \"name\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\"\n }\n ]\n },\n \"whatsapp\": {\n \"image\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"video\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"audio\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"document\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"sticker\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"contacts\": [\n {}\n ]\n },\n \"localMessageId\": \"<string>\",\n \"botId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"context\": {},\n \"replyTo\": {\n \"assigneeId\": \"6650a1b2c3d4e5f6a7b8c9d0\"\n },\n \"retryConfig\": {\n \"smart\": {\n \"maxDate\": \"2023-11-07T05:31:56Z\"\n },\n \"manual\": {\n \"timestamps\": [\n \"2023-11-07T05:31:56Z\"\n ]\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.gallabox.com/devapi/accounts/{accountId}/messages/whatsapp/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apiKey"] = '<api-key>'
request["apiSecret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bulk\": [\n {\n \"channelId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"recipient\": {\n \"phone\": \"<string>\",\n \"identifier\": \"<string>\",\n \"name\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\"\n }\n ]\n },\n \"whatsapp\": {\n \"image\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"video\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"audio\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"document\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"sticker\": {\n \"link\": \"<string>\",\n \"id\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"contacts\": [\n {}\n ]\n },\n \"localMessageId\": \"<string>\",\n \"botId\": \"6650a1b2c3d4e5f6a7b8c9d0\",\n \"context\": {},\n \"replyTo\": {\n \"assigneeId\": \"6650a1b2c3d4e5f6a7b8c9d0\"\n },\n \"retryConfig\": {\n \"smart\": {\n \"maxDate\": \"2023-11-07T05:31:56Z\"\n },\n \"manual\": {\n \"timestamps\": [\n \"2023-11-07T05:31:56Z\"\n ]\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"bulk": [
{
"id": "order-1042-confirmation",
"meta": {
"phone": "919876543210"
},
"status": "QUEUED",
"message": "Message queued and being sent to recipient"
}
]
}