Consultar a permissão de ligação de um contato
curl --request GET \
--url https://api.zapperhub.com/{instanceId}/calls/permissions \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zapperhub.com/{instanceId}/calls/permissions"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.zapperhub.com/{instanceId}/calls/permissions', 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.zapperhub.com/{instanceId}/calls/permissions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-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"
"net/http"
"io"
)
func main() {
url := "https://api.zapperhub.com/{instanceId}/calls/permissions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zapperhub.com/{instanceId}/calls/permissions")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapperhub.com/{instanceId}/calls/permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"callingEnabled": true,
"permission": {
"status": "none",
"expiresAt": "<string>"
},
"serviceWindowOpen": true,
"canCall": true,
"canRequestPermission": true,
"limits": {
"call": [
{
"period": "<string>",
"max": 123,
"used": 123,
"resetsAt": "<string>"
}
],
"permissionRequest": [
{
"period": "<string>",
"max": 123,
"used": 123,
"resetsAt": "<string>"
}
]
}
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}Chamadas
Consultar a permissão de ligação de um contato
Informa se o contato concedeu permissão para receber ligações do número, se a janela de atendimento de 24 horas está aberta e os limites da Meta para ligar e para pedir a permissão. Disponível apenas para instâncias cloud_api.
GET
/
{instanceId}
/
calls
/
permissions
Consultar a permissão de ligação de um contato
curl --request GET \
--url https://api.zapperhub.com/{instanceId}/calls/permissions \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zapperhub.com/{instanceId}/calls/permissions"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.zapperhub.com/{instanceId}/calls/permissions', 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.zapperhub.com/{instanceId}/calls/permissions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-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"
"net/http"
"io"
)
func main() {
url := "https://api.zapperhub.com/{instanceId}/calls/permissions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zapperhub.com/{instanceId}/calls/permissions")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapperhub.com/{instanceId}/calls/permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"callingEnabled": true,
"permission": {
"status": "none",
"expiresAt": "<string>"
},
"serviceWindowOpen": true,
"canCall": true,
"canRequestPermission": true,
"limits": {
"call": [
{
"period": "<string>",
"max": 123,
"used": 123,
"resetsAt": "<string>"
}
],
"permissionRequest": [
{
"period": "<string>",
"max": 123,
"used": 123,
"resetsAt": "<string>"
}
]
}
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"error": "<string>",
"statusCode": 0,
"code": "<string>",
"detail": "<string>",
"meta": {
"code": 123,
"subcode": 123,
"title": "<string>",
"message": "<string>"
},
"localizedMessage": "<string>",
"data": {},
"validation": [
{
"keyword": "<string>",
"instancePath": "<string>",
"schemaPath": "<string>",
"message": "<string>",
"params": {}
}
]
}Parâmetros de consulta
Número de telefone, LID, BSUID ou id do grupo. Em caso de número
de telefone, o mesmo deve ser enviado no formato completo, com código do
país, e o prefixo + não é obrigatório. Números de telefone podem ser
ou não pós-fixados com @s.whatsapp.net. Em caso de grupo, o id deve
ser enviado acrescido de @g.us.
Exemplos de uso correto:
+5511912345678
5511912345678
[email protected]
[email protected]
Em caso de LID, que é um código interno do WhatsApp utilizado para proteger
a privacidade dos usuários e não exibir o número do telefone, o mesmo deve
ser enviado no formato completo, com o sufixo `@lid`.
BSUID: Código interno do WhatsApp utilizado para proteger a privacidade dos usuários,
formato BR.XXXXXXXXX, onde BR é o código do país de origem do contato e
XXXXXXXXX é o código interno do contato (único por BM).
Username: na Cloud API, o username do WhatsApp do contato (com ou sem o `@`
inicial) também é aceito, desde que o contato já tenha escrito para a empresa.
O username é resolvido pelo telefone ou BSUID guardados; sem vínculo, a
resposta é `404` com `code: CONTACT_NOT_FOUND`.
Minimum string length:
1Resposta
Default Response