Edit a member of a list.


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_idID of the list the member belongs toYES
msisdnMobile number of the member to editYES
first_nameFirst name of the memberNO
last_nameLast name of the memberNO
field.nCustom field value where n is an integer between 1 and 10. You can also use the names of the custom fields you have chosen for your list, e.g. field.birthday. To remove a value set it to an empty string.NO


Example


curl https://api.transmitsms.com/edit-list-member.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d 'list_id=1234567,556677' \
  -d msisdn=61491570158 \
  -d 'first_name=Ayrton' \
  -d 'last_name=Senna' \
  -d 'field.top_score=1000001'


JSON Response

{
  list_id: 24556,
  msisdn: "61491570156",
  first_name: "Paul",
  last_name: "Senna",
  fields: {
    birthday: "1968-10-05",
    top_score: "1000001"
  }
}

XML Response

<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <list_id>24556</list_id>
  <msisdn>61491570156</msisdn>
  <first_name>Paul</first_name>
  <last_name>Senna</last_name>
  <fields>
    <birthday>1968-10-05</birthday>
    <top_score>1000001</top_score>
  </fields>
</response>


Error Code

Header

Description

BAD_MOBILE400The mobile provided is invalid
BAD_MOBILE_COUNTRY400The country of the mobile provided is unavailable
OPTOUT400The recipient provided was previously opted-out
DUPLICATE_DELETED400The recipient provided was previously deleted


PHP Examples


<?php
  include '../../APIClient2.php';
  
  $api = new transmitsmsAPI('API_KEY', 'API_SECRET');
  $customFields = array("2"=>'new custom field');

  //please note - to leave current value intact - 
  //pass null or no key in custom fields array
  //to delete value - pass empty string
  //in following example we leave first name and 
  //first custom value intact and change last name and second custom value
  $result = $api->editListMember(6195, '61400000000', null, 'new lastname', $customFields);
  
  if ($result->error->code == 'SUCCESS') {
    echo "Member change saved";

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