Remove Source
The Remove Source method allows you to remove the contact source using the source identification.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"ids":[
"YOUR_sourceId_1",
"YOUR_sourceId_2"
],
"customerSourceIds": [
"YOUR_customerSourceId_1",
"YOUR_customerSourceId_2"
]
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
ids optional
|
array | null |
Unique sourceId that is already registered in the system. |
customerSourceIds optional
|
array | null |
Unique customerSourceId that is already registered in the system. |
Response
{
"result": true,
"affectedRows":1
}
Parameters
Title | Type | Description |
---|---|---|
result |
boolean |
The value indicates that the source was successfully removed from your account:
|
affectedRows |
integer |
The number of sources that were removed in the request |
Method Errors
{
"result":false,
"errors":[
"Error description text"
]
}
Error |
---|
“Argument ids must be an array of strings” |
“Argument customerSourceIds must be an array of strings” |
“Each customerSourceId must be an alphanumeric string with 40 max chars length” |
“Add at least one identifier to remove” |
“No records found by this identifiers” |
“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/contact-source/remove';
$body = json_encode([
'ids' => [
"YOUR_sourceId_1",
"YOUR_sourceId_2",
],
'customerSourceIds' => [
"YOUR_customerSourceId_1",
"YOUR_customerSourceId_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);