import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.phoneNumberAssignmentByProfile.assign({
messagingProfileId: '4001767e-ce0f-4cae-9d5f-0d5e636e7809',
});
console.log(response);{
"messagingProfileId": "4001767e-ce0f-4cae-9d5f-0d5e636e7809",
"taskId": "667a80f8-b0a9-49d0-b9ab-a7a1bcc45086",
"tcrCampaignId": "CWZTFH1",
"campaignId": "4b300178-131c-d902-d54e-72d90ba1620j"
}This endpoint allows you to link all phone numbers associated with a Messaging Profile to a campaign. Please note: if you want to assign phone numbers to a campaign that you did not create with Telnyx 10DLC services, this endpoint allows that provided that you’ve shared the campaign with Telnyx. In this case, only provide the parameter, tcrCampaignId, and not campaignId. In all other cases (where the campaign you’re assigning was created with Telnyx 10DLC services), only provide campaignId, not tcrCampaignId.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.phoneNumberAssignmentByProfile.assign({
messagingProfileId: '4001767e-ce0f-4cae-9d5f-0d5e636e7809',
});
console.log(response);{
"messagingProfileId": "4001767e-ce0f-4cae-9d5f-0d5e636e7809",
"taskId": "667a80f8-b0a9-49d0-b9ab-a7a1bcc45086",
"tcrCampaignId": "CWZTFH1",
"campaignId": "4b300178-131c-d902-d54e-72d90ba1620j"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the messaging profile that you want to link to the specified campaign.
"4001767e-ce0f-4cae-9d5f-0d5e636e7809"
The TCR ID of the shared campaign you want to link to the specified messaging profile (for campaigns not created using Telnyx 10DLC services only). If you supply this ID in the request, do not also include a campaignId.
"CWZTFH1"
The ID of the campaign you want to link to the specified messaging profile. If you supply this ID in the request, do not also include a tcrCampaignId.
"4b300178-131c-d902-d54e-72d90ba1620j"
Successful Response
The ID of the messaging profile that you want to link to the specified campaign.
"4001767e-ce0f-4cae-9d5f-0d5e636e7809"
The ID of the task associated with assigning a messaging profile to a campaign.
"667a80f8-b0a9-49d0-b9ab-a7a1bcc45086"
The TCR ID of the shared campaign you want to link to the specified messaging profile (for campaigns not created using Telnyx 10DLC services only). If you supply this ID in the request, do not also include a campaignId.
"CWZTFH1"
The ID of the campaign you want to link to the specified messaging profile. If you supply this ID in the request, do not also include a tcrCampaignId.
"4b300178-131c-d902-d54e-72d90ba1620j"
Was this page helpful?