Get a list of all the contacts from a group on your account - This returns the numbers and names (where stored) of all the contacts in a group.
<?php
$key = "ewjd824g"; //Account key. Get it from account settings
$secret = "wwe89rh3qb083r7h30b0d0u8rh033jf39h8r0f3"; //Account secret. Get it from account settings
$group = "IAmAnExistingGroup";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.smsjuice.com/groups/contacts/all/{$key}/{$secret}/{$group}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
<?php
include("../class/ContactGroup.class.php");
include("../TextMessagingService.php");
use TextMessagingService;
//get ALL groups on your account
echo TextMessagingService::getAllGroupContacts($key, $secret, $group);
?>
| Parameter | Description | Required |
|---|---|---|
| key | account authentication key | Required |
| secret | account authentication secret | Required |
{
"groupName":"mixture3",
"contacts":[
{
"name":"447900385586",
"number":"447900385586"
},
{
"name":"Jogn tshack",
"number":"447799653542"
},
{
"name":"447911385586",
"number":"447911385586"
},
{
"name":"Jim Ronald",
"number":"447799611542"
}
]
}
| Success Response | Description |
|---|---|
| groupName | Name of group whose contacts have been returned |
| contact | Contacts, with names where names where stored. |
{
"query": "failed",
"error": "invalid_credentials"
}
| Error Response | Description |
|---|---|
| invalid_credentials | Invalid API key and/or secret |
| Group does not Exist. | Group does not Exist. |