Activate the Twilio Sandbox for WhatsApp
Head to the WhatsApp section of your Twilio Console to activate the Twilio Sandbox for WhatsApp. The sandbox lets you test out Twilio’s WhatsApp API using a shared, universal number without having to wait for your Twilio number to be approved by WhatsApp.
After checking the box to activate the sandbox, you’ll be asked to send a specific code message from your WhatsApp number to the provided universal WhatsApp number. After completing this connection, you’ll see this success screen:
Write some code
Head to your main dashboard within the Twilio Console and find your Account SID and Auth Token. Copy and paste these values into the .env file you created earlier as the values for the variables TWILIO_ACCOUNT_SID
and TWILIO_AUTH_TOKEN
respectively.
Open up the index.js file you created earlier in your favorite text editor. Copy and paste the following code into this file: