---
title: "Answer on callback"
method: POST
path: "/answers"
tags: ["messages"]
---

# Answer on callback

`POST /answers`

## Request

- Base URL: `https://botapi.tamtam.chat`
- URL: `https://botapi.tamtam.chat/answers`
- Auth: API key in query parameter `access_token`

This method should be called to send an answer after a user has clicked the button. The answer may be an updated message or/and a one-time user notification.

## Query parameters

- `callback_id` string, required

## Request body

- CallbackAnswer: Send this object when your bot wants to react to when a button is pressed
  - `message` NewMessageBody
    - `text` string, nullable, required: Message text
    - `attachments` AttachmentRequest[], nullable, required: Message attachments. See `AttachmentRequest` and it's inheritors for full information
      - `type` string, required
    - `link` NewMessageLink, required
      - `type` 'forward' | 'reply', required: Type of linked message
      - `mid` string, required: Message identifier of original message
    - `notify` boolean: If false, chat participants would not be notified
    - `format` 'markdown' | 'html': Message text format
  - `notification` string, nullable: Fill this if you just want to send one-time notification to user

## Response `200`

Success or not result

- SimpleQueryResult: Simple response to request
  - `success` boolean, required: `true` if request was successful. `false` otherwise
  - `message` string: Explanatory message if the result is not successful

## Other responses

- `401`: Authorization Error. No `access_token` provided or token is invalid
- `405`: Method is not allowed
- `500`: Internal Server Error

## Changes

- **2021-05-31** `dc45288cfedc`: 2 breaking, 1 info
  - for the `query` request parameter `callback_id`, the minLength was increased from `0` to `1`
  - added the pattern `^(?!\s*$).+` to the `query` request parameter `callback_id`
  - added the new optional request property `message/allOf[#/components/schemas/NewMessageBody]/format`
- **2019-12-12** `1fa16652454b`: 1 info
  - added `share` discriminator mapping keys to the `message/allOf[#/components/schemas/NewMessageBody]/attachments/items/` request property
- **2019-10-03** `cc15b2158c8b`: 1 warning
  - removed the request property `message/allOf[#/components/schemas/NewMessageBody]/attachment`
- **2019-09-06** `778d9d83cee1`: 1 warning
  - removed the request property `user_id`

[Operation history](https://skmtc.dev/tamtam/apis/tamtam-bot-api/changes/answers/post.md)

---

[API](https://skmtc.dev/tamtam/apis/tamtam-bot-api.md) - [All operations](https://skmtc.dev/tamtam/apis/tamtam-bot-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tamtam/apis/tamtam-bot-api/revisions/fa85402ea716?raw)
