Retrieve a Mobile Phone Number
Retrieve the details of a specific mobile phone number.
GET
/
v2
/
mobile_phone_numbers
/
{id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const mobilePhoneNumber = await client.mobilePhoneNumbers.retrieve('id');
console.log(mobilePhoneNumber.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
mobile_phone_number = client.mobile_phone_numbers.retrieve(
"id",
)
print(mobile_phone_number.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
mobilePhoneNumber, err := client.MobilePhoneNumbers.Get(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mobilePhoneNumber.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.mobilephonenumbers.MobilePhoneNumberRetrieveParams;
import com.telnyx.sdk.models.mobilephonenumbers.MobilePhoneNumberRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MobilePhoneNumberRetrieveResponse mobilePhoneNumber = client.mobilePhoneNumbers().retrieve("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
mobile_phone_number = telnyx.mobile_phone_numbers.retrieve("id")
puts(mobile_phone_number)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$mobilePhoneNumber = $client->mobilePhoneNumbers->retrieve('id');
var_dump($mobilePhoneNumber);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx mobile-phone-numbers retrieve \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/v2/mobile_phone_numbers/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "<string>",
"record_type": "mobile_phone_number",
"phone_number": "<string>",
"sim_card_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"connection_id": "<string>",
"connection_name": "<string>",
"connection_type": "<string>",
"mobile_voice_enabled": true,
"tags": [
"<string>"
],
"customer_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "<string>"
},
"country_iso_alpha2": "<string>",
"caller_id_name_enabled": true,
"call_recording": {
"inbound_call_recording_enabled": true
},
"cnam_listing": {
"cnam_listing_enabled": true,
"cnam_listing_details": "<string>"
},
"outbound": {
"interception_app_id": "<string>",
"interception_app_name": "<string>"
},
"inbound": {
"interception_app_id": "<string>",
"interception_app_name": "<string>"
}
}
}Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const mobilePhoneNumber = await client.mobilePhoneNumbers.retrieve('id');
console.log(mobilePhoneNumber.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
mobile_phone_number = client.mobile_phone_numbers.retrieve(
"id",
)
print(mobile_phone_number.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
mobilePhoneNumber, err := client.MobilePhoneNumbers.Get(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mobilePhoneNumber.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.mobilephonenumbers.MobilePhoneNumberRetrieveParams;
import com.telnyx.sdk.models.mobilephonenumbers.MobilePhoneNumberRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MobilePhoneNumberRetrieveResponse mobilePhoneNumber = client.mobilePhoneNumbers().retrieve("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
mobile_phone_number = telnyx.mobile_phone_numbers.retrieve("id")
puts(mobile_phone_number)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$mobilePhoneNumber = $client->mobilePhoneNumbers->retrieve('id');
var_dump($mobilePhoneNumber);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx mobile-phone-numbers retrieve \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/v2/mobile_phone_numbers/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "<string>",
"record_type": "mobile_phone_number",
"phone_number": "<string>",
"sim_card_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"connection_id": "<string>",
"connection_name": "<string>",
"connection_type": "<string>",
"mobile_voice_enabled": true,
"tags": [
"<string>"
],
"customer_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "<string>"
},
"country_iso_alpha2": "<string>",
"caller_id_name_enabled": true,
"call_recording": {
"inbound_call_recording_enabled": true
},
"cnam_listing": {
"cnam_listing_enabled": true,
"cnam_listing_details": "<string>"
},
"outbound": {
"interception_app_id": "<string>",
"interception_app_name": "<string>"
},
"inbound": {
"interception_app_id": "<string>",
"interception_app_name": "<string>"
}
}
}