Latest Legacy

Import a campaign

This API lets you import a campaign that you have registered directly with The Campaign Registry (TCR). This feature is currently in private beta - please contact our support team to enable this feature for your account.

API Endpoint

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

Arguments

campaign_alias string RequiredA friendly name for your campaign.
campaign_id string RequiredID for the campaign that needs to be imported.

Make sure you have shared the campaign with Plivo from your TCR portal before submitting the API request.

url stringThe fully qualified URL to which status update callbacks for the message should be sent.
method stringThe HTTP method to be used when calling the URL defined above.

Allowed values: GET, POST

Defaults to POST

Returns

api_id for the request, campaign_id and success message.

Response

{
"api_id": "a640fba2-3b14-11ed-95d8-0242ac110003",
"campaign_id": "<Campaign ID used in the request API>",
"message": "Request to import campaign was received and is being processed."
}
1
2
3
4
5
6
7
8
9
10
11
12
13
require "rubygems"
require "/etc/plivo-ruby/lib/plivo.rb"
include Plivo

api = RestClient.new(<auth_id>", "<auth_token>)

begin
  puts("import Campaign")
  response = api.campaign.import(campaign_id:"C1234567", campaign_alias:"campaign name")
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
curl -i --user auth_id:auth_token \
    -H "Content-Type: application/json" \
    -d '{
        "campaign_alias": “Friendly Name”,
        "campaign_id": “C1234567”,
        "url": "https://<yourdomain>.com/tendlc_status/",
        "method": "POST"
    }' \
    https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/Import/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main
import (
"fmt"
"github.com/plivo/plivo-go/v7"
)
func main() {
client, err := plivo.NewClient("<auth_id>", "<auth_token>", &plivo.ClientOptions{})
if err != nil {
fmt.Println("err", err.Error)
}
response, err := client.Campaign.Import(plivo.ImportCampaignParams{CampaignID: "C1234567", CampaignAlias: "My partner campaign"})
if err != nil {
fmt.Println(err.Error)
return
}
fmt.Println("response", response)
}