Criar QR Code
curl --request POST \
--url https://apis.vectalk.com.br/api/qr-codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prefilled_message": "<string>",
"generate_qr_image": "<string>"
}
'import requests
url = "https://apis.vectalk.com.br/api/qr-codes"
payload = {
"prefilled_message": "<string>",
"generate_qr_image": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({prefilled_message: '<string>', generate_qr_image: '<string>'})
};
fetch('https://apis.vectalk.com.br/api/qr-codes', 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/qr-codes",
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([
'prefilled_message' => '<string>',
'generate_qr_image' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://apis.vectalk.com.br/api/qr-codes"
payload := strings.NewReader("{\n \"prefilled_message\": \"<string>\",\n \"generate_qr_image\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://apis.vectalk.com.br/api/qr-codes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prefilled_message\": \"<string>\",\n \"generate_qr_image\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.vectalk.com.br/api/qr-codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prefilled_message\": \"<string>\",\n \"generate_qr_image\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyQR Codes
Criar QR Code
Cria um novo QR Code vinculado a um número de telefone com uma mensagem pré-preenchida.
POST
/
qr-codes
Criar QR Code
curl --request POST \
--url https://apis.vectalk.com.br/api/qr-codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prefilled_message": "<string>",
"generate_qr_image": "<string>"
}
'import requests
url = "https://apis.vectalk.com.br/api/qr-codes"
payload = {
"prefilled_message": "<string>",
"generate_qr_image": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({prefilled_message: '<string>', generate_qr_image: '<string>'})
};
fetch('https://apis.vectalk.com.br/api/qr-codes', 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/qr-codes",
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([
'prefilled_message' => '<string>',
'generate_qr_image' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://apis.vectalk.com.br/api/qr-codes"
payload := strings.NewReader("{\n \"prefilled_message\": \"<string>\",\n \"generate_qr_image\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://apis.vectalk.com.br/api/qr-codes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prefilled_message\": \"<string>\",\n \"generate_qr_image\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.vectalk.com.br/api/qr-codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prefilled_message\": \"<string>\",\n \"generate_qr_image\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRequer token de instância associado ao número de telefone. O número é resolvido automaticamente pelo token — não é necessário informar o
phone-number-id.Parâmetros
Body
string
required
Mensagem que será pré-preenchida automaticamente quando o usuário escanear o QR Code.
string
Formato da imagem do QR Code a ser gerada. Valores aceitos:
PNG ou SVG. Padrão: SVG.Resposta
{
"code": "ABC123XYZ",
"prefilled_message": "Olá, gostaria de saber mais informações.",
"deep_link_url": "https://wa.me/message/ABC123XYZ",
"qr_image_url": "https://scontent.example.com/qr/ABC123XYZ.png"
}
⌘I