News! SmartSender.io becomes Wooxy. Read a post from the CEO
Wooxy API v.3.0

Fire Event

The Fire Event method allows you to initialize an event with detail configuration of them.

Request

POST
/v3/custom-event/fire

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: ISO8601
INFO Defaults:
If the time and date of the events are empty, we put down the date and time of adding the event to the Wooxy system.

ipAdress

optional
string

IP address is an identifying number that is associated with a specific computer or computer network.
Is used to target consumers on a specific internet network, by sending advertisements to the IP addresses accessing that network. IP address value in 'ENUM_STRING' format correspondingly.

userAgent

optional
string

A browser’s user agent string identify which browser is used, what version, and on which operating system.
UserAgent value in 'ENUM_STRING' format correspondingly.
Example: “Mozilla/5.0 (X11; Linux x86_64)”, “AppleWebKit/537.36 (KHTML, like Gecko)”, “Chrome/85.0.4183.121”,  “Safari/537.36”

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 'ENUM_STRING' format correspondingly.

utmSource

optional
string

Traffic source. For example: Direct, Adwords, website.

utmMedium

optional
string

Traffic type
It can be contextual advertising, social media advertising, 
banner advertising, advertising on price aggregators, retargeting sites, 
CPA networks, email newsletters.

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 'ENUM_STRING' format correspondingly

cost.currency

required
string

(EUR, USD)
WARNING: Please use only latin uppercase format. No numbers or other symbols allowed.

variables

optional
array null

You can add an associative array of custom variables which will be placed in your template which we host.

IMPORTANT Variables will be available only in Workflows.

Please, take in account variables usage priorities is case of conflicting variables:

  • First Priority: Variable from API request;
  • Second Priority: Variable from the Component Custom Variables;
  • Third Priority: Variable from the contact list.

variables.name

required
string

Variable name in lowerCamelCase format.
WARNING: Please use only latin lowerCamelCase format. No numbers or other symbols allowed.

variables.value

required
string

Variable value in 'ENUM_STRING' or 'ENUM_DATE' format correspondingly.

Response

                                        {
 "result":true
}
                                    

Parameters

Title Type Description

result

boolean

The value indicates that the event was successfully added to your account:

  • true: The event was successfully added to the contact.

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

PHP
                $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);