Other Message Types

/v1/messages

Beginning with v2.21.3 you can use the messages endpoint 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 consumer within the customer-care window. There is currently no support to send this within a message template.

This document covers:

Prerequisites

Contacts Messages

Request

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"
                        }
                    ]
                }
            ]
}

Parameters

NameRequiredDescription

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
NameRequiredDescription

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
NameRequiredDescription

email

No

Email address

type

No

Standard Values: HOME, WORK

The name object
NameRequiredDescription

formatted_name

Yes

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

* At least one of the optional parameters needs to be included along with the formatted_name parameter.

The org object
NameRequiredDescription

company

No

Name of the contact's company

department

No

Name of the contact's department

title

No

Contact's business title

The phone object
NameRequiredDescription

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
NameRequiredDescription

url

No

URL

type

No

Standard Values: HOME, WORK

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.

Response

{
    "messages": [{
       "id": "message-id"
    }]
}

Location Messages

Request

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"
    }
}

Parameters

NameRequiredDescription

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.

Response

{
    "messages": [{
       "id": "message-id"
    }]
}