Get Phone Number
Retrieve a specific phone number by ID.curl -X GET "https://api.example.com/api/v1/phone_numbers/1" \
-H "X-API-Key: your-api-key-here"
const phoneNumberId = 1;
const response = await fetch(`https://api.example.com/api/v1/phone_numbers/${phoneNumberId}`, {
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
});
const data = await response.json();
import requests
phone_number_id = 1
headers = {
'X-API-Key': 'your-api-key-here'
}
response = requests.get(
f'https://api.example.com/api/v1/phone_numbers/{phone_number_id}',
headers=headers
)
data = response.json()
{
"status": {
"code": 200,
"message": "Phone number retrieved successfully"
},
"data": {
"id": 1,
"phone_number": "+1234567890",
"label": "Main Number",
"provider": "twilio",
"elevenlabs_phone_number_id": "phone_xyz",
"agent_id": 123,
"agent_name": "Customer Support Agent",
"user_id": 1,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
