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
.
Successful Response
{- "campaignId": "4b300178-131c-d902-d54e-72d90ba1620j",
- "messagingProfileId": "4001767e-ce0f-4cae-9d5f-0d5e636e7809",
- "tcrCampaignId": "CWZTFH1"
}
{- "campaignId": "4b300178-131c-d902-d54e-72d90ba1620j",
- "messagingProfileId": "4001767e-ce0f-4cae-9d5f-0d5e636e7809",
- "taskId": "667a80f8-b0a9-49d0-b9ab-a7a1bcc45086",
- "tcrCampaignId": "CWZTFH1"
}
Check the status of the task associated with assigning all phone numbers on a messaging profile to a campaign by taskId
.
Successful Response
# 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)
{- "createdAt": "2019-08-24T14:15:22Z",
- "status": "pending",
- "taskId": "string",
- "updatedAt": "2019-08-24T14:15:22Z"
}
Check the status of the individual phone number/campaign assignments associated with the supplied taskId
.
Successful Response
required | Array of objects (Records) |
# 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)
{- "records": [
- {
- "phoneNumber": "+12024567890",
- "status": "pending",
- "taskId": "667a80f8-b0a9-49d0-b9ab-a7a1bcc45086"
}
]
}