Mobile Chatbot Development for VKontakte

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Mobile Chatbot Development for VKontakte
Simple
from 4 hours to 2 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

VKontakte Chatbot Mobile Development

VK Bot API is one of the most advanced in CIS countries: Callback API, Long Poll, Keyboard, Carousel, VK Mini Apps. VKontakte audience is 100M+ users in Russia and CIS. For Russian businesses, it's a primary messenger channel alongside Telegram.

Two Ways to Receive Messages: Callback vs Long Poll

Callback API — VK sends a POST to your HTTPS server on each event. Similar to webhooks. Suitable for production.

Long Poll — your server makes a GET request that "hangs" until a new event appears. Works without HTTPS, convenient for development.

Callback API is configured in the VKontakte group's Management → API Settings → Callback API section. When you add it, VK sends a confirmation event — return the string from group settings:

from fastapi import FastAPI, Request

app = FastAPI()
CONFIRMATION_TOKEN = "abc123xyz"  # From group settings
SECRET_KEY = "your_secret"        # For signature verification

@app.post("/vk/webhook")
async def vk_webhook(request: Request):
    data = await request.json()

    # Signature verification
    if data.get("secret") != SECRET_KEY:
        return "forbidden"

    if data["type"] == "confirmation":
        return CONFIRMATION_TOKEN

    if data["type"] == "message_new":
        message = data["object"]["message"]
        await handle_message(message)

    return "ok"  # VK requires exactly the string "ok"

If you don't return "ok", VK will retry the event up to 3 times, then mark delivery as failed.

Sending Messages: Messages API

import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType

# Via vk_api library
vk_session = vk_api.VkApi(token=GROUP_TOKEN)
vk = vk_session.get_api()

def send_message(peer_id: int, text: str, keyboard=None):
    params = {
        "peer_id": peer_id,
        "message": text,
        "random_id": 0  # 0 = auto random_id for duplicate protection
    }
    if keyboard:
        params["keyboard"] = json.dumps(keyboard)
    vk.messages.send(**params)

random_id is important: VK deduplicates messages by (peer_id, random_id). With random_id=0, it's automatic. With a fixed value, a retry won't create a duplicate message — protection against double-sending.

Keyboard and Carousel

VK Keyboard is similar to Telegram InlineKeyboard but with two modes: regular keyboard (inline: false) replaces the system keyboard, inline (inline: true) attaches to a specific message.

keyboard = {
    "inline": False,
    "one_time": False,  # Don't hide after clicking
    "buttons": [
        [
            {
                "action": {
                    "type": "text",
                    "label": "Catalog",
                    "payload": json.dumps({"command": "catalog"})
                },
                "color": "primary"
            },
            {
                "action": {
                    "type": "text",
                    "label": "Cart",
                    "payload": json.dumps({"command": "cart"})
                },
                "color": "secondary"
            }
        ]
    ]
}

Button colors: primary (blue), secondary (white), positive (green), negative (red). Maximum 4 buttons per row, 10 rows.

Carousel (template carousel) is a horizontal card carousel, similar to Generic Template in Messenger. Up to 10 elements, each with image, title, description, and buttons.

VK Mini Apps

VK Mini Apps are web applications inside VKontakte, analogous to Telegram Mini App. SDK: @vkontakte/vk-bridge.

import bridge from '@vkontakte/vk-bridge';

bridge.subscribe((e) => {
    if (e.detail.type === 'VKWebAppUpdateConfig') {
        // Theme (light/dark), color scheme
        const scheme = e.detail.data.scheme;
        document.body.setAttribute('scheme', scheme);
    }
});

// Get user data
const userInfo = await bridge.send('VKWebAppGetUserInfo');
// { id, first_name, last_name, photo_200, ... }

vk-bridge enables: getting user data, opening payment dialog (VKWebAppOpenPayForm), requesting geolocation, copying to clipboard, opening QR scanner.

Mini App authorization: launch_params in the URL contain signed data (the sign field). Server-side verification via HMAC-SHA256 with the API Secret from app settings is mandatory.

Getting User Information

On an incoming message, from_id is the VK user ID. To get name and photo:

users = vk.users.get(user_ids=from_id, fields="photo_50,city")
user = users[0]
# {'id': 12345, 'first_name': 'Ivan', 'last_name': 'Ivanov', 'photo_50': 'https://...'}

Important: the bot sees only public information. Private profiles show first_name as "DELETED" or are unavailable.

Development Process

Creating a group and configuring the API. Choosing Callback or Long Poll. Implementing webhook with verification. Dialog flows, Keyboard. For VK Mini Apps: development with vk-bridge, server-side verification. Analytics via VK Business. Deployment and monitoring.

Timeline Estimates

A bot with keyboard and command handling — 1–2 weeks. A VK Mini App with authentication, full UI, and API integration — 4–8 weeks.