Generic Payload and Event Details

First, every webhook will have a property event_id. This property represents the identification for each webhook you receive and is a UUID type. The second common property in all webhook events is event_type, which is an identifier for the event we send. The specific payload for the events is located in the data property.

Currently, Aiwifi sends the following events:

  • guest.connected: This event sends information about the user when they connect to the portal.
  • 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).
  • guest.interests: This event sends the interests that users selected (your brand must have an active interests campaign for this event).

The specific payload for all events is described below.

Events

In this section, we describe the payload that Aiwifi sends for each type of event in our webhooks.

Guest Connected Event

As mentioned in the generic payload section, all events contain common data, but each event also includes specific data.

The data property of the payload contains event-specific information. In the case of a user connecting to the portal, the user 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.

Additionally, the payload includes information about your brand, the location where the user is situated, and the access point (node) where the user is connected to the portal.

{
    "event_type" : "guest.connected",
    "event_id" : "921fcb0afcd9215cd624c7211d638bf17cb599bc2ba6e2bd35b777491eca25f0",
    "data" : {
        "user" : {
            "id" : 1020,
            "name" : "John Doe",
            "email" : "[email protected]",
            "phone": "+5255556789890"
            "postalCode" : "62577",
            "bithdate" : "1990-01-01",
            "gender": "Male"
        },
        "brand" : {
            "id" : 845,
            "name": "Main"
        }
        "location" : {
            "id" : 1,
            "name" : "Oficina Principal"
        },
        "node" : {
            "id" : 2,
            "name" : "Principal",
            "mac" : "AA:AA:AA:AA:AA"
        }
    }
}

Survey Answer Created Event

As mentioned in the generic payload section, all events contain common data, but each event also includes specific data.

The data property of the payload contains event-specific information. In this case, when a user answers a survey question campaign, the guest property contains information about the guest in your brand.

Additionally, the payload includes information about your brand, the location where the user is situated, and details about the campaign. The campaign property contains the questions and the answers provided by the user.

{
    "event_type" : "surveyAnswer.created",
    "event_id" : "921fcb0afcd9215cd624c7211d638bf17cb599bc2ba6e2bd35b777491eca25f0",
    "data" : {
        "guest" : {
            "id" : 1020,
            "name" : "John Doe",
            "email" : "[email protected]",
            "postalCode" : "62577"
        },
        "location" : {
            "id" : 1,
            "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"
                }
            ]
        }
    }
}

Guest Selected Interests Event

When a guest selects an interest, Aiwifi sends a payload containing information about the guest and the interests they have chosen. The payload includes the names of the interests that the brand added to their interests campaign.

Additionally, the payload contains information about your brand, the location where the user is situated, and details about the campaign. The campaign property includes the objects for the questions and the answers provided by the user.

{
    "event_type" : "guest.interests",
    "event_id" : "921fcb0afcd9215cd624c7211d638bf17cb599bc2ba6e2bd35b777491eca25f0",
    "data" : {
        "user" : {
            "id" : 1020,
            "name" : "John Doe",
            "email" : "[email protected]",
            "phone": "+5255556789890"
            "postalCode" : "62577",
            "bithdate" : "1990-01-01",
            "gender": "Male"
        },
        "interestItemsSelected" : {
           "Interest A",
           "Interest B",
           "Interest D"
        },
        "brand" : {
            "id" : 519,
            "name": "Main"
        }
        "location" : {
            "id" : 1,
            "name" : "Oficina Principal"
        },
        "node" : {
            "id" : 2,
            "name" : "Principal",
            "mac" : "AA:AA:AA:AA:AA"
        }
    }
}

Was this article helpful?

Logs, Validation and Testing of Webhooks