https://discord.gg/botpress logo
#🤝help
How to get user's WhatsApp number from Studio?
# 🤝help
e

early-train-33247

05/31/2023, 12:53 PM
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

rich-battery-69172

05/31/2023, 1:14 PM
@early-train-33247 yes tags are available in the
event.tags
e

early-train-33247

05/31/2023, 5:59 PM
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

broad-teacher-42540

06/02/2023, 4:01 PM
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

acceptable-kangaroo-64719

06/02/2023, 4:57 PM
@broad-teacher-42540 it could also be
event.tags.conversation['whatsapp:userPhone']
depending on region
b

broad-teacher-42540

06/02/2023, 5:23 PM
@acceptable-kangaroo-64719 - Thanks it works
e

early-train-33247

06/02/2023, 7:56 PM
@acceptable-kangaroo-64719, @broad-teacher-42540, it is actually whatsapp:userPhone indeed, I said it wrong, I am sorry!!
166 Views