Получаване на всички телефонни номера
curl --request GET \
--url https://call.aiployees.com/api/user/phone-numbers/all \
--header 'Authorization: Bearer <token>'import requests
url = "https://call.aiployees.com/api/user/phone-numbers/all"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://call.aiployees.com/api/user/phone-numbers/all', 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://call.aiployees.com/api/user/phone-numbers/all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://call.aiployees.com/api/user/phone-numbers/all"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://call.aiployees.com/api/user/phone-numbers/all")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://call.aiployees.com/api/user/phone-numbers/all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 1,
"phone_number": "+14155551234",
"country_code": "US",
"type": "normal",
"type_label": "Dedicated Number",
"sms_capable": true,
"region": "us1",
"has_active_subscription": true,
"created_at": "2025-01-08T10:30:00.000000Z"
},
{
"id": 2,
"phone_number": "+442071234567",
"country_code": "GB",
"type": "normal",
"type_label": "Dedicated Number",
"sms_capable": false,
"region": "us1",
"has_active_subscription": true,
"created_at": "2025-01-05T14:20:00.000000Z"
}
]
}
Телефонни номера
Получаване на всички телефонни номера
Получаване на всички телефонни номера, притежавани от автентифицирания потребител
GET
/
user
/
phone-numbers
/
all
Получаване на всички телефонни номера
curl --request GET \
--url https://call.aiployees.com/api/user/phone-numbers/all \
--header 'Authorization: Bearer <token>'import requests
url = "https://call.aiployees.com/api/user/phone-numbers/all"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://call.aiployees.com/api/user/phone-numbers/all', 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://call.aiployees.com/api/user/phone-numbers/all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://call.aiployees.com/api/user/phone-numbers/all"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://call.aiployees.com/api/user/phone-numbers/all")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://call.aiployees.com/api/user/phone-numbers/all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 1,
"phone_number": "+14155551234",
"country_code": "US",
"type": "normal",
"type_label": "Dedicated Number",
"sms_capable": true,
"region": "us1",
"has_active_subscription": true,
"created_at": "2025-01-08T10:30:00.000000Z"
},
{
"id": 2,
"phone_number": "+442071234567",
"country_code": "GB",
"type": "normal",
"type_label": "Dedicated Number",
"sms_capable": false,
"region": "us1",
"has_active_subscription": true,
"created_at": "2025-01-05T14:20:00.000000Z"
}
]
}
Този endpoint връща списък от всички телефонни номера, свързани с вашия акаунт, включително техния статус на абонамент и възможности.
Отговор
array
Масив от обекти с телефонни номера
Show свойства на телефонния номер
Show свойства на телефонния номер
integer
Уникалният идентификатор на телефонния номер
string
Телефонният номер в E.164 формат (напр., +14155551234)
string
ISO 3166-1 alpha-2 кодът на държавата (напр., US, GB, AU)
string
Типът на телефонния номер:
normal, sip, или caller_idstring
Четим етикет за типа на телефонния номер
boolean
Дали телефонният номер може да изпраща и получава SMS
string
Регионът, където телефонният номер е предоставен
boolean
Дали телефонният номер има активен абонамент
string
ISO 8601 времева отметка на закупуване на телефонния номер
{
"data": [
{
"id": 1,
"phone_number": "+14155551234",
"country_code": "US",
"type": "normal",
"type_label": "Dedicated Number",
"sms_capable": true,
"region": "us1",
"has_active_subscription": true,
"created_at": "2025-01-08T10:30:00.000000Z"
},
{
"id": 2,
"phone_number": "+442071234567",
"country_code": "GB",
"type": "normal",
"type_label": "Dedicated Number",
"sms_capable": false,
"region": "us1",
"has_active_subscription": true,
"created_at": "2025-01-05T14:20:00.000000Z"
}
]
}
Съществува също наследен endpoint
GET /user/phone-numbers, който връща само SMS-способни телефонни номера с активни абонаменти. Използвайте този /all endpoint, ако имате нужда от всички телефонни номера независимо от SMS възможността или статуса на абонамента.⌘I

