> ## Documentation Index
> Fetch the complete documentation index at: https://plivo.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve all campaigns

> List all 10DLC campaigns associated with your account

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

#### API Endpoint

```text GET theme={null}
https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/
```

### Arguments

<table>
  <tbody>
    <tr>
      <td><strong>limit<br />integer</strong></td>

      <td>
        <p>Denotes the number of results per page. The maximum number of results that can be fetched is 20.</p>
        <p>Defaults to 20.</p>
      </td>
    </tr>

    <tr>
      <td><strong>offset<br />integer</strong></td>

      <td>
        <p>Denotes the number of value items by which the results should be offset. Defaults to 0. Read more about <a href="https://docs.plivo.com/docs/messaging/api/request/pagination">offset-based pagination</a>.</p>
      </td>
    </tr>

    <tr>
      <td><strong>usecase<br />string</strong></td>

      <td>
        <p>Filter by use case.</p>
        <p>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.</p>
      </td>
    </tr>

    <tr>
      <td><strong>brand\_id<br />string</strong></td>

      <td>
        <p>Filters results by a brand\_id</p>
      </td>
    </tr>

    <tr>
      <td><strong>registration\_status<br />string</strong></td>

      <td>
        <p>Filter by registration status of a campaign.</p>
        <p>Allowed values: Active, Failed, Processing, Expired</p>
      </td>
    </tr>

    <tr>
      <td><strong>campaign\_source<br />string</strong></td>

      <td>
        <p>Filters results by campaign source.</p>
        <p>Allowed values: plivo, shared</p>
      </td>
    </tr>
  </tbody>
</table>

### Returns

api\_id and a dictionary with an objects property that contains up to 20 campaigns. Each tuple in the list is a separate Campaign object.

<RequestExample>
  ```py Python theme={null}
  import sys  
  sys.path.append("../plivo-python")  
  import plivo 

  client = plivo.RestClient("<auth_id>", "<auth_token>")
  response = client.campaign.get_number(
      campaign_id="<campaign_id>", number="14845197139"
  )
  print(response)
  ```

  ```ruby Ruby theme={null}
  require "rubygems"
  require "/etc/plivo-ruby/lib/plivo.rb"
  include Plivo

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

  begin
          response = api.campaign.get("<campaign_id>")

          puts response
  rescue PlivoRESTError => e
          puts 'Exception: ' + e.message
  end
  ```

  ```js Node theme={null}
  let plivo = require('plivo');

  let client = new plivo.Client("<auth_id>", "<auth_token>");
  client.campaign.list(param = {
          limit: 20,
          offset: 0
      })
      .then(function(response) {
          console.log(JSON.stringify(response));
      }).catch(function(error) {
          console.log(error);
      });
  ```

  ```php PHP theme={null}
  <?php
  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->getNumber("<campaign_id>","14845197716");
       print_r( $res);
  }
  catch (PlivoRestException $ex) {
      print_r($ex);
  }

  ?>
  ```

  ```java Java theme={null}
  package com.plivo.examples;

  import com.plivo.api.Plivo;
  import com.plivo.api.models.base.ListResponse;
  import com.plivo.api.models.campaign.Campaign;

  public class PlivoTest {

      public static void main(String[] args) {
          Plivo.init("<auth_id>", "<auth_token>");

          // List Campaign
          try {
              ListResponse < Campaign > response = Campaign.lister().limit(1).offset(0).list();
              System.out.println(response);
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  ```

  ```csharp .NET theme={null}
  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>");
              try
              {
                  var response = api.Campaign.List();
                  Console.WriteLine(response);
              }
              catch (PlivoRestException e)
              {
                  Console.WriteLine("Exception: " + e.Message);
              }
          }
      }
  }
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"os"

  	plivo "github.com/plivo/plivo-go/v7"
  )

  func main() {
  	client, err := plivo.NewClient("<auth_id>", "<auth_token>", &plivo.ClientOptions{})
  	if err != nil {
  		panic(err)
  	}
  	//List All Campaigns
  	response, err := client.Campaign.List(plivo.CampaignListParams{Limit: 2, Offset: 0})
  	if err != nil {
  		fmt.Printf("Error occurred while listing campaigns. error:%+v\n", err)
  		os.Exit(1)
  	} else {
  		fmt.Printf("%+v\n", response)
  	}
  }
  ```

  ```sh cURL theme={null}
  curl -i --user auth_id:auth_token \
      https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/
  ```
</RequestExample>

### Response

```json theme={null}
{
    "api_id": "f5013b11-8d0e-4156-b7a2-feeea076b6fb",
    "meta": {
        "limit": 1,
        "offset": 0,
        "next": "/v1/Account/<auth_id>/10dlc/Campaign/?limit=1&offset=1",
        "previous": null,
        "total_count": 16
    },
    "campaigns": [
        {
            "campaign_id": "CY2UXXX",
            "registration_status": "FAILED",
            "reseller_id": "",
            "brand_id": "BANGXXX",
            "usecase": "2FA",
            "campaign_alias": "campaign name",
            "mno_metadata": {
                "AT&T": {
                    "tpm": 4500
                },
                "T-Mobile": {
                    "brand_tier": "TOP"
                },
                "US Cellular": {
                    "tpm": 4500
                },
                "Verizon Wireless": {
                    "tpm": 4500
                }
            },
            "sample1": "Your one-time passcode is {{6 DIGIT CODE}}. Please do not reply to this message.",
            "sample2": "Your one-time passcode is {{6 DIGIT CODE}}.",
            "description": "We use this campaign to send multi factor authentication 6 digit codes to end users and customers.",
            "campaign_attributes": {
                "embedded_link": false,
                "embedded_phone": false,
                "age_gated": false,
                "direct_lending": false,
                "subscriber_optin": true,
                "subscriber_optout": true,
                "subscriber_help": true,
                "affiliate_marketing": false
            },
            "message_flow": "Agents and customers using our service daily. Agents login required to validate the MFA code. Customers login required to validate the MFA code. ",
            "help_message": "Please call {800 number} if you're having issues with login.",
            "optout_message": "You are not going to receive MFA codes by SMS moving forward.",
            "created_at": "2023-09-25T20:36:00.83971Z",
            "vertical": "ENTERNTAINMENT"
            "campaign_source": "plivo"
        }
    ]
}
```
