Get event
The Get event method allows you to get detailed information about a custom event by using event name or id.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"id": "YOUR_REGISTERED_EVENT_ID",
"name": "YOUR_REGISTERED_EVENT_NAME"
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
id optional
|
string |
Unique EventId that is already registered in the Wooxy system. |
|
name optional
|
string |
Unique EventName that is already registered in the Wooxy system. |
Response
{
"result": true,
"data": [{
"id": "YOUR_EVENT_ID_1",
"name": "YOUR_EVENT_NAME",
"description": "YUOR_EVENT_DESCRIPTION",
"isConversion": true,
"cost": {
"value": "91.00",
"currency": "EUR"
},
"createdAt": "2021-07-14 15:51:17",
"updatedAt": "2021-07-14 15:51:17"
}]
}
Parameters
Title | Type | Description |
---|---|---|
result |
boolean |
The value indicates that the event was successfully fetched in your account:
|
data |
array |
An array of fetched information. |
data.id |
string |
The eventId in the Wooxy system. |
data.name |
string |
The eventName in the Wooxy system. |
data.description |
string |
Description note about your events. |
data.isConversion |
boolean |
If you want existing events to be taken into account in advanced analytics, mark the parameter as |
data.cost |
object |
Value and currency of your registered event. |
data.cost.value |
float |
value in |
data.cost.currency |
string |
(EUR, USD) |
data.createdAt |
string |
The creation time of the event in |
data.updatedAt |
string |
Last time when the information of the event was updated in |
Method Errors
{
"result":false,
"errors":[
"Error description text"
]
}
Error |
---|
“Argument ‘id’ must be a non-empty alphanumeric string” |
“Argument ‘name’ must be a non-empty alphanumeric string with a max length of 40 chars” |
“Minimum one unique event identification (id | name) is required.” |
“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/get';
$body = json_encode([
"id" => "YOUR_REGISTERED_EVENT_ID",
"name" => "YOUR_REGISTERED_EVENT_NAME"
]);
/**
* 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);