import plivo

number = ["<phone_number>"]
client = plivo.RestClient("<auth_id>", "<auth_token>")
response = client.campaign.number_link(
    campaign_id="<Campaign_ID>",
    url="https://example.com/test",
    method="POST",
    numbers=number,
)

print(response)
{
    "api_id": "0b2e010e-b4a1-11ec-a9f5-0242ac110003",
    "message": "Request to link 14156667778 to campaign CUOGHIN was received and is being processed"
}

This API lets you link a number rented to your account with a preexisting campaign.

API Endpoint

POST
https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/{campaign_id}/Number/

Arguments

numbers
list
Required
The numbers you want to link to a campaign. Numbers should be in E.164 format
url
string
Fully qualified URL to which status update callbacks for the message should be sent.
method
string
The HTTP method to be used when calling the URL defined above.

Allowed values: GET, POST

Defaults to POST.

Returns

api_id for the request and success message