Choose this guide for step-by-step Windows/macOS instructions. If you prefer curl or a runnable Node.js example, use the alternative guide; you do not need to complete both. Bot API examples: send and receive test messages with curl or Node.js
MPChat is available on Android and iOS. Windows PowerShell and macOS Terminal are API debugging tools; send test messages and check replies in MPChat on your phone.
Send your first Bot reply
Send a message on your phone, choose one computer workflow below, then return to your phone to check the reply. No project setup is required.
Device | Role |
Android / iOS | MPChat: send the test message and view the reply |
Windows | PowerShell: call the Bot API |
macOS | Terminal + curl: call the Bot API |
1. Prepare your test Bot and send a message on your phone
On your phone, open MPChat → Contacts → Bots to reach BotFather. Create a dedicated test Bot or select one you already manage, then copy its token. See the BotFather token instructions.
Open the test bot's private chat in MPChat and send
mpchat-quickstart.Use a test bot with no active webhook or other process polling for updates.
No immediate reply is expected yet: you will read this message and send a reply through the API below.
2. Choose Windows or macOS
Complete only one workflow. Run its commands in order in the same window. If you try another workflow later, send a new test message first.
Windows · PowerShell
Open PowerShell from the Windows Start menu. Run the first block, then enter your test token at the prompt; it will not be displayed.
A. Verify the token with getMe.
$secret = Read-Host "Test bot token" -AsSecureString
$token = [System.Net.NetworkCredential]::new("", $secret).Password
$base = "https://call.mp.net/bot/bot$token"
Invoke-RestMethod -Method Get -Uri "$base/getMe" |
ConvertTo-Json -Depth 20
Continue only if ok is true and result.username matches the Bot you opened on your phone. If any call fails, stop and use Troubleshooting below.
B. Read the test message with getUpdates.
$updates = Invoke-RestMethod -Method Post `
-Uri "$base/getUpdates" `
-ContentType "application/json" `
-Body '{"timeout":10,"limit":50,"allowed_updates":["message"]}'
$updates | ConvertTo-Json -Depth 20
In result, find the message with message.text equal to mpchat-quickstart and message.chat.type equal to private. Copy its message.chat.id, not the message ID or Bot ID. Copy all digits exactly, without rounding or scientific notation. If several chats match, stop and identify your own test conversation before sending.
C. Send a reply with sendMessage. Enter the chat ID you just copied.
$chatId = Read-Host "Paste message.chat.id"
if ($chatId -notmatch '^[0-9]+$') {
throw "Enter the private chat ID as decimal digits."
}
$body = @{
chat_id = $chatId
text = "Hello from MPChat Bot."
} | ConvertTo-Json -Compress
Invoke-RestMethod -Method Post `
-Uri "$base/sendMessage" `
-ContentType "application/json" `
-Body $body |
ConvertTo-Json -Depth 20
macOS · Terminal + curl
Press Command + Space, search for Terminal, and open it. The commands work in zsh or Bash. Enter your test token at the prompt and press Return; it will not be displayed.
A. Verify the token with getMe.
printf 'Test bot token: '
read -r -s MPCHAT_BOT_TOKEN
printf '\n'
curl -sS "https://call.mp.net/bot/bot${MPCHAT_BOT_TOKEN}/getMe"
Continue only if ok is true and result.username matches the Bot you opened on your phone. If any call fails, stop and use Troubleshooting below.
B. Read the test message with getUpdates.
curl -sS -X POST \
"https://call.mp.net/bot/bot${MPCHAT_BOT_TOKEN}/getUpdates" \
-H "Content-Type: application/json" \
-d '{"timeout":10,"limit":50,"allowed_updates":["message"]}'
In result, find the message with message.text equal to mpchat-quickstart and message.chat.type equal to private. Copy its message.chat.id, not the message ID or Bot ID. Copy all digits exactly, without rounding or scientific notation. If several chats match, stop and identify your own test conversation before sending.
C. Send a reply with sendMessage. Enter the chat ID you just copied.
printf 'Paste message.chat.id: '
read -r MPCHAT_CHAT_ID
if [[ "$MPCHAT_CHAT_ID" =~ ^[0-9]+$ ]]; then
curl -sS -X POST \
"https://call.mp.net/bot/bot${MPCHAT_BOT_TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d "{\"chat_id\":\"${MPCHAT_CHAT_ID}\",\"text\":\"Hello from MPChat Bot.\"}"
else
printf 'Enter the private chat ID as decimal digits.\n'
fi
3. Check the reply on your phone
Return to the same Bot private chat in MPChat. Seeing Hello from MPChat Bot. completes the test. A successful send also returns ok: true and a message ID.
This is a one-time test reply. Automatic replies require a running message handler using polling or a webhook.
Can I test without a computer?
Yes. MPChat still handles the chat. On Android, a tool such as HTTP Shortcuts sends the API requests; on iOS, use Get Contents of URL in Shortcuts. These are separate API tools, not built-in MPChat features.
The API sequence is the same: GET getMe, POST getUpdates, then POST sendMessage. Use the URLs and JSON bodies shown above, not the shell commands. Keep the token private and do not share shortcuts that contain it.
Troubleshooting
401 — Check that the token belongs to your test bot and is still valid.
Empty result or no matching message — Send
mpchat-quickstartagain. A successfulgetUpdatescall consumes only the updates returned in that response.409 — The bot has an active webhook. Switch to a dedicated test bot without a webhook.
400 on sendMessage — Use the
message.chat.idfrom the test conversation as a decimal string.
If sending succeeds but you cannot see the reply, check the Bot username and chat ID and return to that exact private chat.
A token grants control of the Bot. Do not share commands, screenshots, shortcuts, or error logs that contain it.
