To register WhatsApp subscribers via the Pushwoosh API, you must use the registerDevice method. A common mistake is attempting to use registerUser or passing the phone number in a custom parameter.
Required Configuration
- Endpoint:
POST https://api.pushwoosh.com/json/1.3/registerDevice - Device Type: Must be set to
21(the identifier for the WhatsApp platform). - HWID: Must follow the format
whatsapp:followed by the phone number in E.164 format (e.g.,whatsapp:+15550000000). - Push Token: Do not pass a separate push token; for WhatsApp, the
hwidacts as the push token.
Example Request Body
{
"request": {
"application": "YOUR_APP_CODE",
"hwid": "whatsapp:+15550000000",
"device_type": 21,
"userId": "user_12345",
"tags": {
"Name": "John Doe",
"Customer_Type": "Premium"
}
}
}
By including the userId and tags in the same request, you can associate the device with a user profile and set attributes simultaneously.
Comments
0 comments
Please sign in to leave a comment.