Sending Contacts

🔒 WhatsApp 24-Hour Session Rule

Before sending a contact, make sure the WhatsApp session with the user is active.

If the user has not messaged your business within the last 24 hours, WhatsApp requires the first message to be a template message.

After the customer replies, the 24-hour session opens and you may send contacts using this API. For sandbox testing, send your join code to the sandbox number to activate your session. Learn more

WhatsApp offers an API to send contacts.

POST

https://gateway.lipachat.com/api/v1/whatsapp/contact

Headers

Name
Value

Content-Type

application/json

apiKey

Get apiKey from App portal settings tabhttps://app.lipachat.com/app/settings

Body

Name
Type
Description

messageId

string

A unique identifier for the message. This will be used to track the message status and for deduplication purposes.

from

string

Sandbox number +254110090747 or your own WABA phone number.

to

string

Receiver phone number. It should start with a country code.

name.formattedName

String

Contact's formatted name. This will appear in the message alongside the profile arrow button.

phones[0].phone[0].phone

string

User phone number.

phones[0].phone[0].type

string

Type of phone number. For example, cell, mobile, main, iPhone, home, work, etc.

phones[0].phone[0].waId

string

WhatsApp user ID. If omitted, the message will display an Invite to WhatsApp button instead of the standard buttons.

curl --location 'https://gateway.lipachat.com/api/v1/whatsapp/contact' \
--header 'apiKey: API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "messageId": "ca739107-4b0d-4581-acb1-4c4af70555de",
    "to": "2547XXXX",
    "from": "254110090747",
    "name": {
        "formattedName": "Test User"
    },
    "phones": [
        {
            "phone": "254712345678",
            "type": "Cell",
            "waId": "254712345678"
        }
    ]
}'

Response

{
      "timestamp": "2023-08-06T01:27:56.825898971",
      "data": {
            "messageId": "7addc006-07db-4fae-aac5-b285903b41d4",
            "waId": "wamid.HBgMMjU0NzE3NzQ2NTY1FQIAEnRgSRjJGRkMzNkQ0QUVENTIxQ0NBAA==",
            "status": "SENT",
            "statusDesc": "Message sent successfully"
      },
      "status": "success",
      "message": "",
      "errors": null
}

Last updated