Освобождаване на телефонен номер
curl --request DELETE \
--url https://call.aiployees.com/api/user/phone-numbers/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://call.aiployees.com/api/user/phone-numbers/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://call.aiployees.com/api/user/phone-numbers/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/{id}"
req, _ := http.NewRequest("DELETE", 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.delete("https://call.aiployees.com/api/user/phone-numbers/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://call.aiployees.com/api/user/phone-numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Phone number released successfully. It will be removed at the end of the billing period."
}
{
"message": "Phone number deleted successfully."
}
{
"error": "Phone number is already scheduled for release."
}
{
"error": "Phone number not found."
}
{
"error": "Failed to release phone number. Please try again or contact support."
}
Телефонни номера
Освобождаване на телефонен номер
Освобождаване на телефонен номер и отказ на абонамента му
DELETE
/
user
/
phone-numbers
/
{id}
Освобождаване на телефонен номер
curl --request DELETE \
--url https://call.aiployees.com/api/user/phone-numbers/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://call.aiployees.com/api/user/phone-numbers/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://call.aiployees.com/api/user/phone-numbers/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/{id}"
req, _ := http.NewRequest("DELETE", 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.delete("https://call.aiployees.com/api/user/phone-numbers/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://call.aiployees.com/api/user/phone-numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Phone number released successfully. It will be removed at the end of the billing period."
}
{
"message": "Phone number deleted successfully."
}
{
"error": "Phone number is already scheduled for release."
}
{
"error": "Phone number not found."
}
{
"error": "Failed to release phone number. Please try again or contact support."
}
Този endpoint освобождава телефонен номер от вашия акаунт. За dedicated номера с абонаменти, това отменя абонамента и номерът ще бъде освободен в края на текущия период на таксуване.
Path Parameters
integer
required
Уникалният идентификатор на телефонния номер за освобождаване
Response
string
Съобщение за успех, указващо статуса на освобождаването
{
"message": "Phone number released successfully. It will be removed at the end of the billing period."
}
{
"message": "Phone number deleted successfully."
}
{
"error": "Phone number is already scheduled for release."
}
{
"error": "Phone number not found."
}
{
"error": "Failed to release phone number. Please try again or contact support."
}
Поведение при освобождаване
Поведението при освобождаване зависи от типа на телефонния номер:| Тип | Поведение |
|---|---|
| Dedicated (нормален) | Абонаментът се отменя. Номерът остава активен до края на периода на таксуване, след което се освобождава. |
| SIP | Веднага се изтрива от вашия акаунт. |
| Caller ID | Веднага се изтрива от вашия акаунт и се премахва от телефонния доставчик. |
След като телефонен номер бъде освободен, може да не можете да получите същия номер обратно. Уверете се, че актуализирате всички асистенти или кампании, използващи този номер, преди да го освободите.
Какво се случва с прикачените ресурси
Когато освободите телефонен номер:- Всички inbound асистенти, прикачени към този номер, ще имат неприсвоен телефонен номер
- Всички кампании, използващи този номер, ще го имат премахнат от тяхната ротация на телефонни номера
- Историята на обаждания се запазва и остава достъпна

