extended-salmon•2y ago
how to capture the user name and number from whatsapp ?
Hey im doing an integration of abot with WhatsApp and voiceglow/voiceflow and i would like to capture the user name and their whatsapp once they initiate the conversation on whatsapp with my bot and transfer them to google sheets
Is it
Possible to do so with a function ? If so what would be the javascript code ?
Is it possible maybe to store it in a variable ?
2 Replies
Yes, it's possible to capture user information such as name and number from WhatsApp and store it in a variable using Voiceflow. You can use the
context
object provided by the WhatsApp Business API to access the user's phone number. However, please note that WhatsApp does not provide the user's name directly.
Here's a basic example of how you might do this:
To transfer this data to Google Sheets, you would need to use the Google Sheets API. Here's a basic example of how you might do this:
Please replace 'your-spreadsheet-id'
with the ID of your Google Sheet, and '/path/to/your/service/account/key.json'
with the path to your service account key file.
Remember, this is a basic example and might need to be adjusted based on your specific needs and setup. Also, please note that you need to handle user data responsibly and in accordance with WhatsApp's policies and guidelines.extended-salmonOP•2y ago
@Tico | Voiceflow Assistant could i input this as a functin?
Function?
Is it possible to input this as a function? @Tico | Voiceflow Assistant