# Mensajes (MO)

Cuando el cliente le envíe un mensaje, Sinch Messaging API enviará una notificación de solicitud HTTP POST a la URL de Webhook con los detalles.

Es importante que su Webhook retorne una respuesta HTTPS 200 OK para las notificaciones (en un lapso de hasta 200 ms o de manera asíncrona). Caso contrario, la API de Sinch Messaging considerará esa notificación como una falla e intentará nuevamente.

{% hint style="danger" %}
**Importante: Indicar el webhook donde recibirá los mensajes, para que nuestro equipo de soporte pueda asociarlo a su cuenta de Whatsapp**
{% endhint %}

El formato de la respuesta será de acuerdo a la siguiente descripción:

| Campo | Detalles                                              | Tipo   |
| ----- | ----------------------------------------------------- | ------ |
| total | Número de callbacks en la llamada.                    | String |
| data  | Lista de mensajes originados en dispositivos móviles. | Data   |

> Ejemplo de mensaje de texto:

{% tabs %}
{% tab title="cURL" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "TEXT",
"messageText": "Olá, essa é uma mensagem do usuário."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Ruby" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "TEXT",
"messageText": "Olá, essa é uma mensagem do usuário."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Python" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "TEXT",
"messageText": "Olá, essa é uma mensagem do usuário."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="PHP" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "TEXT",
"messageText": "Olá, essa é uma mensagem do usuário."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Java" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "TEXT",
"messageText": "Olá, essa é uma mensagem do usuário."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

| Campo         | Detalles                                                                                                                                                                                        | Tipo        |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| id            | Última identificación del mensaje                                                                                                                                                               | String      |
| source        | Teléfono del remitente                                                                                                                                                                          | String      |
| origin        | Teléfono que identifica la cuenta de WhatsApp (incluido el código de país). Ejemplo: 5411900000000.                                                                                             | String      |
| userProfile   | Perfil del usuario que envió el mensaje                                                                                                                                                         | UserProfile |
| correlationId | Un ID único configurado por usted para coincidir con el estado del mensaje (Callback y DLR). Este parámetro es opcional y puede usar el ID generado por Sinch Messaging para esta coincidencia. | String      |
| campaignId    | ID de campaña previamente definido.                                                                                                                                                             | String      |
| campaignAlias | Alias de Campaña previamente definido.                                                                                                                                                          | String      |
| message       | Mensaje MO.                                                                                                                                                                                     | Message     |
| receivedAt    | Fecha en que se recibió el mensaje. Formato: yyyy-MM-dd’T'HH:mm:ssZ                                                                                                                             | String      |
| receivedDate  | Fecha en que se recibió el mensaje, utilizando el formato Unix\_time                                                                                                                            | String      |
| extraInfo     | Información extra relacionada con el mensaje. Formato: **Json**                                                                                                                                 | String      |
| referral      | Presente si el usuario inició el mensaje al hacer clic en una publicación o anuncio. Este campo es opcional (puede ser nulo).                                                                   | Referral    |
| mtSentAt      | La marca de tiempo de la fecha/hora en que se envió el último MT a este destinatario.                                                                                                           | Long        |
| session       | Información de la sesión.                                                                                                                                                                       | Session     |

> Ejemplo de mensaje con respuesta de botón:

{% tabs %}
{% tab title="cURL" %}

```
{
    "total":1,
    "data":[
      {
        "id":"ce425ffe-bc62-421f-9261-e6819a5eab43",
        "source":"5511900000000",
        "origin":"5511900000000",
        "userProfile":{
          "name":"username",
          "whatsAppId":"5511900000000"
          },
        "correlationId":"...",
        "messageId":"aae959ca-5944-405a-809a-75ff142bc234",
        "message":{
            "type":"BUTTON",
            "messageText":"Sim",
            "payload":"sim"
            },
        "receivedAt":1513616971473,
        "receivedDate":"2020-07-22T14:24:41Z",
        "session":{
            "id":"06deff90-cc27-11ea-b94f-0050569e62ca",
            "createdAt":1513616971473
              }
          }
      ],
        "clientInfo":{
            "customerId":10,
            "subAccountId":0,
            "userId":101010
            }
  }
```

{% endtab %}

{% tab title="Ruby" %}

```
{
    "total":1,
    "data":[
      {
        "id":"ce425ffe-bc62-421f-9261-e6819a5eab43",
        "source":"5511900000000",
        "origin":"5511900000000",
        "userProfile":{
          "name":"username",
          "whatsAppId":"5511900000000"
          },
        "correlationId":"...",
        "messageId":"aae959ca-5944-405a-809a-75ff142bc234",
        "message":{
            "type":"BUTTON",
            "messageText":"Sim",
            "payload":"sim"
            },
        "receivedAt":1513616971473,
        "receivedDate":"2020-07-22T14:24:41Z",
        "session":{
            "id":"06deff90-cc27-11ea-b94f-0050569e62ca",
            "createdAt":1513616971473
              }
          }
      ],
        "clientInfo":{
            "customerId":10,
            "subAccountId":0,
            "userId":101010
            }
  }
```

{% endtab %}

{% tab title="Python" %}

```
{
    "total":1,
    "data":[
      {
        "id":"ce425ffe-bc62-421f-9261-e6819a5eab43",
        "source":"5511900000000",
        "origin":"5511900000000",
        "userProfile":{
          "name":"username",
          "whatsAppId":"5511900000000"
          },
        "correlationId":"...",
        "messageId":"aae959ca-5944-405a-809a-75ff142bc234",
        "message":{
            "type":"BUTTON",
            "messageText":"Sim",
            "payload":"sim"
            },
        "receivedAt":1513616971473,
        "receivedDate":"2020-07-22T14:24:41Z",
        "session":{
            "id":"06deff90-cc27-11ea-b94f-0050569e62ca",
            "createdAt":1513616971473
              }
          }
      ],
        "clientInfo":{
            "customerId":10,
            "subAccountId":0,
            "userId":101010
            }
  }
```

{% endtab %}

{% tab title="PHP" %}

```
{
    "total":1,
    "data":[
      {
        "id":"ce425ffe-bc62-421f-9261-e6819a5eab43",
        "source":"5511900000000",
        "origin":"5511900000000",
        "userProfile":{
          "name":"username",
          "whatsAppId":"5511900000000"
          },
        "correlationId":"...",
        "messageId":"aae959ca-5944-405a-809a-75ff142bc234",
        "message":{
            "type":"BUTTON",
            "messageText":"Sim",
            "payload":"sim"
            },
        "receivedAt":1513616971473,
        "receivedDate":"2020-07-22T14:24:41Z",
        "session":{
            "id":"06deff90-cc27-11ea-b94f-0050569e62ca",
            "createdAt":1513616971473
              }
          }
      ],
        "clientInfo":{
            "customerId":10,
            "subAccountId":0,
            "userId":101010
            }
  }
```

{% endtab %}

{% tab title="Java" %}

```
{
    "total":1,
    "data":[
      {
        "id":"ce425ffe-bc62-421f-9261-e6819a5eab43",
        "source":"5511900000000",
        "origin":"5511900000000",
        "userProfile":{
          "name":"username",
          "whatsAppId":"5511900000000"
          },
        "correlationId":"...",
        "messageId":"aae959ca-5944-405a-809a-75ff142bc234",
        "message":{
            "type":"BUTTON",
            "messageText":"Sim",
            "payload":"sim"
            },
        "receivedAt":1513616971473,
        "receivedDate":"2020-07-22T14:24:41Z",
        "session":{
            "id":"06deff90-cc27-11ea-b94f-0050569e62ca",
            "createdAt":1513616971473
              }
          }
      ],
        "clientInfo":{
            "customerId":10,
            "subAccountId":0,
            "userId":101010
            }
  }
```

{% endtab %}
{% endtabs %}

#### Referral <a href="#referral" id="referral"></a>

**Todos los campos de este objeto son opcionales (pueden ser nulos).**

| Campo      | Detalhes                                                           | Tipo   |
| ---------- | ------------------------------------------------------------------ | ------ |
| headLine   | Titular del anuncio que generó el mensaje.                         | String |
| body       | Cuerpo del anuncio.                                                | String |
| sourceType | Tipo de anuncio. Puede ser “ad”, “post” o “unknown”.               | String |
| sourceId   | Identificación de anuncio o publicación en Facebook.               | String |
| sourceUrl  | URL del anuncio o publicación.                                     | String |
| mediaType  | Tipo de medio presente en el anuncio. Puede ser “image” o “video”. | String |
| mediaUrl   | Url del medio presente en el anuncio.                              | String |

> Ejemplo de mensaje de texto de referral:

{% tabs %}
{% tab title="cURL" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "name of the user"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "referral": {
        "headLine": "...",
        "body": "...",
        "sourceType": "...",
        "sourceId": "...",
        "sourceUrl": "...",
        "mediaType": "...",
        "mediaUrl": "..."
      },
      "mtSentAt": 1513616971473,
      "message": {
        "type": "TEXT",
        "messageText": "Hi, this is a message from the user"
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Ruby" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "name of the user"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "referral": {
        "headLine": "...",
        "body": "...",
        "sourceType": "...",
        "sourceId": "...",
        "sourceUrl": "...",
        "mediaType": "...",
        "mediaUrl": "..."
      },
      "mtSentAt": 1513616971473,
      "message": {
        "type": "TEXT",
        "messageText": "Hi, this is a message from the user"
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Python" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "name of the user"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "referral": {
        "headLine": "...",
        "body": "...",
        "sourceType": "...",
        "sourceId": "...",
        "sourceUrl": "...",
        "mediaType": "...",
        "mediaUrl": "..."
      },
      "mtSentAt": 1513616971473,
      "message": {
        "type": "TEXT",
        "messageText": "Hi, this is a message from the user"
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="PHP" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "name of the user"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "referral": {
        "headLine": "...",
        "body": "...",
        "sourceType": "...",
        "sourceId": "...",
        "sourceUrl": "...",
        "mediaType": "...",
        "mediaUrl": "..."
      },
      "mtSentAt": 1513616971473,
      "message": {
        "type": "TEXT",
        "messageText": "Hi, this is a message from the user"
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Java" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "name of the user"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "referral": {
        "headLine": "...",
        "body": "...",
        "sourceType": "...",
        "sourceId": "...",
        "sourceUrl": "...",
        "mediaType": "...",
        "mediaUrl": "..."
      },
      "mtSentAt": 1513616971473,
      "message": {
        "type": "TEXT",
        "messageText": "Hi, this is a message from the user"
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### Session <a href="#session" id="session"></a>

| Field     | Details                                   | Type   |
| --------- | ----------------------------------------- | ------ |
| sessionId | ID de sesión para este usuario.           | String |
| createdAt | Marca de tiempo de creación de la sesión. | Long   |

#### Mensaje: <a href="#mensaje" id="mensaje"></a>

| Campo       | Detalles                                                                      | Tipo       |
| ----------- | ----------------------------------------------------------------------------- | ---------- |
| type        | Tipo de mensaje enviado por el usuario final: TEXT - IMAGE - AUDIO - DOCUMENT | String     |
| messageText | El mensaje de texto (MO) enviado por el usuario final.                        | String     |
| mediaUrl    | Url para descargar la multimedia enviada por el usuario final.                | String     |
| mimeType    | Tipo de archivo enviado por el usuario final.                                 | String     |
| caption     | Etiqueta de multimedia enviada por el usuario final.                          | String     |
| location    | Ubicación enviada por el usuario final.                                       | Location   |
| contacts    | Contactos enviados por el usuario final.                                      | Contact\[] |

> Ejemplo de mensaje multimedia

{% tabs %}
{% tab title="cURL" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "IMAGE",
           "mediaUrl": "https://...",
           "mimeType": "image/jpg",
           "caption": "..."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Ruby" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "IMAGE",
           "mediaUrl": "https://...",
           "mimeType": "image/jpg",
           "caption": "..."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Python" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "IMAGE",
           "mediaUrl": "https://...",
           "mimeType": "image/jpg",
           "caption": "..."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="PHP" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "IMAGE",
           "mediaUrl": "https://...",
           "mimeType": "image/jpg",
           "caption": "..."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Java" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
            "type": "IMAGE",
           "mediaUrl": "https://...",
           "mimeType": "image/jpg",
           "caption": "..."
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### UserProfile: <a href="#userprofile" id="userprofile"></a>

| Field | Necesario | Detalles                         | Tipo   |
| ----- | --------- | -------------------------------- | ------ |
| name  | No        | El nombre del perfil del usuario | String |

#### Location: <a href="#location" id="location"></a>

| Field    | Details                                                             | Type   |
| -------- | ------------------------------------------------------------------- | ------ |
| name     | Nombre del sitio.                                                   | String |
| address  | Dirección del sitio.                                                | String |
| geoPoint | Geopoint enviada por el usuario final. Formato: “latitud, longitud” | String |

> Ejemplo de mensaje de ubicación:

{% tabs %}
{% tab title="cURL" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "location": {
               "geoPoint": "-22.894180,-47.047960",
               "name": "Sinch",
               "address": "Av. Cel. Silva Telles"
           }
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Ruby" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "location": {
               "geoPoint": "-22.894180,-47.047960",
               "name": "Wavy",
               "address": "Av. Cel. Silva Telles"
           }
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Python" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "location": {
               "geoPoint": "-22.894180,-47.047960",
               "name": "Wavy",
               "address": "Av. Cel. Silva Telles"
           }
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="PHP" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "location": {
               "geoPoint": "-22.894180,-47.047960",
               "name": "Wavy",
               "address": "Av. Cel. Silva Telles"
           }
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Java" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "location": {
               "geoPoint": "-22.894180,-47.047960",
               "name": "Wavy",
               "address": "Av. Cel. Silva Telles"
           }
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### Contact: <a href="#contact" id="contact"></a>

| Campo     | Necesario | Detalles                                                | Tipo       |
| --------- | --------- | ------------------------------------------------------- | ---------- |
| addresses | No        | Direcciones de contacto completas.                      | Address\[] |
| birthday  | No        | Fecha de cumpleaños como cadena con formato YYYY-MM-DD. | String     |
| emails    | No        | Direcciones de correo electrónico de contacto.          | Email\[]   |
| name      | No        | Nombre completo de contacto.                            | Name       |
| org       | No        | Información de la organización de contacto.             | Org        |
| phones    | No        | Teléfonos de contacto.                                  | Phone\[]   |
| urls      | No        | URLs de los contactos.                                  | Url\[]     |

> Ejemplo de mensaje de contacto:

{% tabs %}
{% tab title="cURL" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",      
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "contacts":[  
                 {  
                    "addresses":[  
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"1 Hacker Way",
                          "type":"HOME",
                          "zip":"94025"
                       },
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"200 Jefferson Dr",
                          "type":"WORK",
                          "zip":"94025"
                       }
                    ],
                    "birthday":"2012-08-18",
                    "emails":[  
                       {  
                          "email":"test@fb.com",
                          "type":"WORK"
                       },
                       {  
                          "email":"test@whatsapp.com",
                          "type":"WORK"
                       }
                    ],
                    "name":{  
                       "first_name":"John",
                       "formatted_name":"John Smith",
                       "last_name":"Smith"
                    },
                    "org":{  
                       "company":"WhatsApp",
                       "department":"Design",
                       "title":"Manager"
                    },
                    "phones":[  
                       {  
                          "phone":"+1 (940) 555-1234",
                          "type":"HOME"
                       },
                       {  
                          "phone":"+1 (650) 555-1234",
                          "type":"WORK",
                          "wa_id":"16505551234"
                       }
                    ],
                    "urls":[  
                       {  
                          "url":"https://www.fb.com",
                          "type":"WORK"
                       }
                    ]
                 }
              ]
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Ruby" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",      
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "contacts":[  
                 {  
                    "addresses":[  
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"1 Hacker Way",
                          "type":"HOME",
                          "zip":"94025"
                       },
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"200 Jefferson Dr",
                          "type":"WORK",
                          "zip":"94025"
                       }
                    ],
                    "birthday":"2012-08-18",
                    "emails":[  
                       {  
                          "email":"test@fb.com",
                          "type":"WORK"
                       },
                       {  
                          "email":"test@whatsapp.com",
                          "type":"WORK"
                       }
                    ],
                    "name":{  
                       "first_name":"John",
                       "formatted_name":"John Smith",
                       "last_name":"Smith"
                    },
                    "org":{  
                       "company":"WhatsApp",
                       "department":"Design",
                       "title":"Manager"
                    },
                    "phones":[  
                       {  
                          "phone":"+1 (940) 555-1234",
                          "type":"HOME"
                       },
                       {  
                          "phone":"+1 (650) 555-1234",
                          "type":"WORK",
                          "wa_id":"16505551234"
                       }
                    ],
                    "urls":[  
                       {  
                          "url":"https://www.fb.com",
                          "type":"WORK"
                       }
                    ]
                 }
              ]
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Python" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",      
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "contacts":[  
                 {  
                    "addresses":[  
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"1 Hacker Way",
                          "type":"HOME",
                          "zip":"94025"
                       },
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"200 Jefferson Dr",
                          "type":"WORK",
                          "zip":"94025"
                       }
                    ],
                    "birthday":"2012-08-18",
                    "emails":[  
                       {  
                          "email":"test@fb.com",
                          "type":"WORK"
                       },
                       {  
                          "email":"test@whatsapp.com",
                          "type":"WORK"
                       }
                    ],
                    "name":{  
                       "first_name":"John",
                       "formatted_name":"John Smith",
                       "last_name":"Smith"
                    },
                    "org":{  
                       "company":"WhatsApp",
                       "department":"Design",
                       "title":"Manager"
                    },
                    "phones":[  
                       {  
                          "phone":"+1 (940) 555-1234",
                          "type":"HOME"
                       },
                       {  
                          "phone":"+1 (650) 555-1234",
                          "type":"WORK",
                          "wa_id":"16505551234"
                       }
                    ],
                    "urls":[  
                       {  
                          "url":"https://www.fb.com",
                          "type":"WORK"
                       }
                    ]
                 }
              ]
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="PHP" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",      
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "contacts":[  
                 {  
                    "addresses":[  
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"1 Hacker Way",
                          "type":"HOME",
                          "zip":"94025"
                       },
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"200 Jefferson Dr",
                          "type":"WORK",
                          "zip":"94025"
                       }
                    ],
                    "birthday":"2012-08-18",
                    "emails":[  
                       {  
                          "email":"test@fb.com",
                          "type":"WORK"
                       },
                       {  
                          "email":"test@whatsapp.com",
                          "type":"WORK"
                       }
                    ],
                    "name":{  
                       "first_name":"John",
                       "formatted_name":"John Smith",
                       "last_name":"Smith"
                    },
                    "org":{  
                       "company":"WhatsApp",
                       "department":"Design",
                       "title":"Manager"
                    },
                    "phones":[  
                       {  
                          "phone":"+1 (940) 555-1234",
                          "type":"HOME"
                       },
                       {  
                          "phone":"+1 (650) 555-1234",
                          "type":"WORK",
                          "wa_id":"16505551234"
                       }
                    ],
                    "urls":[  
                       {  
                          "url":"https://www.fb.com",
                          "type":"WORK"
                       }
                    ]
                 }
              ]
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}

{% tab title="Java" %}

```
{
  "total": 1,
  "data": [
    {
      "id": "ce425ffe-bc62-421f-9261-e6819a5eab43",
      "source": "5519900000000",
      "origin": "5519900000000",      
      "userProfile": {
        "name": "nome do usuário"
      },
      "campaignId": 100,
      "correlationId": "...",
      "campaignAlias": "...",
      "flowId": "....",
      "extraInfo": "...",
      "message": {
           "contacts":[  
                 {  
                    "addresses":[  
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"1 Hacker Way",
                          "type":"HOME",
                          "zip":"94025"
                       },
                       {  
                          "city":"Menlo Park",
                          "country":"United States",
                          "country_code":"us",
                          "state":"CA",
                          "street":"200 Jefferson Dr",
                          "type":"WORK",
                          "zip":"94025"
                       }
                    ],
                    "birthday":"2012-08-18",
                    "emails":[  
                       {  
                          "email":"test@fb.com",
                          "type":"WORK"
                       },
                       {  
                          "email":"test@whatsapp.com",
                          "type":"WORK"
                       }
                    ],
                    "name":{  
                       "first_name":"John",
                       "formatted_name":"John Smith",
                       "last_name":"Smith"
                    },
                    "org":{  
                       "company":"WhatsApp",
                       "department":"Design",
                       "title":"Manager"
                    },
                    "phones":[  
                       {  
                          "phone":"+1 (940) 555-1234",
                          "type":"HOME"
                       },
                       {  
                          "phone":"+1 (650) 555-1234",
                          "type":"WORK",
                          "wa_id":"16505551234"
                       }
                    ],
                    "urls":[  
                       {  
                          "url":"https://www.fb.com",
                          "type":"WORK"
                       }
                    ]
                 }
              ]
      },
      "receivedAt": 1513616971473,
      "receivedDate": "2017-12-18T17:09:31.473Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### Address: <a href="#address" id="address"></a>

| Campo         | Necesario | Detalles                           | Tipo   |
| ------------- | --------- | ---------------------------------- | ------ |
| street        | No        | Número y nombre de la calle.       | String |
| city          | No        | Nombre de la ciudad.               | String |
| state         | No        | Abreviatura del estado.            | String |
| zip           | No        | Código postal.                     | String |
| country       | No        | Nombre completo del país.          | String |
| country\_code | No        | Abreviatura de país de dos letras. | String |
| type          | No        | Valores estándar: HOME, WORK.      | String |

#### Email: <a href="#email" id="email"></a>

| Campo | Necesario | Detalles                      | Tipo   |
| ----- | --------- | ----------------------------- | ------ |
| email | No        | Correo electrónico.           | String |
| type  | No        | Valores estándar: HOME, WORK. | String |

#### Name: <a href="#name" id="name"></a>

| Campo           | Necesario | Detalles                                  | Tipo   |
| --------------- | --------- | ----------------------------------------- | ------ |
| first\_name     | No        | Primer nombre.                            | String |
| last\_name      | No        | Apellido.                                 | String |
| middle\_name    | No        | Segundo nombre.                           | String |
| name\_suffix    | No        | Sufijo del nombre.                        | String |
| name\_prefix    | No        | Prefijo del nombre.                       | String |
| formatted\_name | No        | Nombre completo como aparece normalmente. | String |

#### Org: <a href="#org" id="org"></a>

| Campo      | Necesario | Detalles                             | Tipo   |
| ---------- | --------- | ------------------------------------ | ------ |
| company    | No        | Nombre de la empresa del contacto.   | String |
| department | No        | Nombre del departamento de contacto. | String |
| title      | No        | Título comercial de contacto.        | String |

#### Phone: <a href="#phone" id="phone"></a>

| Campo  | Necesario | Detalles                                          | Tipo   |
| ------ | --------- | ------------------------------------------------- | ------ |
| phone  | No        | Número de teléfono formateado.                    | String |
| type   | No        | Valores estándar: CELL, MAIN, IPHONE, HOME, WORK. | String |
| wa\_id | No        | Identificador de WhatsApp.                        | String |

#### Url: <a href="#url" id="url"></a>

| Campo | Necesario | Detalles                      | Tipo   |
| ----- | --------- | ----------------------------- | ------ |
| url   | No        | URL del contacto.             | String |
| type  | No        | Valores estándar: HOME, WORK. | String |

**extraInfo (Control de flujo de MO - Listas de segmentación)**

El mensaje tendrá una lista de listas de segmentaciones en el campo Información adicional. Nuestros asociados lo utilizan para redirigir los mensajes a través de ciertos flujos. El nombre de la clave es **segmentation\_lists** y contiene una lista de **SegmentationList**.

| Campo        | Detalles                                  | Tipo    |
| ------------ | ----------------------------------------- | ------- |
| id           | Identificador de la lista de segmentación | Integer |
| customerId   | Identificador de cliente                  | Integer |
| subAccountId | Identificador de subcuenta                | Integer |
| name         | Nombre de la lista de segmentación        | String  |
| active       | Estado de la lista de segmentación        | Boolean |

> Ejemplo de Extra Info (SegmentationList):

{% tabs %}
{% tab title="cURL" %}

```
{  
   "segmentation_list":[  
      {  
         "id":26,
         "customerId":42,
         "subAccountId":0,
         "name":"Sinch WhatsApp Segmentation List",
         "active":true
      },
      {  
         "id":27,
         "customerId":43,
         "subAccountId":0,
         "name":"Sinch WhatsApp Segmentation List 2",
         "active":true
      }
   ]
}
```

{% endtab %}

{% tab title="Ruby" %}

```
{  
   "segmentation_list":[  
      {  
         "id":26,
         "customerId":42,
         "subAccountId":0,
         "name":"Wavy WhatsApp Segmentation List",
         "active":true
      },
      {  
         "id":27,
         "customerId":43,
         "subAccountId":0,
         "name":"Wavy WhatsApp Segmentation List 2",
         "active":true
      }
   ]
}
```

{% endtab %}

{% tab title="Python" %}

```
{  
   "segmentation_list":[  
      {  
         "id":26,
         "customerId":42,
         "subAccountId":0,
         "name":"Wavy WhatsApp Segmentation List",
         "active":true
      },
      {  
         "id":27,
         "customerId":43,
         "subAccountId":0,
         "name":"Wavy WhatsApp Segmentation List 2",
         "active":true
      }
   ]
}
```

{% endtab %}

{% tab title="PHP" %}

```
{  
   "segmentation_list":[  
      {  
         "id":26,
         "customerId":42,
         "subAccountId":0,
         "name":"Wavy WhatsApp Segmentation List",
         "active":true
      },
      {  
         "id":27,
         "customerId":43,
         "subAccountId":0,
         "name":"Wavy WhatsApp Segmentation List 2",
         "active":true
      }
   ]
}
```

{% endtab %}

{% tab title="Java" %}

```
{  
   "segmentation_list":[  
      {  
         "id":26,
         "customerId":42,
         "subAccountId":0,
         "name":"Wavy WhatsApp Segmentation List",
         "active":true
      },
      {  
         "id":27,
         "customerId":43,
         "subAccountId":0,
         "name":"Wavy WhatsApp Segmentation List 2",
         "active":true
      }
   ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
Para los objetos que contienen un campo de tipo, los valores listados se consideran simplemente los valores estándar que se pueden ver, sin embargo, puede establecer el campo en cualquier valor descriptivo que elija.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-es.sinch.com/documentaciontecnicawhatsapp/sinch-messaging-whatsapp-api/mensajes-mo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
