Type of events
Currently, Aiwifi sends the following events when an user visits and connects with the captive portal:
guest.connected
: This event sends information about the user when they connect to the portal.guest.data
: This event sends information about what information was provided by the user when they connect to the portal.guest.interests:
This event sends the interests that users selected (your brand must have an active interests campaign for this event).surveyAnswer.created
: This event sends information about the user's answer to a survey campaign (your brand must have an active survey campaign for this event).
Generic Payload
First, each webhook will have a property called event_id
. This property identifies each webhook you receive and is a UUID. The second common property in all webhook events is event_type
, which identifies the event we send. The third common property is event_date
, which indicates when the event occurred.
Event Payload
In this section, we describe the payload that Aiwifi sends for each type of event in our webhooks. As mentioned in the generic payload section, all events contain common data, but each event also includes specific data.
The specific payload for the events is located in the
property and contains event-specific information: data
The user
That is the guest who connected to the portal captive.
The brand
to which the visited captive portal belongs.
The location
where the guest was.
The Access Point (node
) that the guest was connected to.
The device
used by the guest to connect to the captive portal.
Guest connected into portal Event
Type: guest.connected
In this case, a user is connecting to the portal, the
property contains information about the guest in your brand. This information varies based on the user's connection and the data Aiwifi collects about that guest. user
Example
{
"event_type": "guest.connected",
"event_id": "921fcb0afcd9215cd624c7211d638bf17cb599bc2ba6e2bd35b777491eca25f0",
"event_date": 1748975116,
"data": {
"user": {
"id": 1020,
"name": "Mary Doe",
"email": "[email protected]",
"birthdate": "1980-01-01",
"gender": "Female",
"phone": null,
"postalCode": null,
"nationality": null,
"habeasDataAcceptedAt": "2025-10-06 13:00:00"
},
"brand": {
"id": 31,
"name": "Brand A"
},
"location": {
"id": 1,
"externalId": null,
"name": "Oficina Principal"
},
"node": {
"id": 2,
"name": "Principal",
"mac": "AA:AA:AA:AA:AA:AA"
},
"device": {
"id": 1,
"macAddress": "BB:BB:BB:BB:BB:BB",
"type": "mobile",
"platform": "Android",
"model": "Samsung"
},
}
}
Guest provided new data Event
Type: guest.data
When a guest connects to the portal and provides information during the data capture campaign, Aiwifi sends an event indicating the information provided by the guest through the newData
attribute. This event also contains the generic payload that provides context.
Example:
{
"event_type": "guest.data",
"event_id": "88b81922-d621-419a-b4d8-3e6398943504",
"event_date": 1748975116,
"data": {
"guest": {
"id": 1,
"email": "[email protected]",
"name": null,
"birthdate": null,
"phone": null,
"gender": "Male",
"postalCode": null,
"nationality": "US",
"habeasDataAcceptedAt": "2025-10-06 13:00:00"
},
"brand": {
"id": 1198,
"name": "Main"
},
"location": {
"id": 1385,
"name": "Main location",
"externalId": null
},
"node": {
"id": 1286,
"mac": "EE:EE:EE:EE:EE:EE",
"name": "main"
},
"device": {
"id": 1,
"macAddress": "00:00:00:00:00:00",
"type": "mobile",
"platform": "Android",
"model": "Samsung"
},
"newData": {
"gender": "male",
"nationality": "US",
"timestamp": 1748975116
}
}
}
Guest Selected Interests Event
Type: guest.interests
In that type of campaign, when a guest selects interests, Aiwifi sends a payload containing their information and the chosen interests in the interestItemsSelected
attribute. This includes the names of the interests that the brand added to the campaign.
Example:
{
"event_type" : "guest.interests",
"event_id" : "921fcb0afcd9215cd624c7211d638bf17cb599bc2ba6e2bd35b777491eca25f0",
"event_date": 1748975116,
"data" : {
"user" : {
"id" : 1020,
"name" : "John Doe",
"email" : "[email protected]",
"phone": "+52556789890",
"postalCode" : null,
"birthdate" : "1990-01-01",
"gender": "Male",
"nationality" : "MX",
"habeasDataAcceptedAt" : "2025-10-06 13:00:00"
},
"brand" : {
"id" : 519,
"name": "Main"
},
"location" : {
"id" : 1,
"externalId" : 123,
"name" : "Oficina Principal"
},
"node" : {
"id" : 2,
"name" : "Principal",
"mac" : "AA:AA:AA:AA:AA:AA"
},
"interestItemsSelected" : [
"Interest A",
"Interest B",
"Interest D"
]
}
}
Survey Answer Created Event
Type: surveyAnswer.created
In this case, when a user answers a survey question campaign, the
property contains information about the guest in your brand. The guest
property contains the campaign
questions
of the survey and the answers
provided by the user.
Example:
{
"event_type": "surveyAnswer.created",
"event_id": "921fcb0afcd9215cd624c7211d638bf17cb599bc2ba6e2bd35b777491eca25f0",
"event_date": 1748975116,
"data": {
"guest": {
"id": 1020,
"name": "John Doe",
"email": "[email protected]",
"postalCode": "62577",
"phone": "+525512345678",
"birthdate": null,
"gender": null,
"nationality": null,
"habeasDataAcceptedAt": "2025-10-06 13:00:00"
},
"brand": {
"id": 31,
"name": "Brand A"
},
"device": {
"macAddress": "00:00:00:00:00:00",
"platform": "Android",
"type": "mobile",
"model": "Samsung"
},
"node": {
"id": 2,
"name": "Principal",
"mac": "AA:AA:AA:AA:AA:AA"
},
"location": {
"id": 1,
"externalId": 123,
"name": "Oficina Principal"
},
"campaign": {
"id": 12,
"created_at": "2022-02-20",
"updated_at": "2022-02-20",
"questions": [
{
"id": 1,
"type": "nps",
"question": "¿Cuál es la probabilidad de que recomiendes Doña Tota a un amigo o colega?"
},
{
"id": 2,
"question": "Independientemente de la sucursal. En el mes, ¿Con qué frecuencia visitas Doña Tota?",
"type": "single_choice",
"choices": [
{
"value": 1,
"text": "1 vez al mes"
},
{
"value": 2,
"text": "2 veces al mes"
},
{
"value": 3,
"text": "3 veces al mes"
},
{
"value": 4,
"text": "4 veces al mes"
},
{
"value": 1,
"text": "Diario"
}
]
},
{
"id": 3,
"question": "¿En qué horario sueles visitarnos?",
"type": "single_choice",
"choices": [
{
"value": 1,
"text": "8:00 am - 9:00am"
},
{
"value": 2,
"text": "10:00 am - 12:59 pm"
},
{
"value": 3,
"text": "1:00 pm - 3:59 pm"
},
{
"value": 4,
"text": "De 4:00 pm en adelante"
}
]
},
{
"id": 4,
"question": "De la siguiente lista de atributos, en una escala de 1 al 5, donde 5 es Muy Satisfecho y 1 Muy Insatisfecho",
"type": "matrix",
"subtype": "rating",
"rows": [
{
"value": 1,
"text": "El sabor de los alimentos"
},
{
"value": 2,
"text": "Rapidez y Eficiencia en el servicio"
},
{
"value": 3,
"text": "Trato del personal"
},
{
"value": 4,
"text": "Limpieza en instalaciones"
},
{
"value": 5,
"text": "Relación Calidad-Precio"
}
]
},
{
"id": 5,
"question": "Tomando en cuenta tu experiencia en esta visita, ¿Qué tan probable es que regreses a Doña Tota?",
"type": "single_choice",
"choices": [
{
"value": 1,
"text": "Definitivamente Regresaria"
},
{
"value": 2,
"text": "Probablemente Regresaria"
},
{
"value": 3,
"text": "Podria o no regresar"
},
{
"value": 4,
"text": "Probablemente no regresaria"
},
{
"value": 5,
"text": "Definitivamente no regresaria"
}
]
},
{
"id": 6,
"question": "¿Que haces con más frecuencia?",
"type": "single_choice",
"choices": [
{
"value": 1,
"text": "Consumir en el lugar"
},
{
"value": 2,
"text": "Pedir para llevar"
}
]
},
{
"id": 7,
"question": "¿Sueles utilizar el servicio a domicilio a través de las aplicaciones de comida como UberEats, Rappi o DiDiFood?",
"type": "single_choice",
"choices": [
{
"value": 1,
"text": "Si"
},
{
"value": 21,
"text": "Si"
}
]
},
{
"id": 8,
"question": "Indica por favor tu género",
"type": "single_choice",
"choices": [
{
"value": 1,
"text": "Femenino"
},
{
"value": 21,
"text": "Masculino"
}
]
},
{
"id": 9,
"question": "Selecciona tu edad en los siguientes rangos",
"type": "single_choice",
"choices": [
{
"value": 1,
"text": "15 a 20 años"
},
{
"value": 2,
"text": "21 a 34 años"
},
{
"value": 3,
"text": "35 a 49 años"
},
{
"value": 4,
"text": "50 a 64 años"
},
{
"value": 5,
"text": "Más de 65 años"
}
]
}
],
"answers": [
{
"question_id": 1,
"answer": 8
},
{
"question_id": 2,
"answer": "3 veces al mes"
},
{
"question_id": 3,
"answer": "De las 4pm en adelante"
},
{
"question_id": 4,
"ansers": [
{
"row_id": 1,
"answer": 4
},
{
"row_id": 2,
"answer": 4
},
{
"row_id": 3,
"answer": 4
},
{
"row_id": 4,
"answer": 3
},
{
"row_id": 5,
"answer": 5
}
]
},
{
"question_id": 5,
"answer": "Definitivamente Regresaria"
},
{
"question_id": 6,
"answer": "Comi en el lugar."
},
{
"question_id": 7,
"answer": "No"
},
{
"question_id": 8,
"answer": "Femenino"
},
{
"question_id": 9,
"answer": "35 a 49 años"
}
]
}
}
}