logo
enes

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) and type (details)
  • type values 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:

NameDescriptionTypeRequirements
contactsList with the details of one or more contacts.Array of contacts objectsRequired.

Contacts object

NameDescriptionTypeRequirements
birthdayContact's date of birth.StringOptional.
addressesList of the contact's addresses.Array of addresses objectsOptional.
emailsList of the contact's email addresses.Array of emails objectsOptional.
nameObject with the contact's name.ObjectRequired.
orgObject with the contact's company.ObjectOptional.
phonesList of the contact's phone numbers.Array of phones objectsOptional.
urlsList of the contact's URLs.Array of urls objectsOptional.

Addresses object

NameDescriptionTypeRequirements
cityCity.StringOptional.
countryCountry.StringOptional.
country_codeISO country code.StringOptional.
stateState.StringOptional.
streetStreet.StringOptional.
typeCommon values: WORK, HOME. Not validated by this service; any string is forwarded as-is.StringOptional.
zipZIP code.StringOptional.

Emails object

NameDescriptionTypeRequirements
emailContact's email address.StringOptional.
typeCommon values: WORK, HOME. Not validated by this service; any string is forwarded as-is.StringOptional.

Name object

NameDescriptionTypeRequirements
first_nameContact's first name.StringRequired if middle_name and last_name have no value.
middle_nameContact's middle name.StringRequired if first_name and last_name have no value.
last_nameContact's last name.StringRequired if middle_name and first_name have no value.
formatted_nameFull name.StringRequired.
prefixName prefix (e.g. Mr., Dr.).StringOptional.
suffixName suffix (e.g. Jr., III).StringOptional.

Org object

NameDescriptionTypeRequirements
companyCompany name.StringOptional.
departmentDepartment within the company.StringOptional.
titleJob title within the company.StringOptional.

Phones object

NameDescriptionTypeRequirements
phoneContact's phone number.StringOptional.
typeCommon values: WORK, HOME. Not validated by this service; any string is forwarded as-is.StringOptional.
wa_idContact's WhatsApp ID.LongOptional.

Urls object

NameDescriptionTypeRequirements
urlContact's URL.StringOptional.
typeCommon values: WORK, HOME. Not validated by this service; any string is forwarded as-is.StringOptional.

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


Previous
Location
Next
Replies and reactions