Campaign API
You can use the Campaign API to send WhatsApp or SMS messages via your own application. When a message is send to a user, we log the message in a campaign database. If a user responds then to a message we'll show the last 'campaigns' in which the user was included. Every send message will consume 1/20 of a conversation from your subscription.
To extract data from this section you have to create API Key with 'Campaign' scope.
You can only send WhatsApp templates to a user. So in the POST message you must also include the TemplateNameSpace, TemplateName and template variables in the body. Also keep in mind that you need consent from the receiver that allows you to send them messages. This is your own responsibility and you can read all about it here. We have a WhatsApp Consent API available for you to register the received consent.
POST URL
/v1.0/Campaign/SendMessage
Body
{
"Name": "",
"Description": "",
"Targets": [
"",
""
],
"ConfigId": null,
"Whatsapp": {
"DisplayName": "",
"TemplateName": "",
"TemplateNamespace": "",
"Language": "",
"IgnoreConsent": false,
"Parameters": [
"",
{
"type": "text",
"text": ""
},
{
"type": "date_time",
"date_time": {
"value": ""
}
},
{
"type": "currency",
"currency": {
"currencytype": "",
"amount": null
}
}
],
"HeaderParameters": [
{
"type": "text",
"text": ""
},
{
"type": "document",
"url": "",
"name": ""
},
{
"type": "image",
"url": ""
},
{
"type": "video",
"url": ""
}
],
"ButtonsParameters": [
{
"type": "text",
"text": "",
"index": 0
}
]
}
}
Return
After posting you'll receive a return value with the results:
{
"Returns": {
"succeeded": [
""
],
"failed": {
"": "NoConsent"
}
}
}
- Name: Here you can fill in the name of the campaign
- Description: Extra description field
- Targets: Destination numbers
- Configid: Id of the sending TouchPoint
- TemplateNamespace/Name: Name of the template which should be used
- Language: Language version of the template
- IgnoreConsent: If this value is set to True, then you will ignore the WhatsApp consent registration
- Parameters: The content of the parameter values used in the template
When sending failed with the reason 'NoConsent' then this means that there is no active consent registration found in the consent database.
SMS
Body
{
"Name": "",
"Description": "",
"Targets": ["", ""],
"ConfigId": ,
"Sms": {
"Text": ""
}
}
- Name: Here you can fill in the name of the campaign
- Description: Extra description field
- Targets: Destination numbers
- Configid: Id of the sending TouchPoint
- Text: Content of your sms message