> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Answer Callback Query

- Component: `appmixer.telegram.core.AnswerCallbackQuery`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.telegram 1.1.2](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.AnswerCallbackQuery>

Acknowledges an inline-keyboard button press, optionally showing a toast or an alert to the user who pressed it. Telegram shows a loading indicator on the button until the query is answered, so pair this with the New Callback Query trigger. Answers are accepted for a short window after the press.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Callback Query ID (`callbackQueryId`) | text | The _id_ emitted by the New Callback Query trigger. |
| Text (`text`) | textarea | Notification text shown to the user. Up to 200 characters. |
| Show Alert (`showAlert`) | toggle | Show a modal alert instead of a transient toast at the top of the chat. |
| URL (`url`) | text | URL opened by the client instead of showing text. |
| Cache Time (Seconds) (`cacheTime`) | number | How long clients may cache this answer. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Success (`success`) | boolean | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.telegram.core.AnswerCallbackQuery",
  "label": "Answer Callback Query",
  "description": "Acknowledges an inline-keyboard button press, optionally showing a toast or an alert to the user who pressed it. Telegram shows a loading indicator on the button until the query is answered, so pair this with the New Callback Query trigger. Answers are accepted for a short window after the press.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:telegram"
  },
  "quota": {
    "manager": "appmixer:telegram",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "callbackQueryId": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "showAlert": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          },
          "cacheTime": {
            "type": "integer"
          }
        },
        "required": [
          "callbackQueryId"
        ]
      },
      "inspector": {
        "inputs": {
          "callbackQueryId": {
            "type": "text",
            "index": 1,
            "label": "Callback Query ID",
            "tooltip": "The <i>id</i> emitted by the New Callback Query trigger."
          },
          "text": {
            "type": "textarea",
            "index": 2,
            "label": "Text",
            "tooltip": "Notification text shown to the user. Up to 200 characters."
          },
          "showAlert": {
            "type": "toggle",
            "index": 3,
            "label": "Show Alert",
            "tooltip": "Show a modal alert instead of a transient toast at the top of the chat."
          },
          "url": {
            "type": "text",
            "index": 4,
            "label": "URL",
            "tooltip": "URL opened by the client instead of showing text."
          },
          "cacheTime": {
            "type": "number",
            "index": 5,
            "label": "Cache Time (Seconds)",
            "tooltip": "How long clients may cache this answer."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "example": true
          }
        },
        "required": [
          "success"
        ]
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
