import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const shortCodes = await client.shortCodes.list();
console.log(shortCodes.data);{
"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"
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const shortCodes = await client.shortCodes.list();
console.log(shortCodes.data);{
"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"
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Consolidated filter parameter (deepObject style). Originally: filter[messaging_profile_id]
Show child attributes
Filter by Messaging Profile ID. Use the string null for phone numbers without assigned profiles. A synonym for the /messaging_profiles/{id}/short_codes endpoint when querying about an extant profile.
Successful response with a list of short codes.
Show child attributes
Unique identifier for a messaging profile.
Identifies the type of the resource.
short_code "short_code"
Identifies the type of resource.
Short digit sequence used to address messages.
ISO 3166-1 alpha-2 country code.
"US"
ISO 8601 formatted date indicating when the resource was created.
ISO 8601 formatted date indicating when the resource was updated.
Was this page helpful?