List Phone Numbers
curl --request GET \
--url https://api.openmic.ai/v1/phone-numbers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openmic.ai/v1/phone-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.openmic.ai/v1/phone-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.openmic.ai/v1/phone-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.openmic.ai/v1/phone-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.openmic.ai/v1/phone-numbers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmic.ai/v1/phone-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{
"phone_numbers": [
{
"phone_number_id": "ybhb8wzi487w02m2bc7dh0ev",
"phone_number": "+15551112222",
"name": "Main Support Line",
"inbound_agent_id": "bvrg8wzi487w02m2bc7dh0ev",
"outbound_agent_id": "bvrg8wzi487w02m2bc7dh0ev",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-02T15:30:00Z"
}
],
"pagination": {
"limit": 1,
"offset": 0,
"total": 1,
"has_more": false
}
}{
"error": "Invalid query parameters provided."
}{
"error": "Unauthorized",
"message": "Invalid or expired API key"
}{
"error": "An unexpected error occurred. Please try again later."
}Phone Numbers
List Phone Numbers
Retrieve all phone numbers with optional filtering and pagination.
GET
/
v1
/
phone-numbers
List Phone Numbers
curl --request GET \
--url https://api.openmic.ai/v1/phone-numbers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openmic.ai/v1/phone-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.openmic.ai/v1/phone-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.openmic.ai/v1/phone-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.openmic.ai/v1/phone-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.openmic.ai/v1/phone-numbers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmic.ai/v1/phone-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{
"phone_numbers": [
{
"phone_number_id": "ybhb8wzi487w02m2bc7dh0ev",
"phone_number": "+15551112222",
"name": "Main Support Line",
"inbound_agent_id": "bvrg8wzi487w02m2bc7dh0ev",
"outbound_agent_id": "bvrg8wzi487w02m2bc7dh0ev",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-02T15:30:00Z"
}
],
"pagination": {
"limit": 1,
"offset": 0,
"total": 1,
"has_more": false
}
}{
"error": "Invalid query parameters provided."
}{
"error": "Unauthorized",
"message": "Invalid or expired API key"
}{
"error": "An unexpected error occurred. Please try again later."
}Authorizations
API key authentication. Include your API key in the Authorization header as: Authorization: Bearer <your-api-key>
Query Parameters
Maximum number of phone numbers to return (1-100)
Required range:
1 <= x <= 100Number of phone numbers to skip
Required range:
x >= 0Filter by phone number (partial match)
Filter by name (partial match)
Was this page helpful?
⌘I