Numarayı güncelle
curl --request PATCH \
--url https://api.aiagenttr.com/api/public/v1/phone-numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termination_uri": "<string>",
"transport": "<string>",
"auth_username": "<string>",
"auth_password": "<string>"
}
'import requests
url = "https://api.aiagenttr.com/api/public/v1/phone-numbers/{id}"
payload = {
"label": "<string>",
"agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termination_uri": "<string>",
"transport": "<string>",
"auth_username": "<string>",
"auth_password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
agent: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
termination_uri: '<string>',
transport: '<string>',
auth_username: '<string>',
auth_password: '<string>'
})
};
fetch('https://api.aiagenttr.com/api/public/v1/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://api.aiagenttr.com/api/public/v1/phone-numbers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'agent' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'termination_uri' => '<string>',
'transport' => '<string>',
'auth_username' => '<string>',
'auth_password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aiagenttr.com/api/public/v1/phone-numbers/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"agent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termination_uri\": \"<string>\",\n \"transport\": \"<string>\",\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.aiagenttr.com/api/public/v1/phone-numbers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"agent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termination_uri\": \"<string>\",\n \"transport\": \"<string>\",\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiagenttr.com/api/public/v1/phone-numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"agent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termination_uri\": \"<string>\",\n \"transport\": \"<string>\",\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "santral-teknikdestek",
"label": "pazarlama",
"agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "Satış Asistanı",
"provider": "netgsm",
"termination_uri": "sip.ornek-santral.com",
"transport": "UDP",
"auth_username": "santral-teknikdestek"
}{
"code": "invalid_argument",
"message": "termination_uri is required",
"details": null
}{
"code": "unauthenticated",
"message": "invalid api key",
"details": null
}Uçlar
Numarayı güncelle
Yalnızca gönderilen alanlar değişir. SIP trunk alanlarından biri (termination_uri, transport, auth_username, auth_password) gönderilirse trunk yeniden kurulur; bu durumda termination_uri ve kimlik bilgileri birlikte gönderilmelidir. phone_number değiştirilemez; gerekirse silip yeniden oluşturun.
PATCH
/
phone-numbers
/
{id}
Numarayı güncelle
curl --request PATCH \
--url https://api.aiagenttr.com/api/public/v1/phone-numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termination_uri": "<string>",
"transport": "<string>",
"auth_username": "<string>",
"auth_password": "<string>"
}
'import requests
url = "https://api.aiagenttr.com/api/public/v1/phone-numbers/{id}"
payload = {
"label": "<string>",
"agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termination_uri": "<string>",
"transport": "<string>",
"auth_username": "<string>",
"auth_password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
agent: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
termination_uri: '<string>',
transport: '<string>',
auth_username: '<string>',
auth_password: '<string>'
})
};
fetch('https://api.aiagenttr.com/api/public/v1/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://api.aiagenttr.com/api/public/v1/phone-numbers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'agent' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'termination_uri' => '<string>',
'transport' => '<string>',
'auth_username' => '<string>',
'auth_password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aiagenttr.com/api/public/v1/phone-numbers/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"agent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termination_uri\": \"<string>\",\n \"transport\": \"<string>\",\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.aiagenttr.com/api/public/v1/phone-numbers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"agent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termination_uri\": \"<string>\",\n \"transport\": \"<string>\",\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiagenttr.com/api/public/v1/phone-numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"agent\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termination_uri\": \"<string>\",\n \"transport\": \"<string>\",\n \"auth_username\": \"<string>\",\n \"auth_password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "santral-teknikdestek",
"label": "pazarlama",
"agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "Satış Asistanı",
"provider": "netgsm",
"termination_uri": "sip.ornek-santral.com",
"transport": "UDP",
"auth_username": "santral-teknikdestek"
}{
"code": "invalid_argument",
"message": "termination_uri is required",
"details": null
}{
"code": "unauthenticated",
"message": "invalid api key",
"details": null
}Authorizations
Body
application/json
Response
Güncel numara

