Campaigns API is intended to allow customers to send campaigns without needing to log in to Yalo's Platform UI.
This API has two main actions:
-
Save Notifications: receives a JSON with an array of notifications to send with an account id and botslug, each notification has a hsmName, clientId, and parameters to replace in the message template, it returns a requestId that the client can use to see the progress of the notifications.
-
Get Report: returns a CSV file containing the status of the notifications sent via the Save Notifications endpoint.
Save notifications
The save notifications endpoint receives an array of notifications consisting of a template name, clientId, cellphone, and template parameters. You can see an example below:
[
{
"hsmName": "TEMPLATE_NAME",
"clientId": "PROVIDE_INTERNAL_IDENTIFIER_HERE",
"cellphone": "+50212345678",
"parameters": {
"EXAMPLE_KEY": "EXAMPLE_VALUE"
}
},
{
"hsmName": "TEMPLATE_NAME_2",
"clientId": "PROVIDE_INTERNAL_IDENTIFIER_HERE",
"cellphone": "+50287654321",
"parameters": {
"EXAMPLE_KEY2": "EXAMPLE_VALUE2"
}
},
]
Each register in the payload array represent a notification, if you want to group notifications by some internal criteria, you can use the same clientId
parameter for all the notifications in the same group.
Internally, Yalo will group notifications by hsmName
and create a new campaign for each group (see reference below):
Each campaign will have their own representation in Yalo's platform, as if it was created directly in the UI. So, everything we offer in our platform site, will be available for these campaigns created through the Campaign API.
Request Id
After a successful request to this endpoint, it will return a Request Id. Afterwards, you can use this id to get a report on all the notifications sent through a single call to this endpoint.
Get Report
Allows API users to download a report given a set of query parameters:
Parameter | Optionality | Effect |
---|---|---|
start-date | Optional | If used, filters out any notification sent previous to this date. |
end-date | Optional | If used, filters out any notification sent after this date. |
request-id | Optional | If used, filters out any notification sent through a different request. |
If no filters are provided, this report will query by a given account and flow, all notifications sent today (current timestamp).