API Reference v1.0

Contacts

Manage your WhatsApp contacts programmatically. Retrieve your full contact list or create and update individual contacts with phone numbers, names, and other details.

List Contacts

GET /api/wpbox/getContacts

Returns all contacts stored in your WhatsBizAPI account. Each contact includes their phone number, name, and other profile information.

Query Parameters

Parameter Type Description
token Required string Your API authentication token. Found in your dashboard under Settings > API.

Example Request

cURL
curl -G "https://whatsbizapi.com/api/wpbox/getContacts?token=your-api-token"

Example Response

Response — 200 OK
[ { "id": 1, "phone": "919876543210", "name": "Rahul Sharma", "email": "rahul@example.com", "address": "Mumbai, India", "created_at": "2025-01-15T10:30:00Z" }, { "id": 2, "phone": "14155551234", "name": "Jane Smith", "email": null, "address": null, "created_at": "2025-02-20T14:15:00Z" } ]

Create or Update Contact

POST /api/wpbox/makeContact

Creates a new contact or updates an existing one. If a contact with the given phone number already exists, its details will be updated with the provided values.

Parameters

Parameter Type Description
token Required string Your API authentication token.
phone Required string Phone number with country code, without + or spaces. Example: 919876543210 for an Indian number.
name Optional string Full name of the contact.
email Optional string Email address of the contact.
address Optional string Physical address or location of the contact.

Example Request

cURL
curl -X POST "https://whatsbizapi.com/api/wpbox/makeContact" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "token=your-api-token" \ -d "phone=919876543210" \ -d "name=Rahul Sharma" \ -d "email=rahul@example.com" \ -d "address=Mumbai, India"

Example Response

Response — 200 OK
{ "status": "success", "contact_id": 123 }

Upsert behavior: If a contact with the same phone number already exists, the makeContact endpoint will update the existing record rather than creating a duplicate. The response will return the existing contact_id.

Response Fields

Field Type Description
id integer Unique identifier for the contact.
phone string Phone number with country code (e.g., 919876543210).
name string Contact's display name. May be null if not provided.
email string Contact's email address. May be null if not provided.
address string Contact's physical address. May be null if not provided.
created_at string ISO 8601 timestamp of when the contact was created.

Phone number format: Always include the country code and omit the leading +, dashes, or spaces. For example, use 919876543210 instead of +91 98765 43210.