If you are developing an app that will be used by other businesses, please refer to our Get Started for Tech Providers or Get Started for Solution Partners guides.

Get Started

This guide will help you send and receive your first message using Cloud API. You will also learn how to configure Webhooks for use with a sample app.

This guide is intended for people developing applications for themselves or their organization. If you are developing an application that will be used by other businesses, see the Get Started for Solution Partners doc or the Get Started for Tech Providers doc.

Before You Start

You will need:

Step 1: Add The WhatsApp Product To Your App

At this point, if you created a new app, you’ll be prompted to Add products to your app. Scroll down, and under WhatsApp, select Set up. Otherwise, select your app from the My Apps screen, and you can follow the same instructions again to add WhatsApp to your app.

If you have a Meta Business Account (MBA), you will be prompted to attach it when adding the WhatsApp product to your app. If you don’t have an MBA, you’ll be taken through some prompts that will help you create one. Once your MBA is attached to your application, you’ll be ready to start testing.

Adding the WhatsApp product to your app does a few things for you:

  • Prompts you to create a Meta Business Account if you don’t have one.
  • Creates a test WhatsApp Business Account for you, automatically. This account has limitations and should be used for testing and development purposes since you don't pay for messages.
  • Creates a test business phone number associated with your WhatsApp Business Account. With this number, you can send free messages to up to 5 recipient phone numbers.
  • Creates a set of pre-approved message templates.

Step 2: Add a Recipient Number

Add a valid WhatsApp number where you can send test messages.

In the left-hand menu of the App Dashboard, navigate to WhatsApp > API Setup. Under Send and receive messages, select the To field and choose Manage phone number list.

You can add any valid WhatsApp number as a recipient. The recipient number will receive a confirmation code in WhatsApp that can be used to verify the number.

Once you verify the recipient number, it should now be selected in the To field. Repeat this process if you’d like to add another recipient, up to 5 in total.

Step 3: Send a Test Message

Send the pre-approved hello_world template message to your chosen recipient number.

In the WhatsApp > API Setup panel:

  1. Ensure your test business phone number is selected in the From field.
  2. Ensure you have the recipient phone number you would like to message selected in the To field. If you have multiple numbers added, you can send multiple messages at once.
  3. In the Send messages with the API panel, click the Send message button.

Alternatively, you can copy the cURL command, then paste it into a new terminal window and run it.

Notice that the code indicates you are sending a template message (”type”:”template”) and identifying a specific template to use (”name”:”hello_world”).

Step 4: Clone Our Sample App and Configure Webhooks

With webhooks, you can receive real-time HTTP notifications of changes to specific objects. In WhatsApp, webhooks can notify you of many events in your app, like message delivery and read notifications, and even account changes.

Add a callback URL in order to see the contents of webhooks. Follow our Sample Callback URL for Webhooks Testing guide to clone our sample app, which accepts webhooks notifications and displays their JSON payloads on-screen.

Once your webhook is set up, resend the template message and then reply back to it. You should see 4 separate webhook notifications: The message send, delivered, and read notifications, and the incoming message contents. Nice work!

Step 5: (Optional) Add a Real Business Number

With your test business number and test WhatsApp business account, you can begin to develop your application. When you use these test assets, you don’t pay to send messages as you work to develop your app.

Once you are ready to start sending messages to your customers, you can add a real business phone number in the API Setup panel and create a real WhatsApp Business Account.