Skip to main content
GET
/
short_codes
/
{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 shortCode = await client.shortCodes.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(shortCode.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
)
short_code = client.short_codes.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(short_code.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"),
)
shortCode, err := client.ShortCodes.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", shortCode.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.shortcodes.ShortCodeRetrieveParams;
import com.telnyx.sdk.models.shortcodes.ShortCodeRetrieveResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

ShortCodeRetrieveResponse shortCode = client.shortCodes().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

short_code = telnyx.short_codes.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

puts(short_code)
<?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 {
$shortCode = $client->shortCodes->retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'
);

var_dump($shortCode);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx short-codes retrieve \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
curl --request GET \
--url https://api.telnyx.com/v2/short_codes/{id} \
--header 'Authorization: Bearer <token>'
{
  "data": {
    "record_type": "short_code",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "short_code": "12345",
    "country_code": "US",
    "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "tags": [
      "test_customer"
    ],
    "created_at": "2019-01-23T18:10:02.574Z",
    "updated_at": "2019-01-23T18:10:02.574Z"
  }
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

The id of the short code

Response

Successful response with details about a short code.

data
object
Example:
{
"record_type": "short_code",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"short_code": "12345",
"country_code": "US",
"messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"tags": ["test_customer"],
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z"
}