When managing large CRM databases, identifying which contacts utilize WhatsApp Business accounts is essential for tailoring communication strategies. Manually verifying thousands of numbers is impractical; instead, developers can leverage an asynchronous batch workflow to process large lists efficiently.
This tutorial demonstrates how to integrate the WhatsApp Business Checker API to segment your contact list based on registration status.
Prerequisites
- An active API key from Checknumber.ai.
- A text file containing phone numbers in E.164 format (one per line).
- A development environment capable of handling HTTP POST requests.
Step 1: Submit Your Batch Task
The API uses an asynchronous pattern. You submit a file, receive a task_id, and poll for completion. To begin, send your file to the /v1/tasks endpoint.
curl --location 'https://api.checknumber.ai/v1/tasks' \
--header 'X-API-Key: YOUR_API_KEY' \
--form 'file=@"./input.txt"' \
--form 'task_type="ws_business"'
The response will return a task_id. Store this identifier, as it is required for all subsequent status checks.
Step 2: Poll for Task Completion
Because the processing happens asynchronously, you must poll the /v1/gettasks endpoint using your task_id. Do not assume the task is ready immediately. Monitor the status field in the response.
curl --location 'https://api.checknumber.ai/v1/gettasks' \
--header 'X-API-Key: YOUR_API_KEY' \
--form 'task_id="d4g8o46p2jvh04o9uolg"'
Continue polling until the status transitions to exported. Avoid aggressive polling intervals; implement a reasonable delay between requests. Refer to the official documentation for guidance on applicable usage limits.
Step 3: Retrieve and Process Results
Once the status reaches exported, the response will include a result_url. Download the file from this URL to access your processed data. The result file will contain three primary columns:
-
number: The original phone number. -
whatsapp: Indicates if the number is registered on WhatsApp. -
business: Indicates if the number is registered as a WhatsApp Business account.
Maintain the original column names when importing this data into your downstream CRM or database to ensure data integrity.
Handling Edge Cases
Always account for potential API response codes. For example, a 503 indicates the product is temporarily unavailable (no charges apply), while a 400 suggests an issue with your input file format. Ensure your integration logic gracefully handles these states by logging the error and retrying after an appropriate interval.
Conclusion
By utilizing the asynchronous batch workflow, you can programmatically verify thousands of contacts without blocking your application's main thread. This approach provides a scalable foundation for segmenting your audience based on their WhatsApp Business presence. For full technical details and current limits, consult the official API documentation.
This article was drafted with AI assistance and reviewed before publishing.













