Remove a member from one list or all 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

Required

list_id
ID of the list to remove from. If set to 0 (zero) the member will be removed from all lists.
YES
msisdnMobile number of the memberYES


Example: Remove a member from a list


curl https://api.transmitsms.com/delete-from-list.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d list_id=4117 \
  -d msisdn=61491570156


Example: Remove a member from all of your lists


curl https://api.transmitsms.com/delete-from-list.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d list_id=0 \
  -d msisdn=61491570156


JSON Response

{
  list_ids: [
    34544,
    56788
  ]
}

XML Response

<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <list_ids>34544</list_ids>
  <list_ids>56788</list_ids>
</response>


PHP Examples


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

  $api = new transmitsmsAPI('API_KEY', 'API_SECRET');

  // this will delete member from all lists that belong to you
  // $result = $api->deleteFromList(6195, '61400000000');

  // this will delete member from provided list
  $result = $api->deleteFromList(6195,'61400000000');

  if ($result->error->code == 'SUCCESS') {
    echo "Member deleted from lists: ".implode(', ',$result->list_ids);

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