Get the metadata of all your lists.


We created a new viewing experience for our SMS API documentation. It's now all in one central location. Click here to check it out!


Parameter

Description

Requirement

pagePage number, for paginationNO
maxMaximum results returned per pageNO


Example


curl https://api.transmitsms.com/get-lists.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret


JSON Response

{
  lists_total: 7,
  lists: [
    {
      id: 34565667,
      name: "Survey Respondents",
      created: "2012-12-30 08:56:43",
      members_total: 2544,
      members_active: 2306
    }
  ],
  page: {
    count: 1,
    number: 1
  }
}

XML Response

<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <lists_total>7</lists_total>
  <lists>
    <id>34565667</id>
    <name>Survey Respondents</name>
    <created>2012-12-30 08:56:43</created>
    <members_total>2544</members_total>
    <members_active>2306</members_active>
  </lists>
  <page>
    <count>1</count>
    <number>1</number>
  </page>
</response>


PHP Examples


<?php
  include '../../APIClient2.php';
  
  $api = new transmitsmsAPI('API_KEY', 'API_SECRET');
  $offset = 0;
  $limit = 10;

  $result = $api->getLists($offset, $limit);

  if ($result->error->code == 'SUCCESS') {
    echo "There are {$result->lists_total} lists, 
      showing page {$result->page->number} of {$result->page->count} <hr>";
    
    foreach ($result->listsas$list) {
      echo "{$list->name} - {$list->members_total} total members <br>";
    }

  } else {
    echo "Error: {$result->error->description}";
  }