Wooxy API v.3.0

Find Event

The Find Event method allows you to find one or more custom events.

Important! In this method, pagination is used to display information about a large number of lists simultaneously. The offset is considered the starting point, and the limit is the endpoint.

Request

POST
https://api.wooxy.com/v3/custom-event/find

IMPORTANT: Do not send more than 10 concurrent API requests.

Body Example

                                        {
  "id": "YOUR_REGISTERED_EVENT_ID",
  "name": "YOUR_REGISTERED_EVENT_NAME",
  "offset": 0,
  "limit": 20
}
                                    

Parameters

Title Type Default Description

id

optional
string

Unique EventId that is already registered in Wooxy system.

name

optional
string

Unique EventName that is already registered in Wooxy system.

offset

optional
integer 0

Allows you to omit a specified number of rows (number of events) before the beginning of return rows (events) from the query.

limit

optional
integer 20

Allows you to limit the number of rows (events) returned from a query.

Response

                                        {
 "result":true,
 "data":[{
            "id":"YOUR_eventId_1",
            "name":"YOUR_EventName",
            "description":"",
            "isConversion":true,
            "cost":{
                      "value":"91.00",
                      "currency":"EUR"
                    },
            "createdAt":"2020-11-06 13:57:53",
            "updatedAt":"2020-11-06 13:57:53"
          }],
"totalCount":1,
"offset":0,
"limit":20
}
                                    

Parameters

Title Type Description

result

boolean

The value indicates that the event was successfully found in your account:

  • true: The event was successfully found.

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 true or false if not.

data.cost

object

Value and currency of your registered event.

data.cost.value

float

value in 'ENUM_STRING' format correspondingly.

data.cost.currency

string

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

data.createdAt

string

Creation time of the event in YYYY-MM-DD h:i:s format.

data.updatedAt

string

Last time when the information of the event was updated in YYYY-MM-DD h:i:s format.

totalCount

integer

The number of events that were found in the request.

offset

integer

Allows you to omit a specified number of rows (number of events) before the beginning of return rows (events) from the query.

limit

integer

Allows you to limit the number of rows (events) returned from a query.

Method Errors

                                        {
   "result":false,
   "errors":[
      "Argument 'id' must be a non-empty alphanumeric string (MongoID)"
   ]
}
                                    
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”

“Argument offset must have a numeric value”

“Argument limit must have a numeric value”

“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/find';
$body = json_encode([
    'id'     => 'YOUR_REGISTERED_EVENT_ID', 
    'name'   => 'YOUR_REGISTERED_EVENT_NAME',
    'offset' => 0, 
    'limit'  => 20, 
]);
/**
 * 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;
    $decoded = json_decode($result, true);
    if(isset($decoded['data'])) {
        foreach($decoded['data'] as $i => $sourceData) {
            echo $i . ' => ' . $sourceData['name'] . PHP_EOL;
        }
    }
}
curl_close($ch);