Enviar Produto / Catálogo
curl --request POST \
--url https://apis.vectalk.com.br/api/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://apis.vectalk.com.br/api/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apis.vectalk.com.br/api/messages', 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://apis.vectalk.com.br/api/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apis.vectalk.com.br/api/messages"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apis.vectalk.com.br/api/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.vectalk.com.br/api/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyMensagens
Enviar Produto / Catálogo
Envia mensagens interativas de produto único, multi-produto ou catálogo via WhatsApp.
POST
/
messages
Enviar Produto / Catálogo
curl --request POST \
--url https://apis.vectalk.com.br/api/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://apis.vectalk.com.br/api/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apis.vectalk.com.br/api/messages', 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://apis.vectalk.com.br/api/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apis.vectalk.com.br/api/messages"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apis.vectalk.com.br/api/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.vectalk.com.br/api/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyProduto Único
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "5511999999999",
"type": "interactive",
"interactive": {
"type": "product",
"body": {
"text": "Confira este produto!"
},
"footer": {
"text": "Promoção por tempo limitado"
},
"action": {
"catalog_id": "367025965434465",
"product_retailer_id": "SKU_001"
}
}
}
Multi-Produto
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "5511999999999",
"type": "interactive",
"interactive": {
"type": "product_list",
"header": {
"type": "text",
"text": "Nossos Produtos"
},
"body": {
"text": "Confira nosso catálogo"
},
"footer": {
"text": "Preços sujeitos a alteração"
},
"action": {
"catalog_id": "146265584024623",
"sections": [
{
"title": "Eletrônicos",
"product_items": [
{ "product_retailer_id": "SKU_001" },
{ "product_retailer_id": "SKU_002" }
]
},
{
"title": "Acessórios",
"product_items": [
{ "product_retailer_id": "SKU_003" }
]
}
]
}
}
}
Mensagem de Catálogo
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "5511999999999",
"type": "interactive",
"interactive": {
"type": "catalog_message",
"body": {
"text": "Confira nosso catálogo completo e adicione itens ao carrinho."
},
"action": {
"name": "catalog_message",
"parameters": {
"thumbnail_product_retailer_id": "SKU_001"
}
}
}
}
Resposta
{
"messaging_product": "whatsapp",
"contacts": [{ "input": "5511999999999", "wa_id": "5511999999999" }],
"messages": [{ "id": "wamid.HBgLNTUxMTk5OTk5OTk5..." }]
}
⌘I