Get Phone Number
curl --request GET \
--url https://api.openmic.ai/v1/phone-numbers/{uid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openmic.ai/v1/phone-numbers/{uid}"
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/{uid}', 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/{uid}",
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/{uid}"
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/{uid}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmic.ai/v1/phone-numbers/{uid}")
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_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"
}{
"error": "Missing or invalid organization information"
}{
"error": "Unauthorized",
"message": "Invalid or expired API key"
}{
"error": "Phone number with the specified UID was not found."
}{
"error": "An unexpected error occurred. Please try again later."
}Phone Numbers
Get Phone Number
Retrieve details of a specific phone number by its UID.
GET
/
v1
/
phone-numbers
/
{uid}
Get Phone Number
curl --request GET \
--url https://api.openmic.ai/v1/phone-numbers/{uid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openmic.ai/v1/phone-numbers/{uid}"
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/{uid}', 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/{uid}",
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/{uid}"
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/{uid}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmic.ai/v1/phone-numbers/{uid}")
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_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"
}{
"error": "Missing or invalid organization information"
}{
"error": "Unauthorized",
"message": "Invalid or expired API key"
}{
"error": "Phone number with the specified UID was not found."
}{
"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>
Path Parameters
The unique identifier of the phone number
Response
Phone number details retrieved successfully
Unique identifier of the phone number
Phone number in E.164 format
Phone number creation timestamp
Phone number last update timestamp
Friendly name for the phone number
Bot ID for inbound calls
Bot ID for outbound calls
Was this page helpful?
⌘I