Assinatura
Prévia de comprar número extra (On Demand)
Calcula o custo de comprar N número(s) extra(s) sem cobrar nada. Requer key escopada a TENANT (403 para key de número). Para tenants no plano Grátis indica a conversão para On Demand: o número grátis vira pago/ilimitado e o novo também (você paga por número/mês). On Demand = mensagens ilimitadas em todos os números.
Requer uma chave com escopo de tenant.
GET
/
v1
/
subscription
/
extra-numbers
Prévia de comprar número extra (On Demand)
curl --request GET \
--url https://pilotstatus.com.br/v1/subscription/extra-numbers \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/subscription/extra-numbers"
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://pilotstatus.com.br/v1/subscription/extra-numbers', 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/subscription/extra-numbers",
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://pilotstatus.com.br/v1/subscription/extra-numbers"
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://pilotstatus.com.br/v1/subscription/extra-numbers")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/subscription/extra-numbers")
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{
"plan": "FREE",
"requiresConversion": true,
"explanation": {
"pt": "Sua conta passa para o plano On Demand: mensagens ilimitadas e R$ 29,90/mês por número conectado. No On Demand todo número é pago — o número que você já usa deixa de ser gratuito. Com o novo, são 2 números a R$ 29,90: R$ 59,80/mês.",
"en": "Your account moves to the On Demand plan: unlimited messages and R$ 29.90/month per connected number. On On Demand every number is paid — the number you already use stops being free. With the new one, that is 2 numbers at R$ 29.90: R$ 59.80/month."
},
"currentNumbers": 1,
"requested": 1,
"billedQuantity": 2,
"currency": "BRL",
"unitPriceMonthly": 29.9,
"proratedUnitPrice": 14.95,
"proratedTotal": 29.9,
"remainingDays": 15,
"totalDaysInCycle": 30,
"walletBalance": 0,
"hasSavedCard": false,
"fundingSource": "none",
"canFund": false,
"unitPriceBRL": 29.9,
"monthlyTotalBRL": 59.8
}{
"error": "Validation error"
}{
"error": "Unauthorized"
}{
"error": "Number-scoped keys cannot call tenant endpoints",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "Too many requests"
}Autorizações
apiKeyapiKeyId
Sua chave de API ps_
Parâmetros de consulta
Quantos números comprar (default 1).
Resposta
Prévia — tenant Grátis com 1 número conectado comprando 1 (converte para On Demand). proratedTotal é cobrado agora; monthlyTotalBRL é o que recorre a cada ciclo.
Esta página foi útil?
⌘I
Prévia de comprar número extra (On Demand)
curl --request GET \
--url https://pilotstatus.com.br/v1/subscription/extra-numbers \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/subscription/extra-numbers"
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://pilotstatus.com.br/v1/subscription/extra-numbers', 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/subscription/extra-numbers",
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://pilotstatus.com.br/v1/subscription/extra-numbers"
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://pilotstatus.com.br/v1/subscription/extra-numbers")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/subscription/extra-numbers")
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{
"plan": "FREE",
"requiresConversion": true,
"explanation": {
"pt": "Sua conta passa para o plano On Demand: mensagens ilimitadas e R$ 29,90/mês por número conectado. No On Demand todo número é pago — o número que você já usa deixa de ser gratuito. Com o novo, são 2 números a R$ 29,90: R$ 59,80/mês.",
"en": "Your account moves to the On Demand plan: unlimited messages and R$ 29.90/month per connected number. On On Demand every number is paid — the number you already use stops being free. With the new one, that is 2 numbers at R$ 29.90: R$ 59.80/month."
},
"currentNumbers": 1,
"requested": 1,
"billedQuantity": 2,
"currency": "BRL",
"unitPriceMonthly": 29.9,
"proratedUnitPrice": 14.95,
"proratedTotal": 29.9,
"remainingDays": 15,
"totalDaysInCycle": 30,
"walletBalance": 0,
"hasSavedCard": false,
"fundingSource": "none",
"canFund": false,
"unitPriceBRL": 29.9,
"monthlyTotalBRL": 59.8
}{
"error": "Validation error"
}{
"error": "Unauthorized"
}{
"error": "Number-scoped keys cannot call tenant endpoints",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "Too many requests"
}