POST /product/events
POST/product/events
This endpoint can be used to post attributes (name, price etc.) and events (view, add to cart, purchase) for several products.
An incoming request is rejected if the source is identified as bot or spider, according to user-agent filtering rules from IAB/ABC. Kameleoon is using single-pass method. This means nothing specific is to be done in the case request is sent from a web browser using a standard library (XHR); but in other cases the user should set a custom value to the User-Agent request header, to overwrite the default value set by the library.
Request
Query Parameters
Id of the Kameleoon project
Product Id / EAN. Note: if EAN is provided here, then it is assumed as the common value for all events in the body (bulk posting of several events restricted to the same product EAN). On the contrary, if you would like to bulk post several events across several different products EAN, then you must provide the EAN with every event in the body
Set to true if you provide the body content in JSON format, else URL query format is assumed. See body schema
false- */*
Body
required
Events to save. Body size limited to 1 MB.
When the URL query parameter is missing the "json" key or its value is set to false, the body consists of one or more lines, with each line representing an event in a specific format. The format is as follows: <parameter 1 name>=<parameter 1 value>&<parameter 2 name>=<parameter 2 value> and so on. Make sure to escape values that may contain characters = or &, for example using the function encodeURIComponent in JavaScript.
If the URL contains the query parameter "json" with the value set to true, then the body will be a JSON array of events. Each event will be represented as a JSON object, formatted like this: {"<parameter 1 name>": <parameter 1 value>, "<parameter 2 name>": <parameter 2 value>, etc.}.
In all cases, the body will contain the following parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| ean | string | Required if not provided in URL query parameters, else ignored | Product code Limited to 100 characters |
| eventType | string | Required | One of the following: PRODUCTPAGE, PRODUCTADDTOCART, PRODUCTBUY |
List of parameters for the eventType PRODUCTPAGE:
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | Product name Limited to 250 characters |
| categories | JSON array | Optional | JSON array of product categories Limited to 100 categories See below for the product category type description |
| url | string | Optional | Product URL Limited to 2048 characters |
| imageURL | string | Optional | URL of product picture Limited to 2048 characters |
| available | boolean | Optional | Is product available? |
| availableQuantity | int32 | Optional | Available quantities of product |
| brand | string | Optional | Product brand Limited to 250 characters |
| isChild | boolean | Optional | Is product is made for children? |
| isFashion | boolean | Optional | Does the product follow fashion? |
| fashion | JSON object | Optional | See below for the product fashion type description |
| sku | string | Optional | Product SKU Limited to 100 characters |
| merchantID | string | Optional | Product merchant Id Limited to 100 characters |
| price | float64 | Optional | Product price |
| oldPrice | float64 | Optional | Product old (crossed-out) price |
| tags | JSON array | Optional | JSON array of product tags (string) Limited to 100 tags Every tag is limited to 100 characters |
| rating | float64 | Optional | Product rating |
| description | string | Optional | Product description Limited to 4000 characters |
| params | JSON array | Optional | JSON array of product params Limited to 100 params See below for the product param type description |
| groupId | string | Optional | Product group id Limited to 100 characters |
| accessories | JSON array | Optional | JSON array of product accessories (string) Limited to 100 accessories Every accessory is limited to 100 characters |
| seasonality | JSON array | Optional | JSON array of monthes, from 1 to 12 |
| priceMargin | int32 | Optional | Product price margin |
| isNew | boolean | Optional | Is product is new? |
| auto | JSON object | Optional | See below for the product auto type description |
| model | string | Optional | Product model Limited to 100 characters |
| leftovers | string | Optional | Product leftovers Limited to 100 characters |
| typePrefix | string | Optional | Product type prefix Limited to 100 characters |
List of parameters for the eventType PRODUCTADDTOCART:
| Name | Type | Required | Description |
|---|---|---|---|
| quantity | int32 | Required | Quantity of product added to cart |
List of parameters for the eventType PRODUCTBUY:
| Name | Type | Required | Description |
|---|---|---|---|
| quantity | int32 | Required | Quantity of product bought |
The product category type is JSON object, with the following fields:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | Category Id Limited to 100 characters |
| name | string | Optional | Category name Limited to 100 characters |
| url | string | Optional | Category URL Limited to 2048 characters |
| parent | string | Optional | Parent category id Limited to 100 characters |
The product fashion type is JSON object, with the following fields:
| Name | Type | Required | Description |
|---|---|---|---|
| gender | string | Optional | Product gender Limited to 100 characters |
| type | string | Optional | Product type Limited to TODO characters |
| sizes | JSON array | Optional | JSON array of product sizes (string) Limited to 100 sizes Every size is limited to 100 characters |
| feature | string | Optional | Product feature Limited to 100 characters |
| colors | JSON array | Optional | JSON array of product colors Limited to 100 colors See below for the product color type description |
The product color type is JSON object, with the following fields:
| Name | Type | Required | Description |
|---|---|---|---|
| color | string | Required | Color Limited to 100 characters |
| picture | string | Optional | Color picture Limited to 2048 characters |
The product param type is JSON object, with the following fields:
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | Param name Limited to 100 characters |
| value | JSON array | Optional | JSON array of param values (string) Limited to 40 values Every value is limited to 250 characters |
| unit | string | Optional | Param unit Limited to 100 characters |
The product auto type is JSON object, with the following fields:
| Name | Type | Required | Description |
|---|---|---|---|
| compatibility | JSON array | Optional | JSON array of auto compatibilities (string) Limited to 100 compatibilities See below for the auto compatibility type description |
| vds | JSON array | Optional | JSON array of auto VDS (string) Limited to 100 VDS Every VDS is limited to 100 characters |
The auto compatibility type is JSON object, with the following fields:
| Name | Type | Required | Description |
|---|---|---|---|
| brand | string | Required | Brand Limited to 100 characters |
| model | string | Optional | Model Limited to 100 characters |
Note: in the examples below, we assume the parameter "ean" is provided in the URL query part, so this is bulk posting of several events restricted to the same product, and then "ean" is not needed in body events.
Body example in the case the URL query parameter "json" is missing or present with value false (NB: %5B%22S%22%2C%20%22M%22%2C%20%22L%22%5D is the escaped value of ["S", "M", "L"]):
eventType=PRODUCTPAGE&name=Marvelous%20product&available=true&availableQuantity=50&sizes=%5B%22S%22%2C%20%22M%22%2C%20%22L%22%5D
eventType=PRODUCTADDTOCART&quantity=2
Body example in the case the URL query parameter "json" is present with value true, with a "pretty" representation (not recommended):
[
{
"eventType": "PRODUCTPAGE",
"name": "Marvelous product",
"available": true,
"availableQuantity": 50,
"isFashion": true,
"fashion": {
"sizes": [
"S",
"M",
"L"
]
}
},
{
"eventType": "PRODUCTADDTOCART",
"quantity": 2
}
]
Body example in the case the URL query parameter "json" is present with value true, with a "compact" representation (recommended):
[{"eventType":"PRODUCTPAGE","name":"Marvelous product","available":true,"availableQuantity":50,"isFashion":true,"fashion":{"sizes":["S","M","L"]}},{"eventType":"PRODUCTADDTOCART","quantity":2}]
string
Responses
- 204
- 400
- 401
- 403
- 413
- 429
- 500
URL query was processed successfully and no content is returned
Body will be processed asynchronously, no syntax check on body was done yet
Malformed URL query syntax
Failed authentication (missing token when required, or bad token: malformed, expired, or invalid signature)
Forbidden user-agent or access denied to restricted resource
Body too large
Rate limited
Unexpected internal error