Messenger check (JSON API)
Check whether WhatsApp, Viber or Telegram is registered on a phone number — for example, to clean a database before a messenger campaign. The subscriber receives nothing.
The check is asynchronous. The response to the request carries only the message identifier msg_id and the status QUEUED. The result comes later — usually within a few hours; a request sent late in the day may be answered the next day. Get it with the message status request or in the webhook:
| Status | Meaning |
|---|---|
QUEUED, ACCEPTED | the check is in progress |
DELIVERED | the messenger is registered on the number |
UNDELIVERABLE | the messenger is not registered on the number |
UNKNOWN | the check could not be completed; its price is returned to the balance |
The provider checks numbers in batches, so one request must contain at least 1000 different numbers of the same messenger — each number is a separate element of data. A request with fewer numbers of any messenger is rejected as a whole: Check requires at least 1000 phones per channel in one request, nothing is charged.
The check is charged at your HLR price for the number's country, at the moment the request is accepted. The service is enabled by your manager.
URI: https://alphasms.net/api/json.php
All requests to API are sent in JSON format using the POST method.
Header parameters
Requests must contain header Content-Type: application/json, otherwise, the request will be considered invalid even if it has valid JSON.
Request parameters
Request example
- JSON
- cURL
- PHP
- Python
- Node.js
{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "check",
"id": 100500,
"phone": 447700900123,
"channel": "whatsapp",
"hook": "https://example.org/webhook/url.php"
}
]
}
curl -X POST 'https://alphasms.net/api/json.php' \
-H 'Content-Type: application/json' \
--data-raw '{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "check",
"id": 100500,
"phone": 447700900123,
"channel": "whatsapp",
"hook": "https://example.org/webhook/url.php"
}
]
}'
<?php
$payload = json_encode([
'auth' => 'bb56a4369eb19***cfec6d1776bd25',
'data' => [
[
'type' => 'check',
'id' => 100500,
'phone' => 447700900123,
'channel' => 'whatsapp',
'hook' => 'https://example.org/webhook/url.php',
],
],
], JSON_UNESCAPED_UNICODE);
$ch = curl_init('https://alphasms.net/api/json.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "check",
"id": 100500,
"phone": 447700900123,
"channel": "whatsapp",
"hook": "https://example.org/webhook/url.php",
},
],
}
response = requests.post(
"https://alphasms.net/api/json.php",
json=payload,
timeout=30,
)
print(response.json())
const payload = {
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "check",
"id": 100500,
"phone": 447700900123,
"channel": "whatsapp",
"hook": "https://example.org/webhook/url.php"
}
]
};
const response = await fetch("https://alphasms.net/api/json.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
console.log(await response.json());
Response parameters
| successboolean Result of request execution | ||||||||
| errorstring Error text, returned if success=false | ||||||||
| datalist[object] List of objects with the results of request execution
|
Response examples
- Accepted
- Not available
- Access denied
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": true,
"data": [
{
"success": true,
"data": {
"msg_id": 23468710,
"phone": 447700900123,
"channel": "whatsapp",
"status": "QUEUED",
"id": 100500
}
}
]
}
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": true,
"data": [
{
"success": false,
"error": "No route"
}
]
}
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": false,
"error": "Access denied"
}