Bot API · Bot token
getUpdates
Long-poll for incoming updates
Long-polling update retrieval with offset semantics: every update with update_id SMALLER than offset is confirmed and never returned again. When timeout > 0 and nothing is pending, the call waits up to timeout seconds, checking once per second. Returned updates are marked delivered_poll=true. Each call stamps last_poll_at, which tells bot-ingest to skip the webhook while a poll loop is alive (60s grace). Each update object is { update_id, ...payload }. Known update types in v1: message and my_chat_member.
Request
curl https://api.sprintelex.com/getUpdates \
-H "Authorization: Bearer <bot-token>" \
-H "Content-Type: application/json" \
-d '{"timeout":50}'Parameters
| Name | Type | Required | Rules |
|---|---|---|---|
| offset | integer | No (default 0) | updates with update_id < offset are confirmed and never returned again |
| limit | integer | No (default 100) | clamped to 1-100 |
| timeout | integer | No (default 0) | long-poll wait in seconds, clamped to 0-50 |
Response
{ ok: true, result: { updates: [ { update_id, message: { message_id, date (unix seconds), chat: { id (thread UUID), type: 'private'|'group', title (groups only) }, from: { id (per-bot scoped sender id, 'u_' + 16 hex chars, NOT the raw user UUID), username, display_name }, text, reply_to_message_id (nullable) } } | { update_id, my_chat_member: { chat: { id (DM thread UUID, or bot id if no thread yet), type: 'private' }, from: { id (scoped sender id), username, display_name }, date, old_chat_member: { status }, new_chat_member: { status } } } ] } }. For blockBot: old 'member' -> new 'kicked'; for unblockBot: old 'kicked' -> new 'member'.Rate limit: 30 calls per 1-second window per bot+env
Errors
| Status | Error | When |
|---|---|---|
| 429 | rate limit exceeded: slow down | more than 30 calls in 1 second |
| 500 | could not fetch updates | DB query failed |