Bandwidth 10DLC Campaigns Import API Guide

This walks through how to programmatically import and view your campaigns via APIs for use with our Number Management and Messaging API's.

Assumptions

  • Familiarity with Account API Credentials
  • Created an API Credential Pair within the UI
  • Your account has Messaging and Campaign Management products enabled
  • Your account has 10dlcImportCampaigns product feature enabled
  • Your account has your CSP ID associated to it
  • You have provisioned campaigns with The Campaign Registry (TCR) through your Campaign Service Provider (CSP)

API Authentication

The Account Management API resources are authenticated with your API Credentials for "Number & Account Management".

Getting Started

Get imported campaigns

Request URL

GEThttps://dashboard.bandwidth.com/api/accounts/{accountId}/campaignManagement/10dlc/campaigns/imports?page={page}&size={size}

Request Authentication

The imports resource is authenticated with your API Credentials for "Number & Account Management"

GET Imports

GET https://dashboard.bandwidth.com/api/accounts/{accountId}/campaignManagement/10dlc/campaigns/imports?page=1&size=2 HTTP/1.1
Content-Type: application/xml; charset=utf-8
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Location: https://dashboard.bandwidth.com/api/accounts/{accountId}/campaignManagement/10dlc/campaigns/imports?page=1&size=2

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LongCodeImportCampaignsResponse>
    <ImportedCampaigns>
        <ImportedCampaign>
            <CampaignId>CCOPVEY</CampaignId>
            <Description>Test 9</Description>
            <MessageClass>Campaign-E</MessageClass>
            <CreateDate>2021-03-18T12:50:45Z</CreateDate>
            <Status>ACTIVE</Status>
            <MnoStatusList>
                <MnoStatus>
                    <MnoName>ATT</MnoName>
                    <MnoId>10017</MnoId>
                    <Status>APPROVED</Status>
                    <MnoName>TMO</MnoName>
                    <MnoId>10035</MnoId>
                    <Status>PENDING</Status>
                </MnoStatus
            </MnoStatusList>
        </ImportedCampaign>
        <ImportedCampaign>
            <CampaignId>CCOPRTM</CampaignId>
            <Description>Test 10</Description>
            <MessageClass>Campaign-E</MessageClass>
            <CreateDate>2021-03-19T09:36:18Z</CreateDate>
            <Status>ACTIVE</Status>
            <MnoStatusList>
                <MnoStatus>
                    <MnoName>ATT</MnoName>
                    <MnoId>10017</MnoId>
                    <Status>REJECTED</Status>
                    <MnoName>TMO</MnoName>
                    <MnoId>10035</MnoId>
                    <Status>SUSPENDED</Status>
                </MnoStatus
            </MnoStatusList>
        </ImportedCampaign>
    </ImportedCampaigns>
</LongCodeImportCampaignsResponse>

Import campaign

Request URL

POSThttps://dashboard.bandwidth.com/api/accounts/{accountId}/campaignManagement/10dlc/campaigns/imports

Request Body Mandatory Description
CampaignId Yes Campaign ID generated by TCR

POST Imports

POST https://dashboard.bandwidth.com/api/accounts/{accountId}/campaignManagement/10dlc/campaigns/imports HTTP/1.1
Content-Type: application/xml; charset=utf-8
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

<ImportedCampaign>
    <CampaignId>CJEUMDK</CampaignId>
</ImportedCampaign>

Response

HTTP/1.1 201 Created
Content-Type: application/xml
Location: https://dashboard.bandwidth.com/api/accounts/{accountId}/campaignManagement/10dlc/campaigns/imports

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LongCodeImportCampaignsResponse>
    <ImportedCampaign>
        <CampaignId>CJEUMDK</CampaignId>
        <Description>Test 9</Description>
        <MessageClass>Campaign-E</MessageClass>
        <CreateDate>2021-03-18T12:50:45Z</CreateDate>
        <Status>ACTIVE</Status>
            <MnoStatusList>
                <MnoStatus>
                    <MnoName>ATT</MnoName>
                    <MnoId>10017</MnoId>
                    <Status>APPROVED</Status>
                    <MnoName>TMO</MnoName>
                    <MnoId>10035</MnoId>
                    <Status>APPROVED</Status>
                </MnoStatus
            </MnoStatusList>
    </ImportedCampaign>
</LongCodeImportCampaignsResponse>

Assign a campaign to a TN

To assign a campaign to a TN, you will need to associate it with the Campaign ID by using the POST /accounts/{accountId}/tnoptions endpoint.
For more info on TNs, please see Number Management.
For more info on assigning campaigns to TNs, please see our number ordering guide.

Bulk Assign a campaign to multiple TNs

We do not have a publicly exposed REST endpoint for bulk TN updates. Please see how to import a csv in our campaign import Dashboard UI guide.
For more info on TNs, please see Number Management.
For more info on managing TN Line Features, please see our managing line features guide.


results matching ""

    No results matching ""