Create a Telegram chat history entry

POST /v1/replicas/{replicaUUID}/chat/history/telegram

Save chat history items of a Replica belonging to the logged in user.

Path parameters

application/json

Body

  • content string Required

    Content of the message

    Minimum length is 1.

  • telegram_data object Required

    Telegram information about the message

    Additional properties are NOT allowed.

    Hide telegram_data attributes Show telegram_data attributes object
    • chat_type string Required

      Type of the chat, can be either private, group, supergroup or channel.

    • chat_id number Required

      Unique identifier for this chat.

    • user_id number

      Sender of the message's userID; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats.

    • username string

      Sender of the message's username; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats.

    • message_id number Required

      Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat).

    • Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only.

Responses

  • 200 application/json

    Saves the chat history of the replica by the currently logged in user.

    Hide response attribute Show response attribute object
    • success boolean Required

      Indicates the status of the request

  • The replica specified could not be found or you do not have access to it

POST /v1/replicas/{replicaUUID}/chat/history/telegram
curl \
 --request POST 'https://api.sensay.io/v1/replicas/03db5651-cb61-4bdf-9ef0-89561f7c9c53/chat/history/telegram' \
 --header "X-ORGANIZATION-SECRET: $API_KEY" \
 --header "X-USER-ID: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"content":"How did you handle the immense pressure during the Civil War?","telegram_data":{"chat_type":"string","chat_id":42.0,"user_id":42.0,"username":"string","message_id":42.0,"message_thread_id":42.0}}'
Request examples
{
  "content": "How did you handle the immense pressure during the Civil War?",
  "telegram_data": {
    "chat_type": "string",
    "chat_id": 42.0,
    "user_id": 42.0,
    "username": "string",
    "message_id": 42.0,
    "message_thread_id": 42.0
  }
}
Response examples (200)
{
  "success": true
}