Quickstart

From zero to a bot that replies, in under fifteen minutes. You need the SprinTelex app and five minutes of patience.

1. Create a bot

In the SprinTelex app: Settings → Developer → My bots → New bot. Give it a name and a username ending in bot. You get two tokens: a test token and a live token. The test token only works in sandbox chats and can never reach real users, so do all of your development with it.

Your token is a password. Anyone holding it can send messages as your bot. Never commit it to git, never put it in client-side code, and rotate it the moment you suspect a leak (one click on the bot page in the dashboard).

2. Check your token

curl https://api.sprintelex.com/getMe \
  -H "Authorization: Bearer <your-test-token>"

A healthy token answers { ok: true, result: { ... } } with your bot's id, name, and username.

3. Open a test chat

On the bot's page in the app, tap Open test chat and send it a message. Test chats carry a TEST banner so you always know you are in the sandbox.

4. Read the update

Poll for updates with long polling. The call waits up to 50 seconds for something to arrive:

curl https://api.sprintelex.com/getUpdates \
  -H "Authorization: Bearer <your-test-token>" \
  -H "Content-Type: application/json" \
  -d '{"timeout": 50}'

You will see your message arrive as an update with an update_id and a message.chat.id. That chat id is where replies go.

5. Reply

curl https://api.sprintelex.com/sendMessage \
  -H "Authorization: Bearer <your-test-token>" \
  -H "Content-Type: application/json" \
  -d '{"chat_id": "<from the update>", "text": "Hello from my bot"}'

What next