Saltar al contenido principal

Webhooks

Los webhooks te permiten recibir notificaciones en tiempo real cuando un reporte se completa. WeCheck enviará automáticamente una petición POST a la URL de webhook que tengas configurada en los ajustes de tu API key.

¿Cuándo se Disparan los Webhooks?

Una notificación por webhook se envía automáticamente cuando el estado de un reporte cambia a complete. Esto permite que tu sistema reaccione de inmediato a los reportes completados sin necesidad de hacer polling a nuestra API.

Formato de Respuesta del Webhook

El payload del webhook usa la misma estructura de datos que la respuesta del endpoint /api/v1/report/{id}. Esta consistencia facilita procesar la información sin importar cómo la recuperes.

Ejemplo de Estructura del Payload:

{
"message": "message",
"status": 200,
"data": {
"report": {
"id": "report_123456",
"pdfUrl": "https://example.com/reports/123456.pdf",
"startDate": "2024-03-19T10:00:00Z",
"endDate": "2024-03-19T11:00:00Z",
"input": {
"pictureUrl": "https://example.com/profile.jpg",
"name": "John",
"lastName": "Doe",
"middleName": "William",
"nickname": "Johnny",
"ageOrDateOfBirth": "1990-01-01",
"city": "New York",
"state": "NY",
"country": "United States",
"email": "john.doe@example.com",
"highSchool": "Central High School",
"college": "State University",
"phone": "+1234567890",
"company": "Tech Corp",
"twitterUrl": "https://twitter.com/johndoe",
"facebookUrl": "https://facebook.com/johndoe",
"instagramUrl": "https://instagram.com/johndoe",
"linkedInUrl": "https://linkedin.com/in/johndoe",
"tikTokUrl": "https://tiktok.com/@johndoe",
"pinterestUrl": "https://pinterest.com/johndoe",
"redditUrl": "https://reddit.com/user/johndoe",
"topics": ["topic1", "topic2"]
},
"subject": {
"personData": {},
"risks": [
{
"name": "Inappropriate Content",
"count": 3
},
{
"name": "Harmful Speech",
"count": 1
}
],
"channelVolume": [
{
"channel": "LinkedIn",
"posts": 42,
"flagged": 2
},
{
"channel": "Twitter",
"posts": 156,
"flagged": 5
}
],
"pdfType": "ai_report"
},
"posts": {
"totalPosts": 150,
"flaggedPosts": 5,
"positivePosts": 80,
"negativePosts": 20,
"webSearchPosts": 30,
"socialMedia": [
{
"id": "acc_123456",
"name": "LinkedIn",
"userName": "johndoe123",
"profileImgUrl": "https://platform.com/profile/image.jpg",
"profileLink": "https://linkedin.com/in/johndoe",
"followers": 500,
"following": 300,
"postsCount": 120,
"flaggedCount": 2,
"bio": "Software Engineer | Tech Enthusiast",
"isPrivate": false
}
],
"posts": [
{
"id": "post_123456",
"platform": "Twitter",
"type": "Post",
"link": "https://twitter.com/user/status/123456",
"content": "Just shared my thoughts on the latest tech trends!",
"date": "2024-03-19T10:30:00Z",
"sentimentFlag": "Positive",
"flagged": false,
"flaggedText": "Inappropriate content detected",
"mediaUrl": "https://platform.com/media/image.jpg",
"videoUrl": "https://platform.com/media/video.mp4",
"flags": ["inappropriate", "spam"],
"sentimentReason": "Positive language and constructive content",
"flagReason": "Contains inappropriate language",
"socialMediaId": "acc_123456"
}
]
},
"topics": ["Technology", "Professional Conduct"],
"career": [
{
"title": "Software Engineer",
"company": "Tech Corp",
"startDate": "2020-01-01",
"endDate": "2024-01-01",
"description": "Software Engineer at Tech Corp",
"companyLogoUrl": "https://example.com/logo.png",
"companyLinkedinURL": "https://linkedin.com/company/techcorp",
"companyStaffCountRange": "100-200"
}
],
"education": [
{
"startDate": "2020-01-01",
"endDate": "2024-01-01",
"title": "Software Engineer",
"grade": "A",
"fieldOfStudy": "Tech Corp",
"schoolUrl": "https://example.com/school"
}
],
"skills": [
{
"name": "Software Engineer",
"passedSkillAssessment": true,
"endorsementsCount": 10
}
],
"address": [
{
"address_line_2": "Apt 123",
"continent": "North America",
"country": "United States",
"first_seen": "2024-01-01",
"full_address": "123 Main St, Apt 123, New York, NY 10001",
"geo": "123 Main St, Apt 123, New York, NY 10001",
"last_seen": "2024-01-01",
"locality": "New York",
"metro": "New York",
"name": "123 Main St",
"num_sources": 10,
"postal_code": "10001",
"region": "New York",
"street_address": "123 Main St",
"status": "checked"
}
],
"workEmail": [
{
"email": "john.doe@example.com",
"status": "checked",
"type": "personal"
}
],
"personalEmail": [
{
"email": "john.doe@example.com",
"status": "checked",
"type": "personal"
}
],
"phones": [
{
"phone": "+1234567890",
"status": "checked"
}
],
"verifiedDigitalFootprints": [
{
"url": "https://example.com/digital-footprint",
"description": "Digital footprint description",
"userName": "John Doe",
"platform": "CNN",
"isWebSearch": false,
"image": "https://example.com/digital-footprint.jpg",
"status": "checked"
}
],
"unverifiedDigitalFootprints": [
{
"url": "https://example.com/digital-footprint",
"description": "Digital footprint description",
"userName": "John Doe",
"platform": "CNN",
"isWebSearch": false,
"image": "https://example.com/digital-footprint.jpg",
"status": "checked"
}
],
"summary": {
"sentimentAnalysis": {},
"contentRadar": "high",
"digitalPersonSnapshot": {},
"onlineBehavior": [
{
"behavior": "The person is very active on social media"
}
],
"redFlags": [
{
"flag": "The person is very active on social media"
}
],
"strengthsAndWeaknesses": [
{
"strengths": [
{
"description": "The person is very active on social media"
}
],
"weaknesses": [
{
"description": "The person is very active on social media"
}
]
}
],
"personalityInsights": [
{
"trait": "Openness"
}
]
}
},
"usage": {
"aiCredits": {
"aiReportCredits": 0,
"aiAnalystReportCredits": 0,
"adverseMediaReportCredits": 0,
"assistedReportCredits": 0,
"facialMatchingCredits": 0
},
"analystCredits": {
"aiReportCredits": 0,
"aiAnalystReportCredits": 0,
"adverseMediaReportCredits": 0,
"assistedReportCredits": 0,
"facialMatchingCredits": 0
},
"adverseMediaCredits": {
"aiReportCredits": 0,
"aiAnalystReportCredits": 0,
"adverseMediaReportCredits": 0,
"assistedReportCredits": 0,
"facialMatchingCredits": 0
},
"assistedCredits": {
"aiReportCredits": 0,
"aiAnalystReportCredits": 0,
"adverseMediaReportCredits": 0,
"assistedReportCredits": 0,
"facialMatchingCredits": 0
},
"facialMatchingCredits": {
"aiReportCredits": 0,
"aiAnalystReportCredits": 0,
"adverseMediaReportCredits": 0,
"assistedReportCredits": 0,
"facialMatchingCredits": 0
}
},
"enterprise": {
"logoUrl": "https://example.com/logo.png",
"enterpriseName": "Tech Corp",
"palette": {
"backgroundColor": "#FFFFFF",
"highlightColor": "#007BFF",
"accentColor": "#6C757D",
"textColor": "#000000",
"textColor60": "rgba(0,0,0,0.6)"
}
},
"pdfConfig": {
"pdfSummary": true,
"pdfFocusedTopics": true,
"pdfLanguage": "en",
"pdfNegativePosts": true,
"pdfNeutralPosts": true,
"pdfPositivePosts": true,
"pdfSentimentAnalysis": true,
"pdfSocialMediaAccounts": true,
"pdfWebSearchPosts": true
}
}
}

Probar tu Integración de Webhook

Podés probar tu integración de webhook sin gastar créditos usando nuestro endpoint de prueba:

  1. Primero, configurá tu URL de webhook en la página de API key de la aplicación web de WeCheck
  2. Usá el endpoint de webhook de prueba para disparar una notificación de prueba
  3. WeCheck enviará un payload de prueba a tu URL de webhook configurada
  4. No se consumirán créditos durante este proceso de prueba

Buenas Prácticas

  • Asegurate de que tu endpoint de webhook responda con un código de estado 2xx para confirmar la recepción
  • Implementá una validación de seguridad adecuada para las peticiones de webhook entrantes
  • Considerá implementar lógica de reintentos por si tu endpoint está temporalmente no disponible
  • Procesá las notificaciones de webhook de forma asíncrona para evitar problemas de timeout

¿Necesitás Ayuda?

Si tenés alguna pregunta sobre la implementación de webhooks o necesitás asistencia técnica, no dudes en contactar a nuestro equipo de soporte. Estamos acá para ayudarte a integrar WeCheck en tu flujo de trabajo con éxito.