Send

Use this feature to send an Outbound message to your customers through your preferred bot. The API will handle the delivery of the messages to the recipients with your preset template.

When you send a message you can do even more, you can send buttons and action payloads to give users more interactive engagement through flow triggers, extra choices, extra content, or specific information. For a visual guide, consult the Send Bulk section

Ensure that your customers have opted in to receive messages from your business

Send a message

POST https://api.jelou.ai/v2/whatsapp/:botId/hsm

Send an Outbound message to WhatsApp users.

Request Body

An array of objects, each object has the information of the id of the template and the destination

[
  {
    "id": "09d0fc2b-59d9-4149-9543-adfa92586615",
    "destination": "593999999999"
  }
]

Button Payload

Use the following structure in the buttonPayloads field when the template has quick reply buttons:

[
  {
    "flowId": 23838,
    "action": "Mas información"
  },
  {
    "flowId": 24278,
    "action": "Contactar con agencia"
  }
]

There can be only up to three objects. Every object has two keys "flowId" refers to the flow that the button must follow (please contact Jelou team for flowId information), and "action" refers to the name of the button.

Actions payload

The following configurations are supported by HSM.

1. Configuration to a specific flow

This feature is used to redirect users to a specific flow based on the response. The id field corresponds to the flow ID. To get the flowId check the Flow section.

{
  "actions": {
    "setFlow": {
      "id": 2222
    }
  }
}

2. Setting up an option menu

Set up a flow for each of the outbound options. The settings for each of the options must go in the options array. To get the flowId check the Flow section.

{
  "actions": {
    "setState": {
      "type": "options",
      "options": [
        {
          "index": 1,
          "type": "flow",
          "flowId": 1111,
          "title": "Tittle 1"
        },
        {
          "index": 2,
          "type": "flow",
          "flowId": 2222,
          "title": "Tittle 2"
        }
      ],
      "ttl": 86400
    }
  }
}

3. Cache Parameters

This feature is used to save extra information in the cache to utilize it further. It will depend on the desired configuration for the HSM. If you send a URL, it can be used by a flow to redirect that URL for marketing purposes. All parameters to be cached must go in setStoreParams with their respective key-value fields.

This configuration will be valid for 3 months.

{
  "actions": {
    "setStoreParams": {
      "url": "https://apps.jelou.ai"
    }
  }
}

Request details

Response detail

Sample API request

  1. Test message

curl --request POST \
  --url 'https://api.jelou.ai/v2/whatsapp/:botId/hsm' \
  --header 'Authorization: Basic dXNlcjpwYXNzd29yZA==' \
  --header 'Content-Type: application/json' \
  --data '{
	"parameters": [
		"PARAMETER_1",
		"PARAMETER_2"
	],
	"type": "hsm",
	"destinations": [
		"593XXXXXXXX"
	],
	"elementName": "ELEMENT_NAME"
}'
  1. Image message

curl --request POST \
  --url 'https://api.jelou.ai/v2/whatsapp/:botId/hsm' \
  --header 'Authorization: Basic dXNlcjpwYXNzd29yZA==' \
  --header 'Content-Type: application/json' \
  --data '{
	"parameters": [],
	"mediaUrl": "https://s3.us-west-2.amazonaws.com/cdn.devlabs.tech/images/sample.jpeg",
	"type": "image",
	"destinations": [
		"593XXXXXXXX"
	],
	"elementName": "ELEMENT_NAME"
}'
  1. Document message

curl --request POST \
  --url 'https://api.jelou.ai/v2/whatsapp/:botId/hsm' \
  --header 'Authorization: Basic dXNlcjpwYXNzd29yZA==' \
  --header 'Content-Type: application/json' \
  --data '{
	"parameters": [
		"PARAMETER_1"
	],
	"mediaUrl":"https://s3.us-west-2.amazonaws.com/cdn.devlabs.tech/images/PDF_test.pdf",
	"type": "document",
	"destinations": [
		"593XXXXXXXX"
	],
	"elementName": "ELEMENT_NAME"
}'
  1. Video message

curl --request POST \
  --url 'https://api.jelou.ai/v2/whatsapp/:botId/hsm' \
  --header 'Authorization: Basic dXNlcjpwYXNzd29yZA==' \
  --header 'Content-Type: application/json' \
  --data '{
	"parameters": [],
	"mediaUrl":"https://s3.us-west-2.amazonaws.com/cdn.devlabs.tech/images/SampleVideo_1280x720_1mb.mp4",
	"type": "video",
	"destinations": [
		"593XXXXXXXX"
	],
	"elementName": "ELEMENT_NAME"
}'
  1. Text with quick reply buttons message

curl --request POST \
  --url 'https://api.jelou.ai/v2/whatsapp/:botId/hsm' \
  --header 'Authorization: Basic dXNlcjpwYXNzd29yZA==' \
  --header 'Content-Type: application/json' \
  --data '{
	"parameters": [
		"PARAMETER_1"
	],
	
	"type": "hsm",
	"destinations": [
		"593XXXXXXXX"
	],
	"elementName": "ELEMENT_NAME"
}'
  1. Text with call-to-action buttons and dynamic URL message

curl --request POST \
  --url 'https://api.jelou.ai/v2/whatsapp/:botId/hsm' \
  --header 'Accept-Language: es' \
  --header 'Authorization: Basic dXNlcjpwYXNzd29yZA==' \
  --header 'Content-Type: application/json' \
  --data '{
	"destinations": [
		"593XXXXXXXX"
	],
	"parameters": [
		"PARAMETER_1"
	],
	"dynamicUrlParameter": [
		"URL_PARAMETER"
	],
	"elementName": "ELEMENT_NAME"
}'
  1. Text with call-to-action buttons and static URL message

curl --request POST \
  --url 'https://api.jelou.ai/v2/whatsapp/:botId/hsm' \
  --header 'Authorization: Basic dXNlcjpwYXNzd29yZA==' \
  --header 'Content-Type: application/json' \
  --data '{
	"parameters": [
		"PARAMETER_1"
	],
	"type": "hsm",
	"destinations": [
		"593XXXXXXXX"
	],
	"elementName": "ELEMENT_NAME"
}'

Content restrictions for the Authentication category

  • URLs, media, and emojis are not allowed for authentication template content or parameters.

  • The parameter length is restricted to a maximum of 15 characters.

Last updated