Notifications

It is a mechanism to directly retrieve the status of sent messages. It allows you to get relevant information like the amount of read messages of your individual, bulk messages, or your campaign.

By using notifications you can notice the user behavior and use that information to improve your marketing campaign or choose a better message type to be more accurate in your messages. You can obtain specific information from a notification ID or all Notifications to populate your database or your Control Dashboard to make better decisions or take action afterward.

Get Notification by ID

GET https://api.jelou.ai/v1/bots/:botId/notifications/:notificationId

This endpoint allows you to get a previously sent notification by giving a notification ID

Path Parameters

Name
Type
Description

notificationId*

string

ID of the Notification.

botId*

string

ID of the Bot.

Headers

Name
Type
Description

Authentication

string

Authentication token

{
  "wasRead": true,
  "destination": "593999999999",
  "sentStatus": "DELIVERED_USER",
  "origin": "BULK",
  "createdAt": "2021-07-08T16:55:37.953Z",
  "sentDate": "2021-07-08T16:55:37.953Z",
  "elementName": "notification_example",
  "campaignId": "someId",
  "error": null,
  "internalId": "someInternalId",
  "id": "notificationId"
}

Get Notifications

GET https://api.jelou.ai/v1/bots/:botId/notifications

This endpoint allows you to get previously sent notifications

Path Parameters

Name
Type
Description

botId

string

ID of the Bot.

Query Parameters

Name
Type
Description

download

boolean

Download file.

campaignId

string

Campaign ID.

elementName

string

Element name.

from

date

Start date.

to

date

End date.

limit

number

Pagination limit ( Max: 50 ).

page

number

Page number. Default 1

Sample API

curl --request GET \
  --url 'https://api.jelou.ai/v1/bots/BOT_ID/notifications?limit=PAGE_LIMIT&from=START_AT&to=END_AT&page=PAGE_NUMBER' \
  --header 'Authorization: Basic {{Base64EncodedUsername:Password}}'

The total number of records and pagination information are returned in the 'pagination' object. The 'results' array describes the deliveries that match the search parameters. Statistics classified by their respective delivery states are contained in the '_metadata' object.

{
  "pagination": {
    "limit": 1,
    "total": 10,
    "offset": 0,
    "totalPages": 1
  },
  "_metadata": {
    "stats": {
      "FAILED": 1,
      "CREATED": 0,
      "DELIVERED_USER": 3,
      "DELIVERED_CHANNEL": 0,
      "USER_READ": 1,
      "TOTAL_HSM": 4,
      "USER_REPLIED": 2,
      "TOTAL_DELIVERED": 3
    },
    "performance": {
      "FAILED": "33.33",
      "CREATED": "0.00",
      "DELIVERED_USER": "100.00",
      "DELIVERED_CHANNEL": "0.00",
      "USER_READ": "33.33",
      "USER_REPLIED": "66.67"
    }
  },
  "results": [
    {
      "_id": "ID",
      "wasRead": "No",
      "messageId": "MESSAGE_ID",
      "destination": "DESTINATION",
      "sentStatus": "SENT_STATUS",
      "request": {},
      "origin": "API",
      "createdAt": "CREATED_AT",
      "sentDate": "SEND_DATE",
      "elementName": "ELEMENT_NAME",
      "deliveryChannelAt": "DELIVERY_CHANNEL_AT",
      "error": null,
      "deliveryUserAt": "DELIVERY_USER_AT"
    }
  ]
}

Message Status List

DELIVERED_CHANNEL

Message was received by Whatsapp

DELIVERED_USER

Message was received by the User

READ

Message was read by the User

REPLY

Message was reply by the User

CREATED

Message was received by Jelou

FAILED

Message failed

Message Read Status

Status
Description

true

Message was read by the User

false

Message has not been read by the User

Sample API Responses

The payload contains the following fields:

Field
Description

status

Delivery status of the template.

timestamp

Date of the event in milliseconds (ms).

destination

User's phone number.

id

ID of the message.

error

Reason for the template delivery failure. Available when the status is "FAILED".

reply

User's response. Available when the status is "REPLY"

DELIVERED CHANNEL

{
  "status": "DELIVERED_CHANNEL",
  "timestamp": 1672320999889,
  "isFinalEvent": true,
  "destination": "593912345678",
  "id": "86e9e0e5-123-4ef6-567-ab42363910"
}

DELIVERED USER

{
  "status": "DELIVERED_USER",
  "timestamp": 1672326431552,
  "isFinalEvent": true,
  "destination": "593912345678",
  "id": "86e9e0e5-123-4ef6-567-ab42363910"
}

READ

{
  "status": "READ",
  "timestamp": 1672331937335,
  "isFinalEvent": true,
  "destination": "593912345678",
  "id": "86e9e0e5-123-4ef6-567-ab42363910"
}

REPLY

{
  "reply": "Hello",
  "id": "86e9e0e5-123-4ef6-567-ab42363910",
  "timestamp": 1672329944349,
  "status": "REPLY",
  "isFinalEvent": true,
  "destination": "593912345678"
}

CREATED

{
  "status": "CREATED",
  "timestamp": 1672160621946,
  "isFinalEvent": true,
  "destination": "593912345678",
  "id": "86e9e0e5-123-4ef6-567-ab42363910"
}

FAILED

{
  "status": "FAILED",
  "timestamp": 1672160621946,
  "isFinalEvent": true,
  "destination": "593912345678",
  "id": "86e9e0e5-123-4ef6-567-ab42363910",
  "error": "Number Does Not Exists On WhatsApp"
}

Last updated