import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const shortCode of client.messagingProfiles.listShortCodes(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(shortCode.messaging_profile_id);
}
List short codes associated with a messaging profile
GET
/
messaging_profiles
/
{id}
/
short_codes
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const shortCode of client.messagingProfiles.listShortCodes(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(shortCode.messaging_profile_id);
}