Remove Contact
The Remove Contact method allows you to remove a contact from a specific list using one of three unique identifiers (email | phoneNumber | userId).
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"contactListId": "YOUR_CONTACT_LIST_ID",
"webHookUri": "YOUR_WEBHOOK_URL",
"emails": [
"user-1@example.com",
"user-2@example.com",
"user-3@example.com"
],
"phoneNumbers": [
"+155555555",
"+155555556"
],
"userIds": [
"myUserId-1",
"myUserId-2"
]
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
contactListId required
|
string |
ID of the email list from which the contact should be removed. |
|
webHookUri optional
|
string |
The Wooxy will send a |
|
emails optional
|
array | null |
An array of email addresses of contacts to be removed.
|
phoneNumbers optional
|
array | null |
An array of phone numbers of contacts to be removed.
|
userIds optional
|
array | null |
An array of userIds of contacts to be removed.
|
Response
{
"result": true,
"requestId": "5d915c22d132d5f45a4e38b8"
}
Parameters
Title | Type | Description |
---|---|---|
result |
boolean |
The value indicates that the “Remove contact” request was successfully validated and accepted by Wooxy and queued for processing:
|
requestId |
string |
Unique request ID to be used to match the specific “Remove contact” request with the Status Webhook, which will be sent by Wooxy after the request is processed. |
Method Errors
{
"result": false,
"requestId": "5bc0a73d19b6051f963023c3",
"errors": [
"Error description text"
]
}
Error |
---|
“Maximum count of records per transaction is 100, current {n}” |
“Argument contactListId must be a non-empty string” |
“Argument webHookUri must be a valid URI” |
“Argument emails must be a list of emails” |
“Each email must be a string” |
“Argument phoneNumbers must be a list of phoneNumbers” |
“Each phoneNumber must be a string” |
“Argument userIds must be a list of userIds” |
“Each userId must be a string” |
“List with id {contactListId} not found!” |
“add at least one contact to remove” |
“Request saving error. Please, contact us or try again later” |
“Invalid authorization token!” |
“Internal server error” |
“Bad Request” |
“no matches found for access token {accessToken}” |
“user {id} not enabled” |
“no data found for key {userId}” |
“access token check failed for key\/secret $key\/$accessToken” |
“Argument {argument} required” |
Code Examples
$accessToken = "YOUR_API_KEY";
$url = 'https://api.wooxy.com/v3/contacts/remove';
$body = json_encode([
'contactListId' => 'YOUR_CONTACT_LIST_ID',
'webHookUri' => 'YOUR_WEBHOOK_URL',
'emails' => [
'user-1@example.com',
'user-2@example.com',
'user-3@example.com'
],
'phoneNumbers' => [
'+155555555',
'+155555556'
],
'userIds' => [
'myUserId-1',
'myUserId-2'
],
]);
/**
* Request Example
*/
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Access-Token: $accessToken",
'Content-Type: application/json',
'Content-Length: ' . strlen($body),
]);
$result = curl_exec($ch);
if ($result === false) {
echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
echo strval($result) . PHP_EOL;
}
curl_close($ch);