Retrieve all campaigns

    This API lets you fetch all the campaigns associated with your account.

    API Endpoint

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

    Arguments

    limitinteger

    Denotes the number of results per page. The maximum number of results that can be fetched is 20.

    Defaults to 20.

    offset integer

    Denotes the number of value items by which the results should be offset. Defaults to 0. Read more about offset-based pagination.

    usecasestring

    Filter by usecase.

    Allowed values: 2FA,ACCOUNT_NOTIFICATION,CUSTOMER_CARE,DELIVERY_NOTIFICATION,FRAUD_ALERT,HIGHER_EDUCATION,LOW_VOLUME,MARKETING,MIXED,POLLING_VOTING,PUBLIC_SERVICE_ANNOUNCEMENT,SECURITY_ALERT,STARTER.

    Returns

    api_id & a dictionary with an objects property that contains upto 20 campaigns. Each tuple in the list is a separate Campaign object.

    Response

    HTTP Status Code: 200

    {
        "api_id": "97f8d684-d122-11ec-8703-0242ac110002",
        "campaigns": [
            {
                "brand_id": "BOFNVUC",
                "campaign_id": "CTUL7XL",
                "mno_metadata": {
                    "AT&T": {
                        "tpm": 4500
                    },
                    "T-Mobile": {
                        "brand_tier": "TOP"
                    },
                    "US Cellular": {
                        "tpm": 4500
                    },
                    "Verizon Wireless": {
                        "tpm": 4500
                    }
                },
                "registration_status": "FAILED",
                "reseller_id": "",
                "usecase": "2FA"
            },
            {
                "brand_id": "BOFNVUC",
                "campaign_id": "CTPGADD",
                "mno_metadata": {
                    "AT&T": {
                        "tpm": 4500
                    },
                    "T-Mobile": {
                        "brand_tier": "TOP"
                    },
                    "US Cellular": {
                        "tpm": 4500
                    },
                    "Verizon Wireless": {
                        "tpm": 4500
                    }
                },
                "registration_status": "PROCESSING",
                "reseller_id": "",
                "usecase": "FRAUD_ALERT"
            },
            {
                "brand_id": "BXGCZWP",
                "campaign_id": "CB7J0NT",
                "mno_metadata": {
                    "AT&T": {
                        "tpm": 4500
                    },
                    "T-Mobile": {
                        "brand_tier": "TOP"
                    },
                    "US Cellular": {
                        "tpm": 4500
                    },
                    "Verizon Wireless": {
                        "tpm": 4500
                    }
                },
                "registration_status": "PROCESSING",
                "reseller_id": "",
                "sub_usecase": "ACCOUNT_NOTIFICATION,DELIVERY_NOTIFICATION,CUSTOMER_CARE",
                "usecase": "MIXED"
            },
            {
                "brand_id": "BXZRASW",
                "campaign_id": "CRIZLAC",
                "mno_metadata": {
                    "AT&T": {
                        "tpm": 2400
                    },
                    "T-Mobile": {
                        "brand_tier": "TOP"
                    },
                    "US Cellular": {
                        "tpm": 2400
                    },
                    "Verizon Wireless": {
                        "tpm": 2400
                    }
                },
                "registration_status": "PROCESSING",
                "reseller_id": "",
                "usecase": "2FA"
            }
        ],
        "meta": {
            "limit": 4,
            "next": "/v1/Account/MAXXXXXXXXXXXXXXXXNG/10dlc/Campaign/?limit=4&offset=54",
            "offset": 50,
            "previous": "/v1/Account/MAXXXXXXXXXXXXXXXXNG/10dlc/Campaign/?limit=4&offset=46"
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    // 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>");
    client.campaign.list()
        .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
    
    <?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
    {
        $res = $client
            ->campaign
            ->list();
        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>");
    
                // List Campaigns
                Console.WriteLine("List Campaigns");
                try
                {
                    var response = api.Campaign.List();
                    Console.WriteLine(response);
                }
                catch (PlivoRestException e)
                {
                    Console.WriteLine("Exception: " + e.Message);
                }
            }
        }
    }
    
    1
    2
    
    curl -i --user auth_id:auth_token \
        https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/