Contacts
Last update: 6 hours ago by Irais Aguirre
Integration summary
- Endpoint:
POST https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging- Token: messaging token, in the
Authorization: Bearer {{wa-msg-api-token}}header (how to generate it)- Common fields:
from,to(phone number or BSUID) andtype(details)typevalues on this page:"contacts"- Response: the same for every message (see response)
Messages to share one or more contacts. All are sent with POST /v1/messaging; headers, common fields and the response are in HTTP connection.
Contacts
Sends the details of one or more contacts. The type field must be "contacts".
Body
Fields for Contacts, in addition to the common fields:
| Name | Description | Type | Requirements |
|---|---|---|---|
| contacts | List with the details of one or more contacts. | Array of contacts objects | Required. |
Contacts object
| Name | Description | Type | Requirements |
|---|---|---|---|
| birthday | Contact's date of birth. | String | Optional. |
| addresses | List of the contact's addresses. | Array of addresses objects | Optional. |
| emails | List of the contact's email addresses. | Array of emails objects | Optional. |
| name | Object with the contact's name. | Object | Required. |
| org | Object with the contact's company. | Object | Optional. |
| phones | List of the contact's phone numbers. | Array of phones objects | Optional. |
| urls | List of the contact's URLs. | Array of urls objects | Optional. |
Addresses object
| Name | Description | Type | Requirements |
|---|---|---|---|
| city | City. | String | Optional. |
| country | Country. | String | Optional. |
| country_code | ISO country code. | String | Optional. |
| state | State. | String | Optional. |
| street | Street. | String | Optional. |
| type | Common values: WORK, HOME. Not validated by this service; any string is forwarded as-is. | String | Optional. |
| zip | ZIP code. | String | Optional. |
Emails object
| Name | Description | Type | Requirements |
|---|---|---|---|
| Contact's email address. | String | Optional. | |
| type | Common values: WORK, HOME. Not validated by this service; any string is forwarded as-is. | String | Optional. |
Name object
| Name | Description | Type | Requirements |
|---|---|---|---|
| first_name | Contact's first name. | String | Required if middle_name and last_name have no value. |
| middle_name | Contact's middle name. | String | Required if first_name and last_name have no value. |
| last_name | Contact's last name. | String | Required if middle_name and first_name have no value. |
| formatted_name | Full name. | String | Required. |
| prefix | Name prefix (e.g. Mr., Dr.). | String | Optional. |
| suffix | Name suffix (e.g. Jr., III). | String | Optional. |
Org object
| Name | Description | Type | Requirements |
|---|---|---|---|
| company | Company name. | String | Optional. |
| department | Department within the company. | String | Optional. |
| title | Job title within the company. | String | Optional. |
Phones object
| Name | Description | Type | Requirements |
|---|---|---|---|
| phone | Contact's phone number. | String | Optional. |
| type | Common values: WORK, HOME. Not validated by this service; any string is forwarded as-is. | String | Optional. |
| wa_id | Contact's WhatsApp ID. | Long | Optional. |
Urls object
| Name | Description | Type | Requirements |
|---|---|---|---|
| url | Contact's URL. | String | Optional. |
| type | Common values: WORK, HOME. Not validated by this service; any string is forwarded as-is. | String | Optional. |
Example
Complete Contacts example (HTTP request and JSON body):
HTTP request
curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \-H 'Authorization: Bearer {{wa-msg-api-token}}' \-H 'Content-Type: application/json' \-d '{"from": "5215500000001","to": "5215500000002","type": "contacts","contacts":[{"addresses": [{"city": "Mexico City","country": "Mexico","country_code": "mx","state": "MX","street": "Paseo de la Reforma","type": "HOME","zip": "00000"}],"birthday": "1970-01-01","emails": [{"email": "test@test.com","type": "WORK"}],"name": {"first_name": "John","formatted_name": "John Williams","last_name": "Williams"},"org": {"company": "Facebook"},"phones": [{"phone": "525536493568","type": "HOME"}],"urls": [{"url":"https://facebook.com","type":"WORK"}]}]}'
Body
{"from": "5215500000001","to": "5215500000002","type": "contacts","contacts": [{"addresses": [{"city": "Mexico City","country": "Mexico","country_code": "mx","state": "MX","street": "Paseo de la Reforma","type": "HOME","zip": "00000"}],"birthday": "1970-01-01","emails": [{"email": "test@test.com","type": "WORK"}],"name": {"first_name": "John","last_name": "Williams","formatted_name": "John Williams"},"org": {"company": "Facebook"},"phones": [{"phone": "525536493568","type": "HOME"}],"urls": [{"url": "https://facebook.com","type": "WORK"}]}]}
