Create a new list including the ability to add custom fields.


Parameter

Description

Required

nameA unique name for the listYES
field_nA custom field name where n is an integer between 1 and 10. Once field names have been set they cannot be changed.NO


Example


curl https://api.transmitsms.com/add-list.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d name=Friends \
  -d field_1=Birthday \
  -d field_2=Town


JSON Response

{
  id: 34565988,
  name: "Special Offer Club",
  created: "2013-07-20 07:36:23",
  fields: {
    field_1: "birthday",
    field_2: "top score"
  }
}

XML Response

<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <id>34565988</id>
  <name>Special Offer Club</name>
  <created>2013-07-20 07:36:23</created>
  <fields>
    <field_1>birthday</field_1>
    <field_2>top score</field_2>
  </fields>
</response>


PHP Examples


<?php
  include '../../APIClient2.php';

  $api = new transmitsmsAPI('API_KEY', 'API_SECRET');
  $customFields = array('custom1', 'custom2');
  $result = $api->addList('LIST NAME', $customFields);

  if ($result->error->code == 'SUCCESS') {
    echo "List Created with ID {$result->id}";

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