curl --request POST \
--url https://{baseUrl}/ipbox/api/retornoDiscador \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data loteId=loteId \
--data de=de \
--data ate=ateimport requests
url = "https://{baseUrl}/ipbox/api/retornoDiscador"
payload = {
"loteId": "loteId",
"de": "de",
"ate": "ate"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({loteId: 'loteId', de: 'de', ate: 'ate'})
};
fetch('https://{baseUrl}/ipbox/api/retornoDiscador', 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://{baseUrl}/ipbox/api/retornoDiscador",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "loteId=loteId&de=de&ate=ate",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://{baseUrl}/ipbox/api/retornoDiscador"
payload := strings.NewReader("loteId=loteId&de=de&ate=ate")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{baseUrl}/ipbox/api/retornoDiscador")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("loteId=loteId&de=de&ate=ate")
.asString();require 'uri'
require 'net/http'
url = URI("https://{baseUrl}/ipbox/api/retornoDiscador")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "loteId=loteId&de=de&ate=ate"
response = http.request(request)
puts response.read_body<string>retornoDiscador
Retorna o status de cada uma das tentativas de ligação do discador no período especificado.
Response:
Se foram efetuadas discagens, retorna um CSV com o status de cada ligação efetuada no período. Se a data/hora inicial ou final não forem informadas, são retornados os resultados do dia corrente.
Formato CSV retornado (uma linha por ligação, sem cabeçalho):
data_hora;codigo;ddd;numero;codigo_status;status
Exemplo:
28/09/2017 20:04:50;1534664;11;22334455;4;ATENDIDO
28/09/2017 20:05:18;2577333;33;22332233;3;SEM_RESPOSTA
06/10/2017 08:00:55;2777322;33;22332233;5;OCUPADO
06/10/2017 08:10:55;2475367;33;22332233;0;DESCONHECIDO
Códigos de status possíveis:
| Código | Status |
|---|---|
| 0 | DESCONHECIDO |
| 1 | INDISPONIVEL |
| 3 | SEM_RESPOSTA |
| 4 | ATENDIDO |
| 5 | OCUPADO |
| 8 | CONGESTIONADO |
| 94 | FAX |
| 95 | SECRETARIA_ELETRONICA |
| 96 | CAIXA_POSTAL |
| 97 | MENSAGEM_OPERADORA |
| 98 | MACHINE |
| 99 | BLACKLISTED |
Diferente da maioria dos endpoints desta API, este não retorna JSON: a resposta é um arquivo CSV (Content-Disposition: attachment) transmitido diretamente, com uma linha por chamada no formato data_hora;codigo;ddd;numero;codigo_status;status.
curl --request POST \
--url https://{baseUrl}/ipbox/api/retornoDiscador \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data loteId=loteId \
--data de=de \
--data ate=ateimport requests
url = "https://{baseUrl}/ipbox/api/retornoDiscador"
payload = {
"loteId": "loteId",
"de": "de",
"ate": "ate"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({loteId: 'loteId', de: 'de', ate: 'ate'})
};
fetch('https://{baseUrl}/ipbox/api/retornoDiscador', 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://{baseUrl}/ipbox/api/retornoDiscador",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "loteId=loteId&de=de&ate=ate",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://{baseUrl}/ipbox/api/retornoDiscador"
payload := strings.NewReader("loteId=loteId&de=de&ate=ate")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{baseUrl}/ipbox/api/retornoDiscador")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("loteId=loteId&de=de&ate=ate")
.asString();require 'uri'
require 'net/http'
url = URI("https://{baseUrl}/ipbox/api/retornoDiscador")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "loteId=loteId&de=de&ate=ate"
response = http.request(request)
puts response.read_body<string>Authorizations
Token gerado em IPBoX > API > Token. Aceita o token puro, ou com prefixo Bearer / Basic.
Body
Response
Arquivo CSV com o retorno das discagens do período.
The response is of type file.
