Delete a contact from group on your account
<?php $key = "ewjd824g"; //Account key. Get it from account settings $secret = "wwe89rh3qb083r7h30b0d0u8rh033jf39h8r0f3"; //Account secret. Get it from account settings $groupToDeleteFrom = "2014list"; $contactToDelete = "447900495583"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.smsjuice.com/groups/contacts/{$key}/{$secret}/{$groupToDeleteFrom}/{$contactToDelete}"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); 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::deleteGroup($key, $secret, $groupToDelete); ?>
Parameter | Description | Required |
---|---|---|
key | account authentication key | Required |
secret | account authentication secret | Required |
groupName | name of group the contact will be deleted from | Required |
contact | contact to be deleted | Required |
{ "operation": "successful" }
Success Response | Description |
---|---|
successful | delete was a success |
{ "operation":"failed", "error":"Group 'mixture2' does not Exist." }
Error Response | Description |
---|---|
invalid_credentials | Invalid API key and/or secret |
Group does not exist | Group does not exist |
Contact does not exist | Contact does not exist |