Upload a database
POST
/botman/{token}
Upload or update the bot's user database in @BotManRobot. A bot not yet in BotManager is added automatically. - token
- Bot token from @BotFather
Request body (form-data)
- file
- File with user and/or group IDs: txt, csv, xls, xlsx, json. Required
Query parameters
| Parameter | Required | What it is |
|---|---|---|
| owner_id | yes | Your Telegram ID: @BotManRobot attaches the bot and the database to this account |
| folder_id | no | Folder ID in @BotManRobot (My bots → Folders) - the bot goes into it |
| show_file_result | no, true | false - do not send report files after mailings |
bash
curl -X POST "https://api.botstat.io/botman/BOT_TOKEN?owner_id=123456789" \
-F "file=@users.txt"
Response
json
{
"ok": true,
"result": {
"message": "Data updated"
}
}
Errors
json
{
"ok": false,
"result": {
"error_code": "RATE_LIMITED",
"message": "Please wait 240 seconds before updating the database again."
}
}
| HTTP | error_code | When |
|---|---|---|
| 401 | INVALID_TOKEN | Invalid bot token |
| 429 | RATE_LIMITED | This bot's database was updated less than 5 minutes ago. The message says how many seconds to wait |
| 422 | MISSING_PARAMETERS | The file or owner_id is missing. The message lists what is missing |
| 422 | INVALID_PARAMETERS | A parameter has the wrong type, e.g. owner_id is not a number |
Was this article helpful?
Didn't find the answer? Contact support