Originar chamada ao vivo
curl --request POST \
--url https://api.zapperhub.com/{instanceId}/softphone/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jid": "<string>",
"record": false
}
'import requests
url = "https://api.zapperhub.com/{instanceId}/softphone/calls"
payload = {
"jid": "<string>",
"record": False
}
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({jid: '<string>', record: false})
};
fetch('https://api.zapperhub.com/{instanceId}/softphone/calls', 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}/softphone/calls",
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([
'jid' => '<string>',
'record' => false
]),
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://api.zapperhub.com/{instanceId}/softphone/calls"
payload := strings.NewReader("{\n \"jid\": \"<string>\",\n \"record\": false\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://api.zapperhub.com/{instanceId}/softphone/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jid\": \"<string>\",\n \"record\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapperhub.com/{instanceId}/softphone/calls")
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 \"jid\": \"<string>\",\n \"record\": false\n}"
response = http.request(request)
puts response.read_body{
"callId": "<string>",
"state": "RINGING",
"direction": "USER_INITIATED",
"recording": {
"requested": true,
"granted": true,
"reason": "DAILY_QUOTA_REACHED"
},
"agent": {
"id": "<string>",
"displayName": "<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": {}
}
]
}Softphone
Originar chamada ao vivo
Origina uma chamada de voz conduzida ao vivo pelo atendente. Chamada pelo componente embutido, com a credencial de curta duração do atendente no cabeçalho Authorization: Bearer. Na conexão não oficial, a instância conduz no máximo uma chamada por vez. Na conexão oficial (Cloud API), cada atendente conduz uma chamada, e o contato precisa ter concedido a permissão de ligação.
POST
/
{instanceId}
/
softphone
/
calls
Originar chamada ao vivo
curl --request POST \
--url https://api.zapperhub.com/{instanceId}/softphone/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jid": "<string>",
"record": false
}
'import requests
url = "https://api.zapperhub.com/{instanceId}/softphone/calls"
payload = {
"jid": "<string>",
"record": False
}
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({jid: '<string>', record: false})
};
fetch('https://api.zapperhub.com/{instanceId}/softphone/calls', 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}/softphone/calls",
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([
'jid' => '<string>',
'record' => false
]),
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://api.zapperhub.com/{instanceId}/softphone/calls"
payload := strings.NewReader("{\n \"jid\": \"<string>\",\n \"record\": false\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://api.zapperhub.com/{instanceId}/softphone/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jid\": \"<string>\",\n \"record\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapperhub.com/{instanceId}/softphone/calls")
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 \"jid\": \"<string>\",\n \"record\": false\n}"
response = http.request(request)
puts response.read_body{
"callId": "<string>",
"state": "RINGING",
"direction": "USER_INITIATED",
"recording": {
"requested": true,
"granted": true,
"reason": "DAILY_QUOTA_REACHED"
},
"agent": {
"id": "<string>",
"displayName": "<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": {}
}
]
}Autorizações
Corpo
application/json
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