Contacts and Location Messages
Use the message node to send contacts or location messages.
If the WABA is registered in On-premise API
See how to send Contacts and Location Messages in the specific Meta documentation.
Check contacts
Before sending a message to a number, you can check contact availability alongside preloading contact information before sending a message to the number. We recommend the preloading of contact information before sending messages in large volumes, for improved performance. You can find more information about this process in the official WhatsApp documentation.
Starting in v2.39 and above, you do not have to call the contacts node before sending a message sending a message.
Starting in v2.43, there will be changes to the behavior of the contacts endpoint.
Responses for status will change.
Regardless of whether a user has WhatsApp, it will always return valid for status in the response and a wa_id. There is no guarantee that the returned wa_id will be valid. These changes are applicable for both direct responses, as well as webhook responses for non-blocking calls Ensure your code avoids relying on status and wa_id returned in the contacts node.
Check Contacts Endpoint
POST
https://waba.360dialog.io/v1/contacts
Send an API call to /v1/contacts containing an array of registered phone numbers. The phone numbers can be in any standard telephone number format.
Request Body
blocking
string
no_wait
(default), wait
contacts
array
+4912345678910
force_check
boolean
false
(default), true
{
"contacts": [ {
"input": "+55123456789",
"wa_id": "55123456789",
"status": "valid" <- we can send messages to valid contacts only
}]
}
Example Request
{
"blocking": "wait",
"contacts": [
"+55123456789"
],
"force_check": true
}
Example Response
{
"contacts": [
{
"input": "+55123456789",
"status": "valid",
"wa_id": "55123456789"
}
],
"meta": {
"api_status": "stable",
"version": "2.35.4"
}
}
The response will contain a wa_id. You may use this or another valid wa_id when sending messages using the below request(s).
How to block contacts
To block a contact, you must have received a message from them within the last 24 hours.
Submit an API call to /v1/contacts/{phone_number}/block
with a reason for blocking another business account.
POST / v1 / contacts /+ 16315551000 / block
{ "reason" : "Optional string(0;60). Freeform block reason. Will be used when another business account is being blocked" }
When successful, the response will have HTTP status 200
and will come without the "errors" object. The failed response looks like this:
{ "errors" : [ { "code" : 2048 , "title" : "Not engaged contact" , "details" : "Invalid Request. This contact has not engaged with you in the last 24 hrs." } ] }
blocking parameters
blocking parameters
The following parameters are supported by POST calls to /v1/contacts/{phone_number}/block
:
reason
Optional.
Blocking reason in free text format. It will be used during the process of blocking another business account. Must be less than 60 characters.
phone_number
Mandatory.
Numbers can be in any phone number format. The recommended format for contact phone numbers includes a plus sign (+) and country code.
How to unblock contacts
To unblock a contact, send an API call to/v1/contacts/{phone_number}/unblock
POST / v1 / contacts /+ 16315551000 / unblock
When successful, the response will have HTTP status 200
and will come without the "errors" object.
The failed response looks like this:
{ "errors" : [ { "code" : 1009 , "title" : "Parameter value is not valid" , "details" : "Provided WhatsApp ID is not valid. Please provide a valid WhatsApp ID or a phone number with a country code" } ] }
unblock parameters
unblock parameters
The following parameters are supported by POST calls to /v1/contacts/{phone_number}/unblock
:
phone_number
Mandatory.
Numbers can be in any phone number format. The recommended format for contact phone numbers includes a plus sign (+) and country code.
How to get a Block List
Here's how to get a list of your blocked contacts.
Send an API call to /v1/contacts/blocklist
to receive a paginated list of your blocked contacts.
GET / v1 / contacts / blocklist ? limit = 10 & offset = 0
You will receive a response with a page from your block list and paging information.
{ "contacts" : [ { "wa_id" : "[email protected]" } ], "pagination" : { "limit" : 10 , "offset" : 0 , "total" : 1 } }
block list parameters
block list parameters
The following parameters are supported for GET calls to /v1/contacts/blocklist
:
limit
Optional.
Accepted range is (0;200]. Default: 100.
offset
Optional.
Default: 0.
How to Report a Contact
To report a contact, you must have received a message from them within the last 24 hours.
Send an API call to /v1/contacts/{phone_number}/report
including a reason if you are blocking another business account.
POST / v1 / contacts /+ 16315551000 / block
{ "reason" : "Optional string(0;60). Freeform block reason. Will be used when another business account is being blocked" , "block" : "true | false optional boolean with default of false" , "message_id" : "message-id. Optional reported message id" }
When successful, the response will have HTTP status 200
and will come without the "errors" object.
The failed response looks like this:
{ "errors" : [ { "code" : 2048 , "title" : "Not engaged contact" , "details" : "Invalid Request. This contact has not engaged with you in the last 24 hrs." } ] }
reporting parameters
reporting parameters
The following parameters are supported by POST calls to /v1/contacts/{phone_number}/report
:
reason
Optional.
Blocking reason in free text format. It will be used during the process of blocking another business account. Must be less than 60 characters.
block
Optional.
The default is False
.
If you just want to report or also block the contact.
message_id
Optional.
The ID of the message to be reported. If not specified, the last 5 messages will be sent to WhatsApp.
phone_number
Mandatory.
Numbers can be in any phone number format. The recommended format for contact phone numbers includes a plus sign (+) and country code.
If the WABA is registered in Cloud API
See how to send Contacts and Location Messages in the specific Meta documentation.
Last updated
Was this helpful?