How to get user's WhatsApp number from Studio?
# 🤝help
e
I would like to know the user's phone number and check in my database if they have an account already, so I can greet and log them in automatically. I know this is possible using the API by reading the whatsapp:userPhone tag, so can I access this info through the Bot as well?
r
@early-train-33247 yes tags are available in the
event.tags
e
Alright! I managed to achieve the behavior I wanted by accessing the value at event.tags.conversation['whatsapp:userPhone']. This will make my bot's UX a lot better! Thanks a lot Sylvain!
b
I have used this code in hooks - event.tags.conversation['whatsapp:phoneNumber'] but is returning undefined. I am trying to include this information with chat transcript in Before Outgoing Message hook
a
@broad-teacher-42540 it could also be
event.tags.conversation['whatsapp:userPhone']
depending on region
b
@acceptable-kangaroo-64719 - Thanks it works
e
@acceptable-kangaroo-64719, @broad-teacher-42540, it is actually whatsapp:userPhone indeed, I said it wrong, I am sorry!!
343 Views