Zaply
HomeWebsite
HomeWebsite
  1. Send Messages
  • Overview
  • Send Messages
    • Send Message via WhatsApp Instance
      POST
    • Send Media Message via WhatsApp Instance
      POST
    • Send Location Message via WhatsApp Instance
      POST
    • Send Contact Message via WhatsApp Instance
      POST
  • Instance Settings
    • Set Settings
      POST
    • Get Settings
      GET
  • Connection
    • Get QR Code for WhatsApp Connection
      GET
  • Manage Instance
    • Create Instance
      POST
    • Get Instance
      GET
    • Delete Instance
      DELETE
  1. Send Messages

Send Contact Message via WhatsApp Instance

POST
https://api.zaply.dev/v1/instance/{{INSTANCE_ID}}/message/send/contact
This API allows sending a contact card through a specific WhatsApp instance. It enables sharing detailed contact information, such as name, phone number, organization, and email, with the recipient.

Request Parameters#

Path Parameters
instance_id (string) - The unique identifier of the WhatsApp instance. Replace caaq85kdxw with your actual instance ID.

Headers#

Authorization (string, required) - Bearer token for authentication. Replace {{ZAPLY_AUTH_TOKEN}} with your API token.
Content-Type (string, required) - Specifies that the request body is in JSON format. Use application/json.

Request Body#

The body should be in JSON format and include the following parameters:
number (string, required) - The phone number of the recipient, including the country code.
Example: "918367875645"
contact (object, required) - Contact details of the person to be shared. This object must include the following properties:
number (string, required) - The phone number of the contact, including the country code.
Example: "16589563245"
lastname (string, required) - The last name of the contact.
Example: "Smith"
firstname (string, required) - The first name of the contact.
Example: "John"
organization (string, optional) - The organization the contact belongs to.
Example: "ABC Inc"
email (string, optional) - The email address of the contact.
Example: "john@abc.com"
Example JSON Request Body:
{
    "number": "918367875645",
    "contact": {
        "number": "16589563245",
        "lastname": "Smith",
        "firstname": "John",
        "organization": "ABC Inc",
        "email": "john@abc.com"
    }
}

Error Codes#

400 Bad Request - Invalid input parameters (e.g., missing required fields).
401 Unauthorized - Invalid or missing Authorization token.
404 Not Found - Instance ID does not exist.
500 Internal Server Error - Server encountered an unexpected condition.

Request

Header Params
Authorization
string 
required
Example:
Bearer {{ZAPLY_AUTH_TOKEN}}
Body Params application/json
number
string 
required
contact
object 
required
number
string 
required
lastname
string 
required
firstname
string 
required
organization
string 
required
email
string 
required
Example
{
    "number": "918147069203",
    "contact": {
        "number": "16589563245",
        "lastname": "Smith",
        "firstname": "John",
        "organization": "ABC Inc",
        "email": "john@abc.com"
    }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://api.zaply.dev/v1/instance/{{instance_id}}/message/send/contact' \
--header 'Authorization: Bearer {{ZAPLY_AUTH_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "number": "918147069203",
    "contact": {
        "number": "16589563245",
        "lastname": "Smith",
        "firstname": "John",
        "organization": "ABC Inc",
        "email": "john@abc.com"
    }
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2024-10-15 07:01:33
Previous
Send Location Message via WhatsApp Instance
Next
Set Settings
Built with