Otro tipo de Mensaje
Mensajes de Contacto
Ejemplo de Envio
El formato de request es JSON
POST /toolbox/api/whatsapp/v1/{API_KEY}/message
Authorization: Bearer {AUTH_TOKEN}
Content-Type: application/json
{
"to": "recipient-wa-id",
"type": "contacts",
"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": "[email protected]",
"type": "WORK"
},
{
"email": "[email protected]",
"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.facebook.com",
"type": "WORK"
}
]
}
]
}
| Nombre | Requerido | Descripción |
|---|---|---|
| addresses | No | Full contact address(es) |
| birthday | No | YYYY-MM-DD formatted string |
| emails | No | Contact email address(es) |
| name | No | Full contact name |
| org | No | Contact organization information |
| phones | No | Contact phone number(s) |
| urls | No | Contact URL(s) |
The addresses object
| Nombre | Requerido | Descripción |
|---|---|---|
| street | No | Street number and name |
| city | No | City name |
| state | No | State abbreviation |
| zip | No | ZIP code |
| country | No | Full country name |
| country_code | No | Two-letter country abbreviation |
| type | No | Standard Values: HOME, WORK |
The emails object
| Nombre | Requerido | Descripción |
|---|---|---|
| No | Email address | |
| type | No | Standard Values: HOME, WORK |
The name object
| Nombre | Requerido | Descripción |
|---|---|---|
| formatted_name | No | Full name as it normally appears |
| first_name | Optional | First name |
| last_name | Optional | Last name |
| middle_name | Optional | Middle name |
| suffix | Optional | Name suffix |
| prefix | Optional | Name preffix |
The org object
| Nombre | Requerido | Descripción |
|---|---|---|
| company | No | Name of the contact’s company |
| department | No | Name of the contact’s department |
| title | Optional | Contact’s business title |
| #The phone object |
The phone object
| Nombre | Requerido | Descripción |
|---|---|---|
| phone | No | Automatically populated with the wa_id value as a formatted phone number. |
| type | No | Standard Values: CELL, MAIN, IPHONE, HOME, WORK |
| wa_id | No | WhatsApp ID |
The urls object
| Nombre | Requerido | Descripción |
|---|---|---|
| url | No | URL |
| type | No | Standard Values: HOME, WORK |
TIP
For the objects which contain a type field, the values listed are simply considered the standard values that might be seen, however, you may set the field to any descriptive value you choose.
{
"messages": [
{
"id": "message-id"
}
]
}
Mensaje Contacto
Ejemplo de Envio
El formato de request es JSON
POST /toolbox/api/whatsapp/v1/{API_KEY}/message
Authorization: Bearer {AUTH_TOKEN}
Content-Type: application/json
{
"to": "recipient-wa-id",
"type": "location",
"location":{
"longitude": -122.425332,
"latitude": 37.758056,
"Facebook HQ",
"address": "1 Hacker Way, Menlo Park, CA 94025"
}
}
Parametros
| Nombre | Requerido | Descripción |
|---|---|---|
| longitude | Yes | Longitude of the location |
| latitude | Yes | Latitude of the location |
| name | No | Name of the location |
| address | No | Address of the location. Only displayed if name is present. |
{
"messages": [
{
"id": "message-id"
}
]
}