curl --request POST \
--url https://api.jelou.ai/v1/hsm/file \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignName": "<string>",
"elementName": "<string>",
"botId": "<string>",
"params": [
{
"param": 123,
"column": "<string>"
}
],
"type": "text",
"mediaUrl": "<string>",
"fileUrl": "<string>",
"buttonPayloads": [
{}
],
"actions": {},
"scheduledAt": "2023-11-07T05:31:56Z"
}
'{
"message": [
"<string>"
],
"status": "<string>"
}Send templates in bulk to multiple recipients and check the status of your campaigns
curl --request POST \
--url https://api.jelou.ai/v1/hsm/file \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignName": "<string>",
"elementName": "<string>",
"botId": "<string>",
"params": [
{
"param": 123,
"column": "<string>"
}
],
"type": "text",
"mediaUrl": "<string>",
"fileUrl": "<string>",
"buttonPayloads": [
{}
],
"actions": {},
"scheduledAt": "2023-11-07T05:31:56Z"
}
'{
"message": [
"<string>"
],
"status": "<string>"
}.CSV extension are supported.
!, $, %, &, *, etc.)._) if necessary.phone_number, customer_name, order_amount
Incorrect: phone number, customer-name!, order#amount
+ symbol (for example, for a number in Ecuador, write PHONE_NUMBER).
Your order {{1}} for a total of {{2}} is confirmed. The expected delivery is {{3}}.
| phone_number | param_1 | param_2 | param_3 |
|---|---|---|---|
| PHONE_NUMBER | A12345 | $250.00 | December 1 |
| PHONE_NUMBER_2 | B67890 | $100.50 | December 2 |
| PHONE_NUMBER_3 | C22345 | $50.00 | December 3 |
POST https://api.jelou.ai/v1/hsm/file
multipart/form-data format.
| Property | Type | Description | Required |
|---|---|---|---|
| campaignName | string | Name assigned to the campaign being sent. | Yes |
| elementName | string | Template name. Must have approved status by WhatsApp. | Yes |
| botId | string | Unique identifier of the bot sending the template. | Yes |
| params | array | Array of objects with the parameter number and the corresponding CSV column. If the template has no parameters, the array must be empty. | Yes |
| type | string | Template type: text, image, document, video. Defaults to text. | No |
| mediaUrl | string | Public URL of the media file. Required for image, video, or document templates. | Conditional |
| fileUrl | string | Public URL of the CSV file. Required if the file is not uploaded directly. | Conditional |
| file | file | Attached CSV file. Required if fileUrl is not used. | Conditional |
| buttonPayloads | array | Array of objects for quick reply buttons with skills. | No |
| actions | object | Actions related to the template. | No |
| scheduledAt | date | Date and time in UTC when the campaign will be sent. | No |
Send from public URL (JSON)
curl --request POST \
--url https://api.jelou.ai/v1/hsm/file \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"campaignName": "campaign_name",
"botId": "BOT_ID",
"elementName": "ELEMENT_NAME",
"params": [
{"param": 1, "column": "customer_name"}
],
"mediaUrl": "https://cdn.example.com/image.png",
"type": "image",
"fileUrl": "https://cdn.example.com/campaign.csv",
"buttonPayloads": [
{"type": "edge", "action": "Yes", "skillId": "1"}
]
}'
Send with attached file (multipart/form-data)
curl --request POST \
--url https://api.jelou.ai/v1/hsm/file \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--form campaignName=campaign_name \
--form botId=BOT_ID \
--form elementName=ELEMENT_NAME \
--form 'buttonPayloads=[{"type":"edge","action":"Yes","skillId":"1"},{"type":"edge","action":"Reschedule","skillId":"2"},{"type":"edge","action":"Cancel","skillId":"3"}]' \
--form file=@/local/path/campaign.csv \
--form 'params=[]'
200 - Successful response
{
"message": ["Campaign has been created."],
"status": "success"
}
400 - Bad Request
{
"message": ["Invalid CSV format"],
"status": "failed"
}
401 - Unauthorized
{
"message": "Authentication failed"
}
422 - Unprocessable Entity
{
"message": ["Template not found or not approved"],
"status": "failed"
}
params array is an object that contains:
[
{"param": 1, "column": "customer_name"},
{"param": 2, "column": "order_amount"}
]
[
{"type": "edge", "action": "Yes", "skillId": "1"},
{"type": "edge", "action": "Reschedule", "skillId": "2"},
{"type": "edge", "action": "Cancel", "skillId": "3"}
]
Basic authentication using Base64 encoded clientId:clientSecret
Was this page helpful?