Chat History

Page describing the API for consulting the chat history.

Chat History

GET https://api.jelou.ai/v1/bots/<botId>/users/<userId>/history

This endpoint allows you to get the chat history between a user and its respective bot.

Path Parameters

NameTypeDescription

botId

string

Bot id

userId

string

User phone number(Without "+" sign.

Query Parameters

NameTypeDescription

limit

string

Number of messages to request

direction

string

The direction in which messages, new or old will be searched(values: "newer" | "older").

messageId

string

message Id of the message that will be taken as a reference for the query

{ chat: 
    [
        {
            "messageId": "<messageId>",
            "received": <timeInMilli>,
            "senderId": "<userPhoneNumber> || <botId>",
            "recipientId": "<botId> || <userPhoneNumber>",
            "bubble": {
                "type": "<type>",
                .
                .
                .
            },
            "status": "[CREATED || DELIVERED_CHANNEL || DELIVERED_USER || FAILED]",
            "by": "<bot || operator || user>"  
        },
        .
        .
        .
    ]
}

In case of skipping the optional fields the Default values will be handled.

Request example

## Chat history Request
# Get chat history
curl --request GET \
  --url 'https://api.jelou.ai/v1/bots/<botId>/users/<userId>/history?limit=<limit>&messageId=<messageId>&direction=<direction>' \
  --header 'authorization: <clientId>:<clientSecret>'

Last updated