How to Connect VKontakte to O-Key
This guide will show you how to connect VKontakte to O-Key so your AI agent can automatically respond to messages. Two methods are available: via a community (recommended) and via a personal account.
Community Connection
Section titled “Community Connection”This is the official and stable connection method. You’ll need a VK community where you have admin rights.
Prerequisites
Section titled “Prerequisites”- A VKontakte account
- A VK community (group) where you are an administrator
- An O-Key account with a configured AI agent
Connection Steps
Section titled “Connection Steps”-
Find your community ID
Open your VK group. The group ID is the number in the URL (e.g.,
vk.com/club123456789— ID =123456789). -
Enable community messages
Go to “Manage” → “Messages” and enable message receiving.
-
Create an access token
In “Manage” → “API usage”, create a new access key with all required permissions.
-
Get the confirmation code
On the “Callback API” tab, copy the string from the “Confirmation code” field.
-
Open channel settings in O-Key
In O-Key CRM, go to “Agents” → “Settings” → “Channel connections”.
-
Select VKontakte
Click “VKontakte” and make sure “Community” mode is selected.
-
Fill in the details
Enter three fields: group ID, group token, and confirmation code.
-
Save and copy the Callback URL
After saving, O-Key will generate a Callback URL — copy it.
-
Paste the URL in VK
Go back to VK, to the “Callback API” tab, and paste the URL in the server address field.
-
Confirm the connection
Click “Confirm”. A green checkmark indicates a successful connection.
-
Enable the “Incoming message” event
On the “Event types” tab, check
message_new(Incoming message). -
Test it
Send a message to the community from another account — the AI agent should respond automatically.
Personal Account Connection
Section titled “Personal Account Connection”This method allows receiving messages directly to a personal account without creating a community.
-
Open vkhost.github.io
Go to the website to get a token.
-
Authorize via VK Admin
Select the VK Admin application and complete authorization.
-
Copy the access_token
Extract the
access_tokenvalue from the URL in the address bar. -
Switch mode in O-Key
In the VKontakte channel settings, select “Personal account” and paste the token.
-
Test it
Ask someone to send you a direct message.
Troubleshooting
Section titled “Troubleshooting”Bot not responding in group
Section titled “Bot not responding in group”- Make sure the
message_newevent is enabled in VK event types - Check that the access token has not expired
- Make sure the AI agent is not paused in O-Key
VK shows “Server Error”
Section titled “VK shows “Server Error””- Compare the confirmation code in O-Key and VK — they must match exactly
- Re-save settings in O-Key and retry confirmation
Personal bot stopped responding
Section titled “Personal bot stopped responding”- Generate a new token via vkhost.github.io
- If VK sends warnings, switch to the community method
Chats not showing in CRM
Section titled “Chats not showing in CRM”- Send a new message after connecting — old chats may not sync
- Check the channel filter — select “All channels”
If the issue persists, contact us at: support@o-key.ai