In this guide, you will learn how to broadcast any WhatsApp Media Template with Flow Builder by creating a flow using a webhook as a trigger and Postman to trigger the webhooks.
- Before you begin
- Step 1: Upload your template message in .json format on Postman
- Step 2: Access your Developer Key
- Step 3: Create a CSV list
- Step 4: Double-check the body of the Postman request
- Step 5: Run your request
Before you begin
Before you get started, you will need to complete the following 3 steps first:
- Create a business account by signing up with MessageBird - WhatsApp Business Plan.
- Register a Media Template following the instructions in this article: Media Templates
- Install Postman.
Step 1: Upload your template message in .json format on Postman
- Your technical account manager will create a Postman .json collection for each campaign you have. Please request this from him/her.
- Once you have downloaded the .json file, select Import on the upper-left-hand corner of Postman. Upload your .json file and select Import.
- You will be able to see the .json collection added on the lefthand side of your page. Select your Postman request with the name of your campaign.
- You will be directed to “Headers”. If your access key has already been included, skip Step 2 and head to Step 3.
Step 2: Access your Developer Key
- Login to your MessageBird Dashboard account.
- Go to Developers on the left-hand side and click on the API access tab.
- Select Show key for the Live key and copy Key.
Do note that this key should not be shared publicly. Keep this key confidential.
Step 3: Create a CSV list
- Create an excel or Google form. If you have an existing contact list, please update it like the following:
Make sure the phone number starts with the country code.
There must always be column headers. These headers can be changed but please ensure that they match the variables in your Postman request.
Step 4: Double-check the body of the Postman request
- Under the Body tab, you can check the variables and details of your Postman request.
- The “to”: field variable must match the phone number column name of your .csv file. In this case, the variable is {{phone}}.
- If there are any variables in your template message:
- You may choose to either include the variables such as the {{firstname}} in the CSV file
- Or you can include a static value that will replace the variable {{firstname}} with “text” instead as an example.
- If you make any changes to your template body, please select Save on the upper right-hand corner.
Step 5: Run your request
- Choose Runner from the top row.
- A Collection Runner window will pop up, select your campaign collection — the saved request will populate into the RUN ORDER. Ensure that your request is selected.
- Click Select File and open contacts.csv. You may Preview to check that your file is correctly uploaded.
- Unselect Keep variable values and Save cookies after collection run
- Click the RUN… button. The Runner will then send each request to every contact in the .csv file flow following from the 1st row until the last row of the contacts.csv file.
Status:
- Passed: A green flag and 204 No Content.
- Failed: A red flag and 400 Bad request. If that’s the case, please make sure you did not miss any previous steps.