Exp with Whatsapp? I need to get the users phone n...
# 🤝help
o
I am using this : {{ event.tags.conversation['whatsapp:userPhone'] }} in the default value for the variable. But I get the number Iv registered for my table recoreds NOT the actual phone number. I asked someone that isn't registered to check and he got no number at all. What am I missing?? We used Whatsapp to chat with the bot off course
a
Hi. Try whith this: event.tags.user['whatsapp:name']
and for the phone number: event.tags.user['whatsapp:userId']
o
Hi thanks, I see the ID did give the number just without the "+" sign. The question is: Is this reliable method to all clients across the bored? seance I'm asking for and ID and not PHONE in this code
thats the answer I got from GPT if it helps anyone (typically it would be the costumers number but who know its might change) GPT: In the context of the WhatsApp Business API, the user ID typically corresponds to the phone number of the user. When a user interacts with your WhatsApp business account, their phone number is used as the identifier for that interaction. However, it's essential to note that the user ID provided by the WhatsApp Business API may not always be identical to the user's phone number, depending on the specific implementation and configuration. Some messaging platforms or API providers may assign unique identifiers to users for privacy or security reasons, especially in cases where the phone number needs to be obfuscated or anonymized. In most cases, though, especially with platforms like WhatsApp, the user ID will indeed be the user's phone number. When handling incoming messages in your Botpress bot, you can typically extract the user's phone number from the message payload to identify the sender and personalize the interaction accordingly.