import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const phoneNumberCampaign = await client.phoneNumberCampaigns.create({
campaignId: '4b300178-131c-d902-d54e-72d90ba1620j',
phoneNumber: '+18005550199',
});
console.log(phoneNumberCampaign.campaignId);{
"phoneNumber": "+18005550199",
"campaignId": "<string>",
"createdAt": "2021-03-08T17:57:48.801186",
"updatedAt": "2021-03-08T17:57:48.801186",
"brandId": "7ba705b7-22af-493f-addc-ac04b7ca071c",
"tcrBrandId": "BBRAND1",
"tcrCampaignId": "CCAMPA1",
"telnyxCampaignId": "3008dd9f-66d7-40e0-bf23-bf2d8d1a96ba",
"assignmentStatus": "ASSIGNED",
"failureReasons": "<string>"
}import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const phoneNumberCampaign = await client.phoneNumberCampaigns.create({
campaignId: '4b300178-131c-d902-d54e-72d90ba1620j',
phoneNumber: '+18005550199',
});
console.log(phoneNumberCampaign.campaignId);{
"phoneNumber": "+18005550199",
"campaignId": "<string>",
"createdAt": "2021-03-08T17:57:48.801186",
"updatedAt": "2021-03-08T17:57:48.801186",
"brandId": "7ba705b7-22af-493f-addc-ac04b7ca071c",
"tcrBrandId": "BBRAND1",
"tcrCampaignId": "CCAMPA1",
"telnyxCampaignId": "3008dd9f-66d7-40e0-bf23-bf2d8d1a96ba",
"assignmentStatus": "ASSIGNED",
"failureReasons": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Successful Response
"+18005550199"
For shared campaigns, this is the TCR campaign ID, otherwise it is the campaign ID
"2021-03-08T17:57:48.801186"
"2021-03-08T17:57:48.801186"
Brand ID. Empty if the number is associated to a shared campaign.
"7ba705b7-22af-493f-addc-ac04b7ca071c"
TCR's alphanumeric ID for the brand.
"BBRAND1"
TCR's alphanumeric ID for the campaign.
"CCAMPA1"
Campaign ID. Empty if the number is associated to a shared campaign.
"3008dd9f-66d7-40e0-bf23-bf2d8d1a96ba"
The assignment status of the number.
FAILED_ASSIGNMENT, PENDING_ASSIGNMENT, ASSIGNED, PENDING_UNASSIGNMENT, FAILED_UNASSIGNMENT "ASSIGNED"
Extra info about a failure to assign/unassign a number. Relevant only if the assignmentStatus is either FAILED_ASSIGNMENT or FAILED_UNASSIGNMENT
Was this page helpful?