Guides
Long polling
Best for local dev without a public URL. Conflicts with webhooks.
When to use
Use long polling when you lack public HTTPS. Prefer webhooks in production.
Steps
- Remove any webhook (
deleteWebhookor console). - Call
POST /api/v1/bots/getUpdatesin a loop; set nextoffsettomax(update_seq)+1. - Or use the SDK
startPolling()/stopPolling().
Example
curl -X POST "$API/bots/getUpdates" \
-H "Authorization: Bearer $SOCHAT_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"offset":0,"limit":100,"timeout":30}'
Limits & errors
timeout0–50s;limit1–100.- Active webhook →
409.
Most local failures are leftover webhooks in the console.
Next
API · Quickstart.
