Sandbox (Test API Key)

The document explains how to use our WhatsApp Sandbox Environment.

We provide a developer-friendly test environment, for anyone who wants to explore the usage of our WhatsApp API. In the test environment, you can test sending messages and templates.

How to get started with sandbox.

Sandbox Base Path: https://waba-sandbox.360dialog.io/

Each phone number has its own Test API-KEY, and you are able to test sending messages/templates only to your phone number.

Limitations

What you can do in the Sandbox

  • You can use the Test API-KEY to send text messages and templates to your own phone number.

  • A maximum of 200 messages can be sent with the sandbox.

  • Your phone number acts like a user and can send and receive messages.

  • The number can be a landline number, as long it is able to use WhatsApp.

  • You can switch the endpoint at any time. If you don't have one yet you can use a free services like RequestBin or webhook.site to set up an endpoint.

  • Each Sandbox API Key is linked to one phone number and you can only send test messages to that phone number. If you wish to test messages with more than 1 number then it is advised to set up a test WhatsApp Business Account (Staging WABA) to use instead of the Sandbox.

What you can't do with the Sandbox

  • The Sandbox is a test environment only. Messages and Templates can be sent only to your own phone number.

  • You can send two types of templates – marketing and interactive.

  • We do not yet provide response information when you use the WhatsApp API.

  • Uploading and retrieving media files using the media ID.

Send Template Message

POST https://waba-sandbox.360dialog.io/v1/messages

Headers

Name
Description
Key

D360-API-KEY (string)

Sandbox API KEY

gJSVEzk2Hh4x

Request Body

Name
Description
Key

to (number)

Your number

gHl4MCVdYUib

type (string)

Message type

ELKfZ2H5yW2y

namespace (string)

Template namespace

2i5r8y8iifgW

language (string)

Template language

90btM6Zo81Se

policy (string)

Delivery policy

s4BpPFJGGi5a

code (string)

Language code

rnYiY0y5jTDG

name (string)

Template name

45KqHij9Rt80

Example Request Payload

first_welcome_messsage

Note that this example covers first_welcome_messsage with personalization. In the case of the disclaimer template, the payload is similar but without the componentsobject (it holds personalization parameters which are not used in disclaimer).

CURL

Creating API Key

Send a WhatsApp message START to the number 4930609859535. In the following examples, we assume your phone number is 49YOURNUMBER. Save API Key (in the examples will be YOUR_API_KEY).

Setting your webhook (optional)

Use external service e.g. requestbin.com to test webhook answers, or create your own webhook server for tests. In the case you want to test with localhost you may use e.g. external ngrok.com service.

Then set your webhook:

Now you may send any messages to the number 4930609859535. You will receive all webhooks as described in WhatsApp API https://developers.facebook.com/docs/whatsapp/api/webhooks

For example, when you send a message with content abcd you will receive the message:

Test sending messages

In your webhook, you will receive messages about status updates. For example:

Test sending templates

Similarly to sending text messages, you will receive webhooks with status updates.

Code Examples For Developers

Code Examples

Python

Creating an API key

Send a WhatsApp message START to the number 4930609859535. In the following examples, we assume your phone number is 49YOURNUMBER. Save the D360-API-KEY (in the examples it is described as YOUR_API_KEY).

Setting your Callback URL (optional)

Use an external service (such as requestbin.com) to test webhook responses, or create your own webhook server for tests. In the case you want to test with localhost, you may use an external service (such as ngrok).

Now you may send any messages to the number 4930609859535. You will receive all webhooks as described in the WhatsApp API Webhooks Page.

For example, when you send a message with content abcd you will receive a message:

Test sending messages

In your webhook, you will receive messages about status updates. For example:

Test sending templates

Similarly to sending text messages, you will receive webhook calls with status updates.

PHP

Creating an API key

Send a WhatsApp message START to the number 4930609859535. In the following examples, we assume your phone number is 49YOURNUMBER. Save API Key (in examples will be YOUR_API_KEY).

Setting your webhook (optional)

Use external service e.g. requestbin.com to test webhook answers. Or create your own webhook server for tests. In case if you want to test with localhost you may use e.g. external ngrok.com service.

Then set your webhook:

Now you may send any messages to the number 4930609859535. You will receive all webhooks as described in the WhatsApp API Webhooks Page.

For example, when you send a message with content abcd you will receive a message:

Test sending messages

In your webhook, you will receive messages about status updates. For example:

Test sending templates

Similarly to sending text messages you will receive webhook calls with status updates.

Last updated

Was this helpful?