In this article, you will create a Twilio account, get a phone number, and save the credentials you will need when writing your App Function. Twilio is used here as a concrete example; the same pattern applies to any provider (SendGrid, 360dialog, Unifonic, or others).By the end of this article, you will have your Account SID, Auth Token, phone number, and a working WhatsApp sandbox ready for testing.
Go to Twillo and sign up for a free trial account.The trial gives you $15 USD in credit and one free phone number (you need to claim it) — enough to complete this guide end-to-end. Verify your email address and log in to the Twilio Console.
Using a different provider?
Skip to Build Your App Fucntion article and follow your provider's documentation to locate the equivalent values (API key, token, sender number). The structure of what you need is the same regardless of provider.
In the Twilio Console, navigate to Develop > Phone Numbers > Manage > Buy a Number.
2
Search for an available number. For WhatsApp testing via the sandbox, any number will work as you need to claim one number. Click Buy and confirm the purchase.
NOTE
On a trial account, Twilio assigns you one number for free. You may not need to purchase an additional one. In case Twillo did not provide you with one, you are able to purchase one number for free.
In the Twilio Console, navigate to Messaging > Try it out > Send a WhatsApp message. You will see a Whatsapp sandbox number and a join code (e.g. join <word>-<word>).
Twilio's WhatsApp sandbox lets you send and receive WhatsApp messages during development without needing a verified WhatsApp Business account.
2
Open WhatsApp on your phone and send the join code to the Whatsapp sandbox number.
3
Once Twilio confirms the number is connected, your sandbox is active.You will also see the following image on Twillo dashboard, confirming the sandbox is active
The Twilio sandbox number is used to send WhatsApp messages to customers. For testing, the developer will use their own verified number (the one used when setting up Twilio) to join the sandbox via the provided join code.During testing, WhatsApp messages can only be sent to verified sandbox numbers. This means the same verified number will be used as the test customer’s phone number when creating orders.