Automatic Product Posting to Social Networks: VK, Telegram, Facebook
When a manager publishes a product in the catalog, we configure automatic posting to social networks — sending announcements to VK, Telegram channel, Facebook Page, Odnoklassniki. No manual copying, minimal delay, correct formatting for each platform. The system is built on an event-driven architecture with queues: when a product is added, an event is generated and processed independently for each social network. This frees the team from monotonous work, speeds up customer notification, and eliminates errors.
Problems We Solve
Manual posting is a source of errors and time loss. The manager might forget to publish a product, copy the wrong link, or select the wrong image. With a large assortment, this becomes a bottleneck. Another challenge: platforms have different APIs, limits, and formatting requirements. VK allows up to 16,000 characters and emojis, Telegram only 1024 with HTML tags, Facebook generates a preview from the URL. Our system unifies the process by adapting content to each social network.
How to Integrate Automatic Posting?
Architecture — event-driven pipeline. Product publication triggers a ProductPublished event, which is picked up by separate listeners for each social network. Each listener places a task in a queue, and a worker processes it independently. This ensures that a failure in one network does not block publication in others.
ProductPublished event ├── VkPostListener → queue: vk-posts ├── TelegramPostListener → queue: telegram-posts ├── FacebookPostListener → queue: facebook-posts └── OdnoklassnikiPostListener → queue: ok-posts VK Integration
We use VK API v5.199. For posting from a community, a token with wall permission is required. Photo upload is a two-step process: get the upload URL, then upload the file and save it.
Sample PHP code
// Step 1: get upload server $uploadServer = $vk->photos->getWallUploadServer(['group_id' => $groupId]); // Step 2: upload image $uploaded = Http::attach('photo', file_get_contents($imageUrl), 'photo.jpg') ->post($uploadServer['upload_url']); // Step 3: save photo $saved = $vk->photos->saveWallPhoto([ 'group_id' => $groupId, 'photo' => $uploaded['photo'], 'server' => $uploaded['server'], 'hash' => $uploaded['hash'], ]); // Step 4: publish post $vk->wall->post([ 'owner_id' => -$groupId, 'message' => $caption, 'attachments' => "photo{$saved[0]['owner_id']}_{$saved[0]['id']}", ]); Telegram — Simplest Case
The Telegram Bot API only requires a token and chat_id. Use sendPhoto or sendMediaGroup for multiple photos. The caption supports HTML and MarkdownV2.
import httpx async def post_to_telegram(bot_token: str, channel_id: str, photo_url: str, caption: str): async with httpx.AsyncClient() as client: resp = await client.post( f"https://api.telegram.org/bot{bot_token}/sendPhoto", json={ "chat_id": channel_id, "photo": photo_url, "caption": caption, "parse_mode": "HTML", }, timeout=15, ) resp.raise_for_status() return resp.json() Caption limit is 1024 characters. If the description is longer, an additional message is sent via sendMessage with reply_to_message_id.
Facebook Page via Graph API
Graph API v19.0, method /{page-id}/photos. Requires a Page Access Token with pages_manage_posts permission.
POST /v19.0/{page-id}/photos ?url=https://cdn.example.com/img.jpg &message=New product in catalog... &published=true How Are Posting Failures Handled?
Each queue task has 3 attempts with exponential backoff (1 min → 5 min → 15 min). After attempts are exhausted, a record is written to failed_social_posts with the error body and the admin is notified. Publication metrics (success/failure per platform) are displayed on a dashboard.
Advantages of the Event-Driven Approach
| Feature | Manual Posting | Automatic Posting |
|---|---|---|
| Reaction time | Hours–days | Seconds after publication |
| Errors | Human factor | Retry system (3 attempts) |
| Platform adaptation | Must remember specifics | Templates configured once |
An event-driven queue scheme is 10+ times more reliable than a simple HTTP call in a controller.
Text Templates
Different platforms require different formatting. Templates are stored in the database and editable via CMS:
| Platform | Specifics |
|---|---|
| VK | Up to 16k chars, emojis, clickable links |
| Telegram | HTML tags <b>, <i>, <a>, limit 1024 |
| Links in text — preview generated automatically |
Template variables: {name}, {price}, {url}, {description}, {tags}. Additionally, conditional blocks can be configured—for example, if the price is zero, display "Price on request".
How to Set Up Auto-Posting in 5 Steps
- Analyze the current catalog and select social networks.
- Obtain tokens and access rights for each platform.
- Design the event-driven pipeline and queues.
- Integrate each platform via API with testing.
- Configure post templates and a monitoring dashboard.
Benefits of Automation
We have implemented similar integrations for dozens of online stores. Our experience shows that automating posting reduces manager time by 80% and increases reach through regular publication. For example, in a project with a catalog of 5000 products, posting time was reduced from 2 hours to 20 seconds after adding a product. You get a turnkey solution with documentation and post-launch support. Contact us for a free project assessment—we will prepare a proposal for integration.
What's Included
- Analysis of the current catalog and selection of social networks
- Design of the event-driven pipeline
- Integration of each platform (tokens, API, testing)
- Configuration of post templates and variables
- Implementation of a monitoring dashboard
- Administrative documentation
- Team training (1–2 hours)
- 1 month of support after launch
Timeline
Integration of two platforms (VK + Telegram) takes 4–6 business days. Each additional platform adds 1–2 days. A control panel with post history and templates adds another 2–3 days. Exact timing depends on catalog complexity and the number of networks.
Get an engineer consultation on integration—we will select the optimal stack and architecture for your project.







