Phone numbers
Search for numbers to buy
Numbers the trunk’s carrier will sell, with the carrier’s own prices in its own currency. Searching is free and changes nothing. Supported on Twilio, Telnyx, Plivo, Vobiz and Vonage (can_buy_numbers on the trunk says so); other carriers answer 400 carrier_cannot_buy. Requires phone_numbers:read.
GET
/
v1
/
sip-trunks
/
{id}
/
available-numbers
Search for numbers to buy
curl --request GET \
--url https://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers', 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.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers",
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://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers"
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://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers")
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{
"object": "list",
"data": [
{
"object": "available_phone_number",
"phone_number": "+919800000001",
"type": "local",
"locality": "<string>",
"region": "<string>",
"monthly_cost": "1.15",
"upfront_cost": "<string>",
"currency": "USD"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}Authorizations
Your Wixzel Voice API key: Authorization: Bearer wv_live_.... Keys are scoped; grant only what the integration needs.
Path Parameters
Pattern:
^[0-9a-f]{24}$Example:
"6a96a3ead6e886d42462dd3e"
Query Parameters
ISO 3166 alpha-2 country code.
Pattern:
^[A-Z]{2}$Example:
"IN"
Available options:
local, mobile, toll_free Digits the number should contain.
Pattern:
^\d{1,10}$Digits the national number should start with, where the carrier supports it.
Pattern:
^\d{1,10}$Required range:
1 <= x <= 30⌘I
Search for numbers to buy
curl --request GET \
--url https://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers', 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.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers",
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://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers"
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://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voice.wixzel.com/v1/sip-trunks/{id}/available-numbers")
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{
"object": "list",
"data": [
{
"object": "available_phone_number",
"phone_number": "+919800000001",
"type": "local",
"locality": "<string>",
"region": "<string>",
"monthly_cost": "1.15",
"upfront_cost": "<string>",
"currency": "USD"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}
