The MessageBird WhatsApp Sandbox allows you to try and prototype WhatsApp Business in a developer environment without going through the approval process. In this quickstart, you’ll learn how to get started with MessageBird’s WhatsApp Sandbox in 5 easy steps.
- Step 1: Activate the sandbox
- Step 2: Connect your device to the sandbox
- Step 3: Choose a WhatsApp Template Message
- Step 4: Send a reply from the device
- Step 5: Send a reply from the sandbox
- What't next?
- Testing via the API?
Step 1: Activate the sandbox
Step 2: Connect your device to the sandbox
You’ll now need to connect your device to the sandbox. You can do this in two ways:
Scan the QR code
- Open your phone camera and focus it on the QR Code. You'll see a push notification to open WhatsApp.
- Click on the push notification to enter the conversation with your Sandbox environment.
- You will see a pre-filled message with the word 'join' followed by a two-word entry code. Press to send the message, and you're connected!
Send an entry code
- Save the WhatsApp Sandbox number as a new contact in your phone.
- Go to the Sandbox dashboard and find instructions under 'Send a WhatsApp message'. You will need to send a two-word entry code to a specific number.
- Go to WhatsApp on your phone and send your unique two-word entry code to this number, and you're connected!
The ‘Waiting for Your Message’ box now reads "Congrats! You're now connected to the sandbox." This means you're ready to start messaging.
Step 3: Send a Message Template from the sandbox
In this step, the sandbox is replicating a business-initiated conversation via the WhatsApp API using Message Templates.
Choosing a Template
It’s time to choose a WhatsApp Template Message. The displayed templates have already been submitted approved by WhatsApp, so you can start using them straight away for testing.
You have three Template Messages options:
- Customer Support
- User Verification (2FA)
- Order Notifications
Other use cases are also available with WhatsApp. Check out some more examples of approved use cases for the WhatsApp Business solution here: What are the use cases for WhatsApp Business?
Setting the variables in your message
In this step you will be able to set the variables and personalise your message. We've chosen some custom variables for each type of message already, but feel free to play around with the custom variables using the text boxes.
Ready to go? Click ‘Send template message’ and your WhatsApp Template Messages with custom variables will be sent to your phone.
Step 4: Send a reply from the device
In this step, we will go deeper into two-way conversation via the WhatsApp API.
You can now write a response from your phone as an end user to the Sandbox number. When end-users send a message to your WhatsApp number, a 24-hour conversation session is enabled, during which you can freely chat with yourself—to and from the sandbox. You can send as many replies as you want—the reply will automatically update to create a new 24 hour window.
Once you send a reply to the sandbox, the ‘Waiting for a message’ field will update with your message. You're ready to continue the two-way conversation with the Sandbox.
Step 5: Send a reply from the sandbox
Because you are in the 24-hour conversation session with your phone as end user, you are not limited to using pre-approved Message Templates. During the 24-hour window you will be able to chat freely. Messages sent during this time are called Session Messages.
A few things to keep in mind
- For now, the WhatsApp Sandbox can only be active in one window at a time and only one user per Workspace can connect simultaneously. To successfully connect to the sandbox, make sure to close any additional active windows. If another user is already connected to the workspace, simply switch to another workspace.
- Want to leave this Sandbox and join another? Simply reply `Stop` at any time to the WhatsApp Sandbox.
You may now want to check out these resources:
- Getting Started with WhatsApp Business
- WhatsApp Business step-by-step onboarding
- Install Channel: WhatsApp Business (developers documentation)
Testing via the API?
Sending a Message Template
If you are looking to test WhatsApp via the API this is not a problem. When you are sending your Message Template in step 4, you will see a code snippet to the side. You can use this code snippet to send a message from your project. You'll see an example response in the field underneath the snippet.
The dynamic API request automatically updates depending on the custom variables that you set, so you can use the code snippets from the sandbox to start building while waiting for the WhatsApp approval.
You can connect the WhatsApp Sandbox to your application by configuring webhooks in the WhatsApp Sandbox settings. All you need to do is enter your webhook URL to the input field and hit save. This will now POST all WhatsApp Sandbox events to your webhook URL.
Note: You can configure up to 5 webhook URLs with the WhatsApp Sandbox.
For more information about configuring webhooks via the API, check out the WhatsApp Sandbox Developer Documentation.