DelightChat's deep integration with Shopify enables a variety of WhatsApp marketing use cases. However, it's possible that as an ecommerce brand, you may have custom use cases or triggers at which you want to send a WhatsApp message to a customer.
Or you might be a non-ecommerce brand who wants to trigger a WhatsApp message to your user when certain events happen, or certain actions are taken by the user inside your website or product.
Here are a few example use cases for sending notifications via WhatsApp API:
- When a user registers or signs up for your product.
- When a user completes a certain action inside your product, for eg. for an online learning platform, it could be when they complete a class or test.
- When a user makes a booking of a service within your product.
In all such cases, DelightChat's WhatsApp Marketing API can be used to send a message.
How to create a custom WhatsApp Automation using DelightChat Marketing API
Navigate to WhatsApp Marketing > Automations and click on [Create New Automations]. And then select the API option.
In the next page, complete the following steps
- Provide an automation name
- (2) Configure Message - Choose a message template
- Scroll to the bottom of the page and click on [Save] button
After you save the automation, an automation ID is generated and a curl request preview gets populated in the DelightChat UI. Ask the developer in your team to look at this page and they will know exactly how to use it.
Preview POST Request
curl --location --request POST 'https://api.delightchat.io/api/v1/public/message' \
--header 'X-API-KEY: your-account-API-key-here' \
--header 'Content-Type: application/json' \
"1": "Dear Customer",
The POST request is really simple.
- DelightChat's public API endpoint URL is mentioned
- Your account's API KEY which you need to include in the header is mentioned
- Under data-raw, to trigger this specific Automation in DelightChat, use the provided automation_id
- Send the country_code and phone_number of the customer to whom you wish to send the message
- All the parameters under message_data help resolve the variables in the WhatsApp message template.
To test the automation, call the sample request using your own phone number. Make sure you have [Enabled] the Automation Status first!