Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Add a number/numbers to a 'send' group (excluding 'merge' groups).

Code Block
themeRDark
languagephp
titleExample
linenumberstrue
$add=$tmClient->addNumbersToGroup>addNumbersToGroupWithName(array('447000000001','447000000002'), 'My Group');
if (!empty($add['added']))
{
	echo count($add['added'])." numbers were successfully added:<br/>\n";
	foreach ($add['added'] as $number)
	echo "$number <br/>\n";
}

Arguments:

 

array $numbersArray:

 An array of the MSISDNs (mobile number(s)) you wish to add.

string/int $groupName:

 Name (or integer ID) of the group to add the numbers to.

Returns:

an array with 3 keys: 'added', 'stopped', 'duplicates', each corresponding value being an array of numbers

Array keyValue
added 

Array. An array of numbers in international format (e.g.447000000000 for a UK mobile). These numbers were successfully added to the group.

stopped 

Array. An array of numbers in international format. These numbers were not added to the group because they are in a 'stop' group.

duplicates

Array. An array of numbers in international format. These numbers were not added to the group because they are already in the group.

Specific error codes:

CodeMeaning
0

The group ID or name was not specified or was invalid.

2No numbers were supplied for adding to the group.
3A number was not of a valid format.
4This service will not add to a merge group. Merge groups are not handled by this function.
Note

error code 404 is reported if the group does not exist. See General error codes

 

Warning
titleYou must know!

Our example code is an illustration of how you might integrate with our systems and is not certified for production environments. You are responsible for testing and QA.