Bulk Phone Number Campaigns

Phone number campaign bulk assignment

Assign Messaging Profile To Campaign

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.

SecuritybearerAuth
Request
Request Body schema: application/json
required
messagingProfileId
required
string (Messagingprofileid)

The ID of the messaging profile that you want to link to the specified campaign.

tcrCampaignId
string (Tcrcampaignid)

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.

campaignId
string (Campaignid)

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.

Responses
202

Successful Response

Response Schema: application/json
messagingProfileId
required
string (Messagingprofileid)

The ID of the messaging profile that you want to link to the specified campaign.

tcrCampaignId
string (Tcrcampaignid)

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.

campaignId
string (Campaignid)

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.

taskId
required
string (Taskid)

The ID of the task associated with assigning a messaging profile to a campaign.

post/phoneNumberAssignmentByProfile
Request samples
application/json
{
  • "messagingProfileId": "4001767e-ce0f-4cae-9d5f-0d5e636e7809",
  • "tcrCampaignId": "CWZTFH1",
  • "campaignId": "4b300178-131c-d902-d54e-72d90ba1620j"
}
Response samples
application/json
{
  • "messagingProfileId": "4001767e-ce0f-4cae-9d5f-0d5e636e7809",
  • "tcrCampaignId": "CWZTFH1",
  • "campaignId": "4b300178-131c-d902-d54e-72d90ba1620j",
  • "taskId": "667a80f8-b0a9-49d0-b9ab-a7a1bcc45086"
}

Get Assignment Task Status

Check the status of the task associated with assigning all phone numbers on a messaging profile to a campaign by taskId.

SecuritybearerAuth
Request
path Parameters
taskId
required
string (Taskid)
Responses
200

Successful Response

Response Schema: application/json
taskId
required
string (Taskid)
status
required
string (TaskStatus)

The status of the task associated with assigning a messaging profile to a campaign.

Enum: "pending" "processing" "completed" "failed"
createdAt
string <date-time> (Createdat)
updatedAt
string <date-time> (Updatedat)
get/phoneNumberAssignmentByProfile/{taskId}
Request samples
# install http://docs.python-requests.org/en/master/
import requests

url = 'https://api.telnyx.com/10dlc/phoneNumberAssignmentByProfile/{taskId}'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json', 
  'Authorization': 'Bearer API_TOKEN'
}
response = requests.request('get', url, headers=headers)
print(response.text)
Response samples
application/json
{
  • "taskId": "string",
  • "status": "pending",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get Phone Number Status

Check the status of the individual phone number/campaign assignments associated with the supplied taskId.

SecuritybearerAuth
Request
path Parameters
taskId
required
string (Taskid)
query Parameters
recordsPerPage
any (Recordsperpage)
Default: 20
page
any (Page)
Default: 1
Responses
200

Successful Response

Response Schema: application/json
required
Array of objects (Records)
Array
taskId
required
string (Taskid)

The ID of the task associated with the phone number.

phoneNumber
required
string (Phonenumber)

The phone number that the status is being checked for.

status
required
string (Status)

The status of the associated phone number assignment.

get/phoneNumberAssignmentByProfile/{taskId}/phoneNumbers
Request samples
# install http://docs.python-requests.org/en/master/
import requests

url = 'https://api.telnyx.com/10dlc/phoneNumberAssignmentByProfile/{taskId}/phoneNumbers'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json', 
  'Authorization': 'Bearer API_TOKEN'
}
response = requests.request('get', url, headers=headers)
print(response.text)
Response samples
application/json
{
  • "records": [
    • {
      • "taskId": "667a80f8-b0a9-49d0-b9ab-a7a1bcc45086",
      • "phoneNumber": "+12024567890",
      • "status": "pending"
      }
    ]
}