curl --location 'https://api.weya.live/backend/api/whatsapp/validate-whatsapp-number' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"phoneNumber": "+15551234567",
"token": "YOUR_AISENSY_API_TOKEN"
}'
{
"status": true,
"code": 200,
"message": "WhatsApp number and authentication token verified successfully!",
"errorMessage": null,
"data": {
"verified": true
}
}
Phone Numbers
Validate WhatsApp Number
Check a WhatsApp number and AiSensy token before connecting them.
POST
/
api
/
whatsapp
/
validate-whatsapp-number
curl --location 'https://api.weya.live/backend/api/whatsapp/validate-whatsapp-number' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"phoneNumber": "+15551234567",
"token": "YOUR_AISENSY_API_TOKEN"
}'
{
"status": true,
"code": 200,
"message": "WhatsApp number and authentication token verified successfully!",
"errorMessage": null,
"data": {
"verified": true
}
}
Overview
Check with AiSensy that the token is valid and that the WhatsApp number is connected in that AiSensy account. Nothing is saved; connect the number afterwards with Create WhatsApp Integration, sending the same fields.Prerequisites
- An API key for your workspace
- An AiSensy account with the WhatsApp number connected, and its API token
Request
curl --location 'https://api.weya.live/backend/api/whatsapp/validate-whatsapp-number' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"phoneNumber": "+15551234567",
"token": "YOUR_AISENSY_API_TOKEN"
}'
Request Parameters
Response
{
"status": true,
"code": 200,
"message": "WhatsApp number and authentication token verified successfully!",
"errorMessage": null,
"data": {
"verified": true
}
}
Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request
phoneNumberortokenis missing, orprojectIdis missing forpro.Invalid phone number format.Number not found, not connected, or not verified.– the number isn’t connected in that AiSensy account.- AiSensy rejected the token.
- 401 Unauthorized – Missing or invalid API key.
- 429 Too Many Requests – More than 1,000 WhatsApp requests in 15 minutes from your IP address.
- 500 Internal Server Error – Unexpected server error.
Was this page helpful?

