/v1/messages
Use the messages
node to send other message types, such as contacts or location messages, to your customers.
These messages can only be sent in response to an incoming message from your customer within the customer-care window. There is currently no support to send this within a message template.
You will need:
POST /v1/messages { "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": "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.facebook.com", "type": "WORK" } ] } ] }
Name | Required | Description |
---|---|---|
| No | Full contact address(es) |
| No |
|
| No | Contact email address(es) |
| Yes | Full contact name |
| No | Contact organization information |
| No | Contact phone number(s) |
| No | Contact URL(s) |
addresses
objectName | Required | Description |
---|---|---|
| No | Street number and name |
| No | City name |
| No | State abbreviation |
| No | ZIP code |
| No | Full country name |
| No | Two-letter country abbreviation |
| No | Standard Values: |
emails
objectName | Required | Description |
---|---|---|
| No | Email address |
| No | Standard Values: |
name
objectName | Required | Description |
---|---|---|
| Yes | Full name, as it normally appears |
| Optional* | First name |
| Optional* | Last name |
| Optional* | Middle name |
| Optional* | Name suffix |
| Optional* | Name preffix |
* Note: At least one of the optional parameters needs to be included along with the formatted_name
parameter.
org
objectName | Required | Description |
---|---|---|
| No | Name of the contact's company |
| No | Name of the contact's department |
| No | Contact's business title |
phone
objectName | Required | Description |
---|---|---|
| No | Automatically populated with the |
| No | Standard Values: |
| No | WhatsApp ID |
urls
objectName | Required | Description |
---|---|---|
| No | URL |
| No | Standard Values: |
For the objects that 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" }] }
POST /v1/messages { "to": "recipient-wa-id", "type": "location", "location": { "longitude": -122.425332, "latitude": 37.758056, "name": "Facebook HQ", "address": "1 Hacker Way, Menlo Park, CA 94025" } }
Name | Required | Description |
---|---|---|
| Yes | Longitude of the location |
| Yes | Latitude of the location |
| No | Name of the location |
| No | Address of the location |
{ "messages": [{ "id": "message-id" }] }