logo

Ejemplos

Last update: 2 days ago by Irais Aguirre

Notificaciones de Mensajes

Texto

Body texto
{
"contacts": [
{
"profile": {
"name": "Héctor"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "text",
"text": {
"body": "Hola amigo"
},
}
]
}

Audio

Body audio
{
"contacts": [
{
"profile": {
"name": "Héctor"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "audio",
"audio": {
"id": "6b6f751e-5757-4652-bf51-fb4ce7445533",
"mime_type": "audio/mpeg",
"sha256": "693cddca479f19817d300d743849e1a69f045b97f65c08339c2f9d9e0c16cb6f"
},
}
]
}

Document

Body document
{
"contacts": [
{
"profile": {
"name": "Héctor"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "document",
"document": {
"caption": "smppdoc.pdf",
"filename": "smppdoc.pdf",
"id": "a26072ab-a20e-4c2b-9595-929a92fb3f9e",
"mime_type": "application/pdf",
"sha256":
"c29f4d7461ddca08fd58db1f716610a2b3f36f9c0f2620bf4f5ea9b698f0912b"
},
}
]
}

Imagen

Body imagen
{
"contacts": [
{
"profile": {
"name": "Héctor"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "image",
"image": {
"id": "647b9f5d-89fb-43fc-9708-49b067d49766",
"mime_type": "image/jpeg",
"sha256": "1b78676c0af68ec66b71b7b09803e68d698db7891c7b0820b24a35c82535b06c"
},
}
]
}

Ubicación

Body ubicación
{
"contacts": [
{
"profile": {
"name": "Héctor"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "location",
"location": {
"latitude": 19.5386,
"longitude": -99.15124
},
}
]
}

Video

Body video
{
"contacts": [
{
"profile": {
"name": "Héctor"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "video",
"video": {
"id": "a2936494-0747-462a-9381-5e5d6672ce33",
"mime_type": "video/mp4",
"sha256":
"ca5c888f78787f62efe3b382a8b243556dbb982f0e2c585adfd8d0b4808d5d99"
}
}
]
}

Mensaje de voz

Body mensaje de voz
{
"contacts": [
{
"profile": {
"name": "Juan Pérez"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "voice",
"voice": {
"id": "e091fa61-d8dc-41c4-967b-e6a163ba21c2",
"mime_type": "audio/ogg; codecs=opus",
"sha256":
"acd78d57200637690bcca16239dd452fc4e5bb8b817c85b58452abfe28ab8f2e"
}
}
]
}

Sticker

Body sticker
{
"contacts": [
{
"profile": {
"name": "Juan Pérez"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "wamid.HBgNNTIxNTUyMDc3NzA1OBUCABIYFDNBMDRDRTJDODlFQ0Q5Mzc5RkUzAA==",
"timestamp": "1617061836",
"type": "sticker",
"sticker": {
"id": "647b9f5d-89fb-43fc-9708-49b067d49766",
"mime_type": "image/webp",
"sha256": "mCZ/7a6sZ6TMa14YokRCSfultjY6aQEVE5Z11TpjsP8=",
"animated": false
},
}
]
}

Respuesta rápida para mensajes interactivos

Body mensajes interactivos
{
"contacts": [
{
"profile": {
"name": "Héctor"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"context":
{
"from": "5215541697885",
"id": "NTI1NTIwNzc3MDU41qeKUOpTHmS"
},
"from": "5215500000001",
"id": "wamid.HBgNNTIxNTUyMDc3NzA1OBUCABIYFDNBMDFEMDFEOTFFMkE0NEU4MThBAA==",
"timestamp": "1617061836",
"type": "interactive",
"interactive": {
"type": "button_reply",
"button_reply": {
"id": "3",
"title": "Sopa de pasta"
}
}
}
]
}

Respuesta rápida (tipo botón)

Body tipo botón
{
"contacts": [
{
"profile": {
"name": "Héctor"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "button",
"button": {
"payload": "payload for buena",
"text": "Buena"
},
"context": {
"from": "5215500000001",
"id": "gBGHUhciNWGSfwIJFtyApXYmcGjx"
},
}
]
}

Contacto compartido

Body contacto
{
"contacts": [
{
"profile": {
"name": "Juan Pérez"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "contacts",
"contacts": [
{
"addresses": [],
"contact_image": "/9j/4AAQSkZJRgABAQEAZABkAAD",
"emails": [
{
"email": "test@mail.com",
"type": "Otro"
}
],
"ims": [],
"name": {
"first_name": "Juan",
"formatted_name": "Juan Pérez",
"last_name": "Pérez"
},
"org": {},
"phones": [
{
"phone": "+1 (000) 111-1111",
"type": "Móvil"
},
{
}
],
"urls": [
{
"type": "PROFILE",
"url": "http://www.google.com/profiles/1012231243417990451811"
}
]
}
]
}

Carro de compras

Body carro de compras
{
"contacts": [
{
"profile": {
"name": "Juan Pérez"
},
"wa_id": "5215500000001"
}
],
"messages": [
{
"from": "5215500000001",
"id": "ABGHUhVUByKUHwIKPrA13J63aX1gRA",
"timestamp": "1617061836",
"type": "order",
"order":{
"catalog_id": "1374748992926971",
"product_items":
[
{
"currency": "MXN",
"item_price": 800,
"product_retailer_id": "ING_0001",
"quantity": 1
}
],
"text": "Quiero este"
},
}
]
}

WhatsApp Flows

Body WhatsApp Flows
{
"contacts":
[
{
"profile":
{
"name": "Héctor"
},
"wa_id": "5215520777058"
}
],
"messages":
[
{
"context":
{
"from": "5215541697885",
"id": "wamid.HBgNNTIxNTUyMDc3NzA1OBUCABEYEjE2RUEwM0M5OTg3NkNCNUZCNQA="
},
"from": "5215520777058",
"id": "wamid.HBgNNTIxNTUyMDc3NzA1OBUCABIYFDNBMEREMUE4QjIxMEM3MDE3RjQ4AA==",
"timestamp": "1711568359",
"type": "interactive",
"interactive":
{
"type": "nfm_reply",
"nfm_reply":
{
"response_json": "{\"first_name\":\"Hector\",\"last_name\":\"Hernandez\",\"flow_token\":\"FLOW_TOKEN\",\"products\":[\"mobile\",\"data\"],\"email\":\"Hector.hernandez@conceptomovil.com\"}",
"body": "Sent",
"name": "flow"
}
}
}
]
}

Notificaciones de Estatus

Body notificación exitosa

{
"statuses": [
{
"id": "NTI1NTIwNzc3MDU41qbPgNJ6hLs",
"status": "delivered",
"timestamp": "1693419173",
"recipient_id": "5215520777058",
"conversation":
{
"id": "05b0852529d1652f2ccf3cde096f2150",
"origin":
{
"type": "service"
}
},
"pricing":
{
"billable": true,
"pricing_model": "CBP",
"category": "service"
}
}
]
}

Body notificación con código de error

{
"statuses": [
{
"errors": [
{
"code": 470,
"title": "Failed to send message because you are outside the support window for freeform messages to this user. Please use a valid HSM notification or reconsider."
}
],
"id": "gBGGEgZHMlEfAgkM1RBkhDRr7t8",
"recipient_id": "12064001000",
"status": "failed",
"timestamp": "1533332775"
}
]
}
Whatsapp — Anterior
Objetos
Siguiente — Whatsapp
Respuesta