Contacts and Location Messages

Use the message node to send contacts or location messages.

Sending Location Messages

circle-info

You can only send a location message up until 24 hours after receiving a message from the user. If you have not received a message from the user within this time, you will need to start a new conversation by sending a Template message.

To send location messages, make a POST call to the /messages endpoint and attach a message object with type=location. Then, add a location object.

POST https://waba-v2.360dialog.io/messages

Request Body

Name
Type
Description

to*

string

Recipient wa_id

type*

string

Message type: location

location*

object

messaging_product*

string

Required only for Cloud API. Messaging service used for the request. Use "whatsapp".

A successful response includes an object with an identifier prefixed with wamid. Use the ID listed after wamid to track your message status.

{
  "messaging_product": "whatsapp",
  "contacts": [{
      "input": "PHONE_NUMBER",
      "wa_id": "WHATSAPP_ID",
    }]
  "messages": [{
      "id": "wamid.ID",
    }]
}

Location Object

Name
Description

longitude

Required.

Longitude of the location.

latitude

Required.

Latitude of the location.

name

Required.

Name of the location.

address

Required.

Address of the location.

Sending Contacts Messages

To send contact messages, make a POST call to the /messages endpoint and attach a message object with type=contacts. Then, add a contacts object.

POST https://waba-v2.360dialog.io/messages

Request Body

Name
Type
Description

to*

string

Recipient wa_id

type*

string

Message type: contacts

messaging_product*

string

Required for Cloud API. Use "whatsapp".

contacts*

object

Contacts Object

Inside contacts, you can nest the following objects: addresses, emails, name, org, phone, and urls. Pluralized objects are to be wrapped in an array as shown in the example below.

Name
Description

addresses

object

Optional.

Full contact address(es) formatted as an addresses object.

The object can contain the following fields:

streetstring – Optional. Street number and name.

citystring – Optional. City name.

statestring – Optional. State abbreviation.

zipstring – Optional. ZIP code.

countrystring – Optional. Full country name.

country_codestring – Optional. Two-letter country abbreviation.

typestring – Optional. Standard values are HOME and WORK.

birthday

Optional.

YYYY-MM-DD formatted string.

emails

object

Optional.

Contact email address(es) formatted as an emails object.

The object can contain the following fields:

emailstring – Optional. Email address.

typestring – Optional. Standard values are HOME and WORK.

name

object

Required.

Full contact name formatted as a name object.

The object can contain the following fields:

formatted_namestring – Required. Full name, as it normally appears.

first_namestring – Optional*. First name.

last_namestring – Optional*. Last name.

middle_namestring – Optional*. Middle name.

suffixstring – Optional*. Name suffix.

prefixstring – Optional*. Name prefix.

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

org

object

Optional.

Contact organization information formatted as an org object.

The object can contain the following fields:

companystring – Optional. Name of the contact's company.

departmentstring – Optional. Name of the contact's department.

titlestring – Optional. Contact's business title.

phones

object

Optional.

Contact phone number(s) formatted as a phone object.

The object can contain the following fields:

phonestring – Optional. Automatically populated with the `wa_id` value as a formatted phone number.

typestring – Optional. Standard Values are CELL, MAIN, IPHONE, HOME, and WORK.

wa_idstring – Optional. WhatsApp ID.

urls

object

Optional.

Contact URL(s) formatted as a urls object.

The object can contain the following fields:

urlstring – Optional. URL.

typestring – Optional. Standard values are HOME and WORK.

Example of a contacts object with pluralized objects nested inside:

Blocking Contacts

The Block Users API enables businesses block bad numbers from contacting the account.

When a WhatsApp user is blocked, the following happens:

  • The user cannot contact the business or see that they are online.

  • The business cannot message the user. If so, an error will occur.

Errors on the API occur per-number, since blocks might be successful on some numbers and not others. The Block Users API is synchronous.

circle-exclamation

Block Users

POST /block_users

Use this endpoint to block WhatsApp user(s) by phone number or WhatsApp ID.

Headers

Name
Value

Content-Type

application/json

D360-API-KEY

Your API key

Body

Name
Type
Description

messaging_product

string

Must be set to "whatsapp"

block_users

object

List of user(s) to block.

Each object contains a user string field (see row below)

user

string

The phone number or WhatsApp ID to be blocked

Request Example

Response

Unblock Users

Use this endpoint to unblock a list of WhatsApp user(s).

DELETE /block_users

Headers

Name
Value

Content-Type

application/json

D360-API-KEY

Your API key

Body

Name
Type
Description

messaging_product

string

Must be set to "whatsapp"

block_users

object

List of user(s) to unblock.

Each element contains a user field (see row below)

user

string

The phone number or WhatsApp ID to be unblocked

Request Example

Response

List Blocked Users

Use this endpoint to get the list of blocked WhatsApp user(s).

GET /block_users

Headers

Name
Value

Content-Type

application/json

D360-API-KEY

Your API key

Request Example

Response

Last updated

Was this helpful?