Plivo Plivo docs
  • Messaging API
  • Voice API
  • SIP Trunking
  • Phone Numbers
  • More
    • Account API
    • Client SDKs
    • Lookup API
    • Integrations
    • Full API Reference
    • PHLO
  • Support
  • Login
    Overview
    Plivo 10DLC
    • 10DLC Quickstart
    • 10DLC API Reference
        • Profile
            • The Profile object
            • Create a profile
            • Retrieve all profiles
            • Retrieve a specific profile
            • Update a profile
            • Delete a profile
        • Brand
            • The Brand object
            • Register a standard brand
            • Register a starter brand
            • Retrieve all brands
            • Retrieve a specific brand
        • Campaign
            • The Campaign object
            • Register a campaign
            • Retrieve all campaigns
            • Retrieve a specific campaign
        • Link & Unlink phone numbers
            • The Number object
            • Link number to a campaign
            • Retrieve all numbers linked to a campaign
            • Retrieve status of number linked to a campaign
            • Unlink number from a campaign
    • Callbacks
    Latest Legacy
    • Python
    • Ruby
    • Node
    • PHP
    • Java
    • .NET
    • Go
    • cURL

    Unlink number from a campaign

    This API lets you unlink a number from a particular campaign.

    API Endpoint

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

    Arguments

    urlstringSet this parameter to the fully qualified URL to which status update callbacks for the message should be sent.
    methodstringThe HTTP method to be used when calling the URL defined above.

    Allowed values: GET, POST

    Defaults to POST

    Response

    HTTP Status Code: 202

    { “api_id”: “eba3f9aa-b4a1-11ec-85a1-0242ac110003”, “message”: “Request to unlink 14156667777 from campaign CUOGHIN was received and is being processed” }

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    // Available in versions >= 4.30.0 (https://github.com/plivo/plivo-node/releases/tag/v4.30.0)
    
    let plivo = require('plivo');
    
    let client = new plivo.Client('<auth_id>', '<auth_token>');
    var callback = {"url":"https://foo.com/tendlc_status/", "method":"POST"}
    
    client.campaign.unlinkNumber("<campaign_id>", ["<number>"], callback)
        .then(function (response) {
            console.log(JSON.stringify(response));
        }).catch(function (error) {
            console.log("err");
            console.log(error);
        });
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    <?php
    
    # Available in versions >= 4.29.0 (https://github.com/plivo/plivo-php/releases/tag/v4.29.0)
    
    require '/etc/plivo-php/vendor/autoload.php';
    use Plivo\RestClient;
    
    $client = new RestClient("<auth_id>", "<auth_token>");
    $client
        ->client
        ->setTimeout(60);
    try
    {   
        $callback = array("url"=>"https://foo.com/tendlc_status/", "method"=>"POST");
        $res = $client
            ->campaign
            ->deleteNumber("<campaign_id>", "<number>", $callback);
        print_r($res);
    }
    catch(PlivoRestException $ex)
    {
        print_r($ex);
    }
    
    ?>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    
    // Available in versions >= 5.9.0 (https://github.com/plivo/plivo-dotnet/releases/tag/v5.9.0)
    
    using System;
    using System.Collections.Generic;
    using Plivo;
    using Plivo.Exception;
    
    namespace dotnet_project
    {
        class Ten_dlc
        {
            static void Main(string[] args)
            {
     
                    var api = new PlivoApi("<auth_id>","<auth_token>");
    
                    // Unlink Number from Camapign
                Console.WriteLine("Unlink Number to Campaign");
                try
                {   
                        var response = api.Campaign.UnlinkNumber("<campaign_id>", "<number>", "https://foo.com/tendlc_status/", "POST");
                        Console.WriteLine(response);
                }
                catch (PlivoRestException e)
                {
                        Console.WriteLine("Exception: " + e.Message);
                }
            }
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    
    curl -X DELETE -i --user auth_id:auth_token \
        -H "Content-Type: application/json" \
        -d '{
            "url": "https://foo.com/tendlc_status/",
            "method": "POST"
        }' \
        https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/{campaign_id}/Number/14156667778/
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    // Available in versions >= 4.30.0 (https://github.com/plivo/plivo-node/releases/tag/v4.30.0)
    
    let plivo = require('plivo');
    
    let client = new plivo.Client('<auth_id>', '<auth_token>');
    var callback = {"url":"https://foo.com/tendlc_status/", "method":"POST"}
    
    client.campaign.unlinkNumber("<campaign_id>", ["<number>"], callback)
        .then(function (response) {
            console.log(JSON.stringify(response));
        }).catch(function (error) {
            console.log("err");
            console.log(error);
        });
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    <?php
    
    # Available in versions >= 4.29.0 (https://github.com/plivo/plivo-php/releases/tag/v4.29.0)
    
    require '/etc/plivo-php/vendor/autoload.php';
    use Plivo\RestClient;
    
    $client = new RestClient("<auth_id>", "<auth_token>");
    $client
        ->client
        ->setTimeout(60);
    try
    {   
        $callback = array("url"=>"https://foo.com/tendlc_status/", "method"=>"POST");
        $res = $client
            ->campaign
            ->deleteNumber("<campaign_id>", "<number>", $callback);
        print_r($res);
    }
    catch(PlivoRestException $ex)
    {
        print_r($ex);
    }
    
    ?>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    
    // Available in versions >= 5.9.0 (https://github.com/plivo/plivo-dotnet/releases/tag/v5.9.0)
    
    using System;
    using System.Collections.Generic;
    using Plivo;
    using Plivo.Exception;
    
    namespace dotnet_project
    {
        class Ten_dlc
        {
            static void Main(string[] args)
            {
     
                    var api = new PlivoApi("<auth_id>","<auth_token>");
    
                    // Unlink Number from Camapign
                Console.WriteLine("Unlink Number to Campaign");
                try
                {   
                        var response = api.Campaign.UnlinkNumber("<campaign_id>", "<number>", "https://foo.com/tendlc_status/", "POST");
                        Console.WriteLine(response);
                }
                catch (PlivoRestException e)
                {
                        Console.WriteLine("Exception: " + e.Message);
                }
            }
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    
    curl -X DELETE -i --user auth_id:auth_token \
        -H "Content-Type: application/json" \
        -d '{
            "url": "https://foo.com/tendlc_status/",
            "method": "POST"
        }' \
        https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/{campaign_id}/Number/14156667778/
    
    Rate this page
    🥳 Thank you! It means a lot to us!
    ×
    Help Us Improve
    Thank you so much for rating the page, we would like to get your input for further improvements!
    Subscribe to Updates
    Thank you for your feedback!