Fire Event
The Fire Event method allows you to initialize an event with detail configuration of them.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"domain": "senderDomain.com",
"customEvent": "YOUR_REGISTERED_EVENT_ID or EVENT_NAME",
"contact": "user@example.com",
"dateTime": "2020-11-01T19:30:22+02:00",
"ipAddress": "127.0.0.1",
"userAgent": "Chrome/85.0.4183.121",
"httpReferer": "https://some.link/some-path?some=query",
"utmSource":"traffic_source",
"utmMedium": "traffic type",
"utmCampaign": "advertising campaign",
"utmContent": "content",
"utmTerm": "keyword",
"cost": {
"value": 2.05,
"currency": "EUR"
},
"variables": [
{
"name": "newVariableName1",
"value": "newVariableValue1"
},
{
"name": "newVariableName2",
"value": "YYYY-MM-DD"
}
]
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
domain required
|
string |
Verified domain name from your Wooxy account. This data is used to send your webhooks and generate reports. |
|
customEvent required
|
string |
Unique EventId or EventName that is already registered in the Wooxy system. |
|
contact required
|
string |
The ’email’ address, ‘userId’ or ‘phoneNumber’ of the recipient stored in the DefaultContactList. |
|
dateTime optional
|
string |
Date and time when the event occurred. Format DateTime: |
|
ipAdress optional
|
string |
IP address is an identifying number that is associated with a specific computer or computer network. |
|
userAgent optional
|
string |
A browser’s user agent string identify which browser is used, what version, and on which operating system. |
|
httpReferer optional
|
string |
Optional HTTP header field that identifies the address of the webpage which is linked to the resource being requested. httpReferer value in |
|
utmSource optional
|
string |
Traffic source. For example: Direct, Adwords, website. |
|
utmMedium optional
|
string |
Traffic type |
|
utmCampaign optional
|
string |
Advertising campaigns name of the ad campaign. |
|
utmContent optional
|
string |
This tag is filled arbitrarily, banner text. |
|
utmTerm optional
|
string |
Keyword Manually set a keyword, specified a dynamic parameter, which a keyword will replace. |
|
cac optional
|
object | null |
An object that contains comprehensive data regarding the cost of acquiring customers comprises the value and currency. |
cost.value required
|
float |
Value in |
|
cost.currency required
|
string |
(EUR, USD) |
|
variables optional
|
array | null |
You can add an associative array of custom variables which will be placed in your template which we host.
|
variables.name required
|
string |
Variable name in lowerCamelCase format. |
|
variables.value required
|
string |
Variable value in |
Response
{
"result":true
}
Parameters
Title | Type | Description |
---|---|---|
result |
boolean |
The value indicates that the event was successfully added to your account:
|
Method Errors
{
"result":false,
"errors":[
"Argument 'ipAddress' must be a valid IPv4 address"
]
}
Error |
---|
“Argument domain must be a non-empty string” |
“Domain {domain} not found in your account” |
“Argument ‘customEvent’ must be an alphanumeric string with max length 40 chars” |
“Custom event {customEvent} not found in your account” |
“Argument ‘contact’ must be a non-empty string” |
“Invalid ‘dateTime’ parameter” |
“Argument ‘ipAddress’ must be a valid IPv4 address” |
“Argument ‘httpReferer’ must be a valid URL” |
“Argument ‘utmSource’ must be a non-empty string” |
“Argument ‘utmMedium’ must be a non-empty string” |
“Argument ‘utmCampaign’ must be a non-empty string” |
“Argument ‘utmContent’ must be a non-empty string” |
“Argument ‘utmTerm’ must be a non-empty string” |
“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.” |
“Custom event with this parameters 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/add';
$body = json_encode([
'domain' => 'senderDomain.com',
'customEvent' => 'YOUR_REGISTERED_EVENT_ID or EVENT_NAME',
'contact' => 'user@example.com',
'dateTime' => '2020-11-01T19:30:22+02:00',
'ipAddress' => '127.0.0.1',
'userAgent' => 'Mozilla/5.0 (X11; Linux x86_64)',
'httpReferer' => 'https://some.link/some-path?some=query',
'utmSource' => 'traffic_source',
'utmMedium' => 'traffic type',
'utmCampaign' => 'advertising campaign',
'utmContent' => 'content',
'utmTerm' => 'keyword',
'cost' => [
'value' => 0.06,
'currency' => 'USD',
],
'variables' => [
[
'name' => 'newVariableName1',
'value' => 'newVariableValue1'
],
[
'name' => 'newVariableName2',
'value' => 'YYYY-MM-DD'
],
]
]);
/**
* 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);