Eventos (Opcional)
Hanu registra cada interacción de usuario con la plataforma. Cada interacción ejecuta un evento asociado. Los eventos disponibles actualmente son:
Eventos de Contenido
viewContent
Se activa cuando un usuario inicia la reproducción de cualquier contenido multimedia, ya sea un video instructivo o una receta en video.
endContent
Se activa cuando un usuario finaliza o se interrumpe la reproducción de cualquier contenido multimedia.
Eventos de Progreso
classCompleted
Se activa cuando un usuario completa el 100% de una clase dentro de cualquier programa disponible en la plataforma.
classRepeated
Se activa cuando un usuario completa el 100% de una clase que ya había completado anteriormente.
recipeCompleted
Se activa cuando un usuario completa el 100% de cualquier receta disponible en la plataforma.
Eventos de Logros
firstClassCompleted
Se activa exclusivamente cuando un usuario completa su primera clase en una disciplina que nunca antes había explorado.
programCompleted
Se activa con la finalización exitosa de todas las clases que componen un programa específico.
weeklyGoalCompleted
Se activa cuando el usuario alcanza el objetivo semanal que previamente estableció en su perfil.
Eventos de Perfil
profileUpdated
Se activa cuando el usuario realiza modificaciones significativas en su perfil nutricional o en sus objetivos de bienestar, limitándose a una activación semanal.
Webhook
El partner puede implementar un endpoint para recibir cada uno de estos eventos cuando sus usuarios interactúen de dicha manera en Hanu.
Cada evento incluye datos adjuntos asociados a la acción (ej. la “carga de una página” contiene la ruta de la página, el “término de un video” contiene el nombre del video, la duración, el progreso de visualización, etc.)
View Content
{
"publication": "video",
"created_at": "2025-01-22T18:23:19.028Z",
"name": "viewContent",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "video",
"payload": {
"section": "fitness",
"contentId": 29,
"progress": 0,
"realProgress": 0,
"playedSeconds": 0,
"duration": 0,
"name": "Pecho y Espalda",
"image_thumbnail_hs": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc",
"thumbnail": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc"
}
}
}
End Content
{
"publication": "video",
"created_at": "2025-01-22T18:30:59.213Z",
"name": "endContent",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "video",
"payload": {
"section": "fitness",
"contentId": 29,
"progress": 1,
"realProgress": 0.45,
"playedSeconds": 7,
"duration": 1324.82,
"name": "Pecho y Espalda",
"image_thumbnail_hs": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc",
"thumbnail": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc"
}
}
}
Class Completed
{
"publication": "video",
"created_at": "2025-01-22T18:33:54.627Z",
"name": "classCompleted",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "video",
"payload": {
"section": "fitness",
"contentId": 29,
"progress": 100,
"realProgress": 100,
"playedSeconds": 12345,
"duration": 12345,
"name": "Pecho y Espalda",
"image_thumbnail_hs": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc",
"thumbnail": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc"
}
}
}
Class Repeated
{
"publication": "video",
"created_at": "2025-01-22T18:33:54.627Z",
"name": "classRepeated",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "video",
"payload": {
"section": "fitness",
"contentId": 29,
"progress": 100,
"realProgress": 100,
"playedSeconds": 12345,
"duration": 12345,
"name": "Pecho y Espalda",
"image_thumbnail_hs": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc",
"thumbnail": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc"
}
}
}
Recipe Completed
{
"publication": "video",
"created_at": "2025-01-22T18:38:51.129Z",
"name": "recipeCompleted",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "recipe",
"payload": {
"section": "nutrition",
"contentId": 97,
"progress": 100,
"realProgress": 100,
"playedSeconds": 12345,
"duration": 12345,
"name": "Steaks de tofu con salsa de aguacate",
"image_sm": "https://hanu-bucket.s3-us-west-2.amazonaws.com/optimized1/sm/Steakdetofuconsalsadeaguacate_169.jpg",
"thumbnail": "https://hanu-bucket.s3-us-west-2.amazonaws.com/optimized1/sm/Steakdetofuconsalsadeaguacate_169.jpg"
}
}
}
First Class Completed
{
"publication": "video",
"created_at": "2025-01-22T18:43:28.215Z",
"name": "firstClassCompleted",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "video",
"payload": {
"section": "fitness",
"contentId": 29,
"progress": 100,
"realProgress": 100,
"playedSeconds": 12345,
"duration": 12345,
"name": "Pecho y Espalda",
"image_thumbnail_hs": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc",
"thumbnail": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc"
}
}
}
Program Completed
{
"publication": "video",
"created_at": "2025-01-22T18:50:30.164Z",
"name": "programCompleted",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "video",
"payload": {
"section": "fitness",
"contentId": 29,
"progress": 100,
"realProgress": 100,
"playedSeconds": 12345,
"duration": 12345,
"name": "Pecho y Espalda",
"image_thumbnail_hs": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc",
"thumbnail": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc"
}
}
}
Weekly Goal Completed
{
"publication": "video",
"created_at": "2025-01-22T18:55:30.769Z",
"name": "weeklyGoalCompleted",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "video",
"payload": {
"section": "fitness",
"contentId": 29,
"progress": 100,
"realProgress": 100,
"playedSeconds": 12345,
"duration": 12345,
"name": "Pecho y Espalda",
"image_thumbnail_hs": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc",
"thumbnail": "https://hanu-bucket.s3.us-west-2.amazonaws.com/optimized1/sm/m8ImdKb2jtaWB6LSgehc"
}
}
}
Profile Updated
{
"publication": "account",
"created_at": "2025-01-22T19:02:23.763Z",
"name": "profileUpdated",
"user": {
"id": 1,
"email": "jgutierrez@hanufit.com",
"internal_country_code": "MX",
"language": null,
"gender": "M",
"restriction_tag": "HANU-TEAM",
"type": "primary",
"first_name": "José D.",
"last_name": "Gutiérrez"
},
"content": {
"contentType": "nutrition",
"payload": {
"weight": "70",
"height": 1.7,
"fat": 30,
"workouts_per_week": 5,
"nutritional_objective": 2,
"gender_id": 1,
"birthday": "1996-07-25",
"is_smoker": "false"
}
}
}
Para implementar webhook de eventos, el partner debe informar previo inicio de integración URL y método(s) de autenticación del endpoint (Api Key[s], HMAC, Flujo Oauth, etc.). La implementación de webhooks siempre deben ser con verbo http de tipo POST.