---
sidebar_position: 11
description: Answer button event and other functions to work with VKTeams in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, VKTeams]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Answer button event
 Returns a response to the user when a keyboard button is pressed



`Function AnswerButtonEvent(Val Token, Val EventID, Val Text = "", Val URL = "", Val AsAlert = False) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Bot token |
  | EventID | --queryid | String | &#x2714; | Identifier of the callback query received by the bot |
  | Text | --text | String | &#x2716; | Answer text |
  | URL | --url | String | &#x2716; | URL to be opened by the client application |
  | AsAlert | --showalert | Boolean | &#x2716; | Display the answer as an alert) |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from VK Teams

:::tip
This method call should be used in response to receiving a callbackQuery event

Method at API documentation: [GET /messages/answerCallbackQuery](https://teams.vk.com/botapi/#/messages/get_messages_answerCallbackQuery)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Token  = "001.3501506236.091...";
    LastID = 0;

    For N = 1 To 5 Do

        Result = OPI_VKTeams.GetEvents(Token, LastID, 3);
        Events = Result["events"];

        If Not Events.Count() = 0 Then

            For Each Event In Events Do

                callbackData = Event["payload"];

                If callbackData["callbackData"] = "ButtonEvent1" Then

                    EventID = callbackData["queryId"];
                    Result  = OPI_VKTeams.AnswerButtonEvent(Token, EventID, "Get it!");

                EndIf;

            EndDo;

            LastID = Events[Events.UBound()]["eventId"];

        EndIf;

    EndDo;
```
 




