Update Event
The Update Event method allows you to update a custom event.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"customEvent": "YOUR_REGISTERED_EVENT_ID or EVENT_NAME",
"name": "New_EVENT_NAME",
"description": "New_EVENT_DESCRIPTION",
"isConversion": true,
"cost": {
"value": 2.05,
"currency": "EUR"
}
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
customEvent required
|
string |
Unique EventId or EventName that is already registered in Wooxy system. |
|
name required
|
string |
Changes EventName. It must be unique. |
|
description optional
|
string |
Description note about your events. |
|
isConversion optional
|
boolean | false |
If you want existing events to be taken into account in advanced analytics, mark the parameter as |
cost optional
|
object | null |
Value and currency of your registered event. |
cost.value required
|
float |
value in |
|
cost.currency required
|
string |
(EUR, USD) |
Response
{
"result":true
}
Parameters
Title | Type | Description |
---|---|---|
result |
boolean |
The value indicates that the event was successfully updated to your account. |
Method Errors
{
"result":false,
"errors":[
"Argument customEvent required"
]
}
Error |
---|
“Argument ‘customEvent’ must be a non-empty string: ID or name of updating instance” |
“Argument ‘name’ must be a non-empty alphanumeric string with a max length of 40 chars” |
“Argument ‘description’ must be a non-empty string with max length 1000 chars” |
“Argument ‘isConversion’ must be a boolean” |
“Argument ‘cost’ must be an array with value and currency fields” |
“Cost value must be a positive float” |
“Cost currency {currency} not allowed. USD, EUR are.” |
“Argument ‘customEvent’ required”,”Custom event {customEvent} not found in your account” |
“Custom event with this parameter is already registered” |
“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/update';
$body = json_encode([
'customEvent' => 'YOUR_REGISTERED_EVENT_ID or EVENT_NAME',
'name' => 'New_EVENT_NAME',
'description' => 'New_EVENT_DESCRIPTION',
'isConversion' => true,
'cost' => [
'value' => 0.06,
'currency' => 'USD',
],
]);
/**
* 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);