# Requisição 1: Obter todos os números de telefone
curl -X GET "https://app.talkover.ai/api/v1/phone-numbers" \
-H "Authorization: Bearer talq_your_environment_token_here"
// Requisição 1: Obter todos os números de telefone
const response = await fetch('https://app.talkover.ai/api/v1/phone-numbers', {
method: 'GET',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here'
}
});
const result = await response.json();
console.log(result);
{
"success": true,
"data": [
{
"id": "phone-uuid-1",
"number": "+5511987654321",
"country_code": "US",
"formatted_number": "(123) 456-7890",
"international_number": "+1 234 567 890",
"type": "voice",
"has_voice": true,
"has_sms": true,
"has_mms": false,
"has_fax": false,
"has_whatsapp": false,
"current_status": "active",
"is_sandbox": false,
"current_price": 1.00,
"currency": "USD",
"renewal_date": "2024-02-15",
"auto_renewal": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"monthly_renewal_cost": 1.00,
"days_until_monthly_renewal": 15,
"is_due_for_monthly_renewal": false,
"environment": null,
"agents": null
},
{
"id": "phone-uuid-2",
"number": "+5511976543210",
"country_code": "US",
"formatted_number": "(987) 654-3210",
"international_number": "+1 987 654 321",
"type": "voice",
"has_voice": true,
"has_sms": true,
"has_mms": false,
"has_fax": false,
"has_whatsapp": false,
"current_status": "active",
"is_sandbox": false,
"current_price": 1.00,
"currency": "USD",
"renewal_date": "2024-02-15",
"auto_renewal": true,
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z",
"monthly_renewal_cost": 1.00,
"days_until_monthly_renewal": 15,
"is_due_for_monthly_renewal": false,
"environment": null,
"agents": null
}
]
}
Modelos de Voz e Números de Telefone
Listar Números de Telefone
Recuperar uma lista de números de telefone disponíveis com opções de filtragem
GET
/
api
/
v1
/
phone-numbers
# Requisição 1: Obter todos os números de telefone
curl -X GET "https://app.talkover.ai/api/v1/phone-numbers" \
-H "Authorization: Bearer talq_your_environment_token_here"
// Requisição 1: Obter todos os números de telefone
const response = await fetch('https://app.talkover.ai/api/v1/phone-numbers', {
method: 'GET',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here'
}
});
const result = await response.json();
console.log(result);
{
"success": true,
"data": [
{
"id": "phone-uuid-1",
"number": "+5511987654321",
"country_code": "US",
"formatted_number": "(123) 456-7890",
"international_number": "+1 234 567 890",
"type": "voice",
"has_voice": true,
"has_sms": true,
"has_mms": false,
"has_fax": false,
"has_whatsapp": false,
"current_status": "active",
"is_sandbox": false,
"current_price": 1.00,
"currency": "USD",
"renewal_date": "2024-02-15",
"auto_renewal": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"monthly_renewal_cost": 1.00,
"days_until_monthly_renewal": 15,
"is_due_for_monthly_renewal": false,
"environment": null,
"agents": null
},
{
"id": "phone-uuid-2",
"number": "+5511976543210",
"country_code": "US",
"formatted_number": "(987) 654-3210",
"international_number": "+1 987 654 321",
"type": "voice",
"has_voice": true,
"has_sms": true,
"has_mms": false,
"has_fax": false,
"has_whatsapp": false,
"current_status": "active",
"is_sandbox": false,
"current_price": 1.00,
"currency": "USD",
"renewal_date": "2024-02-15",
"auto_renewal": true,
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z",
"monthly_renewal_cost": 1.00,
"days_until_monthly_renewal": 15,
"is_due_for_monthly_renewal": false,
"environment": null,
"agents": null
}
]
}
Listar Números de Telefone
Recuperar uma lista de números de telefone disponíveis com opções de filtragem por tipo, capacidades e status.Endpoint
GET /api/v1/phone-numbers
Cabeçalhos da requisição
string
obrigatório
Token Bearer para autenticação. Formato:
Bearer talq_your_environment_token_hereParâmetros de consulta
string
Filtrar por tipo de número de telefone. Opções:
voice, sms, whatsapp, mms, faxboolean
Filtrar por capacidade de voz. Opções:
true, falseboolean
Filtrar por capacidade de WhatsApp. Opções:
true, falsestring
Pesquisar por número de telefone ou ID
Exemplos de Requisição
# Requisição 1: Obter todos os números de telefone
curl -X GET "https://app.talkover.ai/api/v1/phone-numbers" \
-H "Authorization: Bearer talq_your_environment_token_here"
// Requisição 1: Obter todos os números de telefone
const response = await fetch('https://app.talkover.ai/api/v1/phone-numbers', {
method: 'GET',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here'
}
});
const result = await response.json();
console.log(result);
# Requisição 2: Obter números com capacidade de voz
curl -X GET "https://app.talkover.ai/api/v1/phone-numbers?has_voice=true" \
-H "Authorization: Bearer talq_your_environment_token_here"
// Requisição 2: Obter números com capacidade de voz
const response = await fetch('https://app.talkover.ai/api/v1/phone-numbers?has_voice=true', {
method: 'GET',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here'
}
});
const result = await response.json();
console.log(result);
# Requisição 3: Pesquisar por número específico
curl -X GET "https://app.talkover.ai/api/v1/phone-numbers?search=+5511987654321" \
-H "Authorization: Bearer talq_your_environment_token_here"
// Requisição 3: Pesquisar por número específico
const response = await fetch('https://app.talkover.ai/api/v1/phone-numbers?search=+5511987654321', {
method: 'GET',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here'
}
});
const result = await response.json();
console.log(result);
Resposta
Resposta de Sucesso (200 OK)
{
"success": true,
"data": [
{
"id": "phone-uuid-1",
"number": "+5511987654321",
"country_code": "US",
"formatted_number": "(123) 456-7890",
"international_number": "+1 234 567 890",
"type": "voice",
"has_voice": true,
"has_sms": true,
"has_mms": false,
"has_fax": false,
"has_whatsapp": false,
"current_status": "active",
"is_sandbox": false,
"current_price": 1.00,
"currency": "USD",
"renewal_date": "2024-02-15",
"auto_renewal": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"monthly_renewal_cost": 1.00,
"days_until_monthly_renewal": 15,
"is_due_for_monthly_renewal": false,
"environment": null,
"agents": null
},
{
"id": "phone-uuid-2",
"number": "+5511976543210",
"country_code": "US",
"formatted_number": "(987) 654-3210",
"international_number": "+1 987 654 321",
"type": "voice",
"has_voice": true,
"has_sms": true,
"has_mms": false,
"has_fax": false,
"has_whatsapp": false,
"current_status": "active",
"is_sandbox": false,
"current_price": 1.00,
"currency": "USD",
"renewal_date": "2024-02-15",
"auto_renewal": true,
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z",
"monthly_renewal_cost": 1.00,
"days_until_monthly_renewal": 15,
"is_due_for_monthly_renewal": false,
"environment": null,
"agents": null
}
]
}
Campos da Resposta
boolean
obrigatório
Indica se a operação foi bem-sucedida.
array
obrigatório
Array de objetos de número de telefone.
Mostrar Objeto de Número de Telefone
Mostrar Objeto de Número de Telefone
string
obrigatório
Identificador único do número de telefone.
string
obrigatório
Número de telefone em formato E.164.
string
obrigatório
Código do país do número.
string
obrigatório
Número formatado para exibição.
string
obrigatório
Número internacional formatado.
string
obrigatório
Tipo do número de telefone. Opções:
voice, sms, whatsapp, mms, fax.boolean
obrigatório
Se o número tem capacidade de voz.
boolean
obrigatório
Se o número tem capacidade de SMS.
boolean
obrigatório
Se o número tem capacidade de MMS.
boolean
obrigatório
Se o número tem capacidade de fax.
boolean
obrigatório
Se o número tem capacidade de WhatsApp.
string
obrigatório
Status atual do número. Opções:
active, inactive, pending, suspended.boolean
obrigatório
Se o número é um número de sandbox.
number
obrigatório
Preço atual do número.
string
obrigatório
Moeda do preço.
string
obrigatório
Data de renovação (YYYY-MM-DD).
boolean
obrigatório
Se a renovação automática está ativada.
string
obrigatório
Timestamp ISO 8601 quando o número foi criado.
string
obrigatório
Timestamp ISO 8601 quando o número foi atualizado pela última vez.
number
obrigatório
Custo mensal de renovação.
integer
obrigatório
Dias até a renovação mensal.
boolean
obrigatório
Se o número está vencendo para renovação mensal.
object
Informações do ambiente (quando carregado).
array
Agentes associados (quando carregado).
Respostas de erro
401 Não Autorizado
{
"success": false,
"message": "Unauthorized"
}
422 Erro de Validação
{
"success": false,
"message": "The given data was invalid.",
"errors": {
"type": [
"The selected type is invalid."
]
}
}
500 Erro do Servidor
{
"success": false,
"message": "Internal server error."
}
Códigos de erro
| Código | Descrição | Status HTTP |
|---|---|---|
INVALID_TOKEN | Token de autenticação inválido ou ausente | 401 |
VALIDATION_ERROR | Validação dos parâmetros de consulta falhou | 422 |
SERVER_ERROR | Erro interno do servidor ocorreu | 500 |
Notas Importantes
Capacidades de filtragem. Use parâmetros de consulta para filtrar números por tipo e capacidades.
Formato de números. Todos os números são retornados em formato E.164.
Informações de renovação. Inclui detalhes sobre custos e datas de renovação.
Melhores Práticas
- Filtre por capacidades - Use
has_voiceehas_whatsapppara encontrar números adequados - Verifique status - Certifique-se de que os números estão ativos antes de usar
- Monitore renovação - Acompanhe as datas de renovação para evitar interrupções
- Pesquise eficientemente - Use o parâmetro
searchpara encontrar números específicos - Trate erros - Implemente tratamento adequado de erros para falhas de autenticação e validação
Endpoints relacionados
- Listar Modelos de Voz:
GET /api/v1/voice-templates - Gerar Demonstração de Voz:
GET /api/v1/voice-templates/{voice_template_id}/demo
Esta página foi útil?