Remove Event
The Remove Event method allows you to remove a custom event using event identificator.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"ids": [
"YOUR_registred_eventId_1",
"YOUR_registred_eventId_2"
],
"names":[
"YOUR_registred_eventName_1",
"YOUR_registred_eventName_2"
]
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
ids optional
|
array | null |
Unique EventIds that are already registered in the Wooxy system. |
names optional
|
array | null |
Unique EventNames that are already registered in the Wooxy system. |
Response
{
"result":true,
"affectedRows":1
}
Parameters
Title | Type | Description |
---|---|---|
result |
boolean |
The value indicates that the event was successfully removed from your account:
|
affectedRows |
integer |
The number of events that were removed from the Wooxy system. |
Method Errors
{
"result":false,
"errors":[
"No records found by this identifiers"
]
}
Error |
---|
“Argument ids must be an array of strings” |
“Argument names must be an array of strings” |
“Each names 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/custom-event/remove';
$body = json_encode([
'ids' => [
'id1', 'id2'
],
'names' => [
'ApiEvent_1_updated', 'name2'
],
]);
/**
* 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);