New check
- token
- Bot token from @BotFather
- key
- Access key from your BotStat account
Request body (form-data)
- file
- File with user and/or group IDs: txt, csv, xls, xlsx, json. Up to 200 MB
Query parameters
| Parameter | Required | What it is |
|---|---|---|
| notify_id | no, 0 | ID of the user who gets the check progress and result in @BotSafeRobot |
| hide | no, false | true - private check: only you see the results. false - after the check they appear on botstat.io |
| show_file_result | no, true | false - do not return result files at the end of the check |
| is_full | no, true | Detailed check: besides the main data - photo, bio and gifts in profiles. Takes longer |
| speed | no, 30 | Requests to Telegram per second, 1 to 90. The speed drops by itself on flood waits, reaching it is not guaranteed |
| use_mtproto | no, false | true - check via MTProto: last activity time and accounts' data center. Adds extra load on the bot |
Bots from @BotMembersRobotIf the token belongs to a bot connected to @BotMembersRobot, the check is always private, without files, at speed 5 and without MTProto - the passed parameters are ignored.
Request example
bash
curl -X POST "https://api.botstat.io/create/BOT_TOKEN/YOUR_KEY?notify_id=123456789&hide=true" \
-F "file=@users.txt"
Response
json
{
"ok": true,
"result": {
"id": "3f1c2b9e-5d1a-4b7e-9c2f-1a2b3c4d5e6f"
}
}
id - the check ID. Progress and result go to the notify_id user in @BotSafeRobot.
Errors
An error comes with an HTTP code and a code in the response:
json
{
"ok": false,
"result": {
"error_code": "INVALID_TOKEN",
"message": "Invalid bot token."
}
}
| HTTP | error_code | When |
|---|---|---|
| 403 | INVALID_KEY | The BotStat key is wrong or blocked |
| 503 | KEY_CHECK_FAILED | Could not verify the key, try again later |
| 400 | EMPTY_FILE | The file is empty |
| 413 | FILE_TOO_LARGE | The file is larger than 200 MB |
| 401 | INVALID_TOKEN | Invalid bot token |
| 503 | BOT_VALIDATION_FAILED | Could not verify the token, try again later |
| 429 | RATE_LIMITED | A new check for a bot can be created at most once a minute. The message says how many seconds to wait |
| 409 | TASK_ALREADY_ACTIVE | The bot already has a check running |
| 400 | INVALID_FILE | Could not read the file or the format is not supported |
| 400 | NO_VALID_IDS | No Telegram IDs in the file |
| 422 | INVALID_PARAMETERS | Invalid request parameters |
| 500 | TASK_CREATION_FAILED | Could not create the check |
Was this article helpful?
Didn't find the answer? Contact support