Números
Restaurar número
Desfaz o DELETE /v1/numbers/{id} dentro da janela de 30 dias (o restorableUntil que a exclusão devolveu). Restaura o REGISTRO do número — id, API keys, webhooks, histórico — mas NÃO a conexão: o aparelho foi desconectado na exclusão, então reconecte depois (GET /v1/numbers/{id}/connect, ou reprovisionando na Meta). 404 com code: RESTORE_WINDOW_EXPIRED depois dos 30 dias; 409 NUMBER_ALREADY_ACTIVE quando o mesmo telefone foi reconectado nesse meio-tempo — use o número ativo.
POST
/
v1
/
numbers
/
{id}
/
restore
Restaurar número
curl --request POST \
--url https://pilotstatus.com.br/v1/numbers/{id}/restore \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/numbers/{id}/restore"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/numbers/{id}/restore', 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://pilotstatus.com.br/v1/numbers/{id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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://pilotstatus.com.br/v1/numbers/{id}/restore"
req, _ := http.NewRequest("POST", 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.post("https://pilotstatus.com.br/v1/numbers/{id}/restore")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/numbers/{id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ok": true,
"requiresReconnect": true
}{
"error": "Unauthorized"
}{
"error": "A janela de 30 dias para restaurar este número expirou.",
"code": "RESTORE_WINDOW_EXPIRED"
}{
"error": "Este número já foi reconectado em outro lugar e não pode ser restaurado.",
"code": "NUMBER_ALREADY_ACTIVE"
}{
"error": "Too many requests"
}Esta página foi útil?
⌘I
Restaurar número
curl --request POST \
--url https://pilotstatus.com.br/v1/numbers/{id}/restore \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/numbers/{id}/restore"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/numbers/{id}/restore', 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://pilotstatus.com.br/v1/numbers/{id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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://pilotstatus.com.br/v1/numbers/{id}/restore"
req, _ := http.NewRequest("POST", 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.post("https://pilotstatus.com.br/v1/numbers/{id}/restore")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/numbers/{id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ok": true,
"requiresReconnect": true
}{
"error": "Unauthorized"
}{
"error": "A janela de 30 dias para restaurar este número expirou.",
"code": "RESTORE_WINDOW_EXPIRED"
}{
"error": "Este número já foi reconectado em outro lugar e não pode ser restaurado.",
"code": "NUMBER_ALREADY_ACTIVE"
}{
"error": "Too many requests"
}