Event Validation

Incoming analytics events are validated before they are accepted and processed. If you encounter any errors during the integration of 8.API Tracking in your product, you can check the structure of your events against our validation test endpoint at https://api.8select.io/analytics/v3/events/validate:

POST /analytics/v3/events/validate
Host: https://api.8select.io
Content-Type: application/json
x-api-id: <Your API ID>

{
  "type": "view",
  "view": {
    "type": "customSet"
  },
  "context": [
    {
      "type": "user",
      "user": {
        "id": "c57a43f7-eefc-462b-b5a8-0ef421e90f67"
      }
    }
  ]
}

The above event is missing the customSet property, which is required for view events of type "customSet". The validation endpoint will thus among others report this violation:

[
  ...,
  {
    "instancePath": "/view",
    "schemaPath": "#/definitions/PayloadCustomSet/required",
    "keyword": "required",
    "params": {
      "missingProperty": "customSet"
    },
    "message": "must have required property 'customSet'"
  },
  ...
]

Please note, that the validation endpoint is currently set to be very verbose. This means, it will often contain multiple alerts caused by the same schema violation. We are working on a solution to make the output more concise.

Last updated